question

bkiefer1992 avatar image
bkiefer1992 asked

How do I stop players connecting during server standby?

According to the lifecycle of a server documentation, the server should call ReadyForPlayers() once its ready to move into the Standby state. This article says that players should be able to connect to the server before ReadyForPlayers() is called. Does this mean TCP listen sockets should be listening at this point? If so, how do I prevent players from connecting to my server during the standby state?

Server instances seem to reuse ports of previously terminated server instances. This means a client attempting to reconnect can't discriminate between the server it was trying to reconnect to, and a new one now sitting in standby listening on the same port.

I feel like there should be a state between Standby and Active where a game server has a chance to begin listening, so that the it doesn't need to be listening during Standby.

Perhaps there's something I'm misinterpreting or don't understand.

multiplayer
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Gosen Gao avatar image
Gosen Gao answered

If you are talking about “Essentially, this state signals to MPS that the game server is ready to be allocated, so players can connect to it.” Then, that means ReadyForPlayers will tell MPS agent that this server instance is ready to be allocated, and after allocation, players can connect to it. So, what you mentioned: “I feel like there should be a state between Standby and Active where a game server has a chance to begin listening, so that the it doesn't need to be listening during Standby.” is correct. You can refer to MpsSamples/UnityMirror at main PlayFab/MpsSamples GitHub, which shows that we start to listen to the port when server is active.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

bkiefer1992 avatar image bkiefer1992 commented ·

Thank you very much Gosen for your clarification. I will update our server to begin listening once the server becomes active.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.