Understanding NMT_CloseChildConnection and removing split-screen players on a multiplayer server

I noticed that NMT_CloseChildConnection was added in 5.7, which seems to imply a mechanism for removing split-screen players (child connections) on a server based on the client indicating that it wants to do so. However, the way that NMT_CloseChildConnection and CloseAndRemoveChild is written looks a little weird, and I can’t see how a game would actually cause NMT_CloseChildConnection to be sent. The implementation of CloseAndRemoveChild calls RemoveLocalPlayer if needed on the client, so it can’t be the intent that the game uses RemoveLocalPlayer on the game instance to remove a split-screen player on the server. CloseAndRemoveChild would also only send NMT_CloseChildConnection to the other end if SendCloseMessage was passed as a flag.

Best as I can tell:

  • If a client receives NMT_CloseChildConnection from the server, it calls CloseAndRemoveChild with None flags, so CloseAndRemoveChild won’t send NMT_CloseChildConnection back to the server.
  • If a server receives NMT_CloseChildConnection from the client, it calls CloseAndRemoveChild with DestroyActors flags, which will also not cause NMT_CloseChildConnection to be sent down to the client.
  • The only place that seems to use SendCloseMessage is in UProxyNetDriver::CloseAndCleanUpConnectionRoute, which seems to be for a “multi-server replication” feature that is unrelated to split-screen scenarios.

Before I go down the rabbit hole any further, I just wanted to check:

  • Is NMT_CloseChildConnection intended to be used for split-screen scenarios, or is it only supported for multi-server replication?
  • If NMT_CloseChildConnection is intended to allow split-screen players to be removed, what is the expected code that a game should use to remove a split-screen player?
    [Attachment Removed]

Hi,

The NMT_CloseChildConnection was added as part of the Multi-Server Plugin. A proxy server acts as a client when connecting to a server, with the clients connected to the proxy being treated as child connections.

Because both proxy servers and split-screen connections use child connections, NMT_CloseChildConnection should, in theory, be able to disconnect a split-screen connection. Like you noted though, the only place in the engine that actually sends this specific control message is UProxyNetDriver::CloseAndCleanUpConnectionRoute. However, you can still manually get the child connections of a UNetConnection on the server and call CloseAndRemoveChild on them.

I tried testing this locally, and it did seem to work as expected in the editor. When calling this on the server (and passing in the SendCloseMessage and DestroyActors flags), the client’s split-screen player was disconnected and destroyed, with the parent connection/player still remaining connected to the server. That being said, using the CloseAndRemoveChild function in this way has not seen any thorough internal testing, so there could be issues or side effects to doing so.

Thanks,

Alex

[Attachment Removed]