Skip to content

Commit

Permalink
Fixes #1396 (#1508)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberboss authored Oct 16, 2023
1 parent e41e780 commit 11a64a5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion OpenDreamRuntime/DreamManager.Connections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,16 @@ private async Task ConsumeAndHandleWorldTopicSocket(Socket remote, CancellationT

var remoteAddress = (remote.RemoteEndPoint as IPEndPoint)!.Address.ToString();
_sawmill.Debug($"World Topic #{topicId}: '{remoteAddress}' -> '{topic}'");
var topicResponse = WorldInstance.SpawnProc("Topic", null, new DreamValue(topic), new DreamValue(remoteAddress));
var tcs = new TaskCompletionSource<DreamValue>();
DreamThread.Run("Topic Handler", async state => {
var topicProc = WorldInstance.GetProc("Topic");

var result = await state.Call(topicProc, WorldInstance, null, new DreamValue(topic), new DreamValue(remoteAddress));
tcs.SetResult(result);
return result;
});

var topicResponse = await tcs.Task;
if (topicResponse.IsNull) {
return;
}
Expand Down

0 comments on commit 11a64a5

Please sign in to comment.