My goal is to create a Multiplayer Card Game. The General idea is that there is a 'Matchmaking Lobby' where all players connect to initially, then it grabs two players and throws them into a room of their own that should be running in an entirely separate thread.
However I am very unclear on how Threads work in some cases here.
1) If a scene or node is created in a separate thread, is that thread alive until the node is removed or just until it is finished being instanced?
2) While I could get players into their own room and set up their own 'game loop', how do I make sure RPCs (Remote Procedure Calls) exist in that thread? There doesn't seem to be a clear way to force them into it?
3) I considered creating two separate threads using the low-level networking for pushing/pulling data, however I have a similar confusion to my above issue. If one of these threads were to push data that emitted a signal, would the receiver of that signal be run in the same thread or would it by default run in the main thread?
Worst case scenario is I can have multiple instances of the server running, with the matchmaking lobby redirecting clients to the relevant port but I'd prefer to avoid this inter-process if possible (or as long as until one process can't handle anymore threads).
Thank you for reading!