I was searching the web for an answer but didn’t find anything interesting related to my question. I have currently a game where the menu is a place with a server of 1 person max.
I need to know when a player joins the game, will it create a new server for him, or will it search for an empty server of the place first (where a player was before and then left to another place in the game) ? This is important for me to know regarding datastore limit and if i need to make a proper “leave” system.
If there is one player in a server, if they leave, it will only stay open as long as your BindToClose() function yields, which can be 30 seconds at most before it’s forcibly closed.
So to answer it, they player will most likely always be put into a newly created server instance.
Unless you’re yielding and holding it open for a long period of time, it’s practically impossible for a player to join a one player server someone just left.
There’s still a slight possibility for a player to join a closing server. You should have a system that kicks all joining players once the player count hits 0.
As everyone says its highly unlikely that someone will join a single player server when its started to close itself (as once the server realises its done everything and isn’t yielding anything it begins to close completely).
A way to guarantee players get their own private server:
You could always create a quick lobby style system using TeleportToPrivateServer and ReserveServer which just transfers them to a guaranteed empty server (and thus no one can join as they don’t have the code and its not a root place).