So basically when I update my game I want my old servers to slowly die out. I want to achieve this by automatically teleporting new players to updated servers (assuming they aren’t following a friend, of course).
Figuring out if a server is new or old isn’t my problem as much as actually teleporting players to a new server. Can that even be done? Is there a way to tell Roblox to make a new server?
Oh yeah, and I don’t want to use reserved servers.
Adding to this, Roblox added a “Reconnect” button on shutdown. So the only issue I really see here is data not saving perhaps, not sure if Player Removing fires on a shutdown.
Do correct me if I’m wrong, but I remember the reconnect button does not show up for developer shutdowns. That makes this moot. It also doesn’t really accomplish “soft shutting down”.
Create a place (call it whatever), this will be like a “Pending Rejoin Hub” where you teleport players when you want to shutdown a whole game.
Have a way of telling all your servers of something (using a website, admin panel, whatever).
On the server, do what you need to figure out if the server is old. If it is old, then notify all clients about the placeId they are currently in, and then use TeleportService:SetTeleportSetting(key, value) to note the placeId. - If you only have one place, this is not necessary.
Teleport all the players to the hub place. Once all of your old servers are gone, you start teleporting the players back to the original place by asking the players for the placeId they stored previously. (TeleportService:GetTeleportSetting), then teleport them (preferably) using TeleportService:TeleportPartyAsync(place, players, data, loadingScreen)
I have not tested this myself, but I believe that in theory it should work.
Only way to tell if a server is new or old is to have your own server versions, and have them compare themselves to see if they are new or old. (say http service to a model’s description or something)
Edit: I’ve honestly always wanted a way for servers to update themselves to whether they are old or new, and have a generated version # based off the amount of backups/updates there are.