In my game I am forced to use multiple worlds/places which players can freely teleport between, however, players in VIP servers will end up teleporting to a public server, so to combat this I plan on using a function to detect if the game is a VIP server or not, if it is then use ReserveServer instead. But now people in Dimension 1 cannot join those who teleported to a Dimension 2 as the server was reserved. I found online that I could use DataStores:
But I’m clueless on how I could achieve this? Another issue is that, is there a way to check who created the reserved server? Such as JoinData, but I heard that this is not totally secure. Because in the first place, I could easily check who owns the VIP Server, but in a reserved server, is there a way to check if the person who joined the reserved server via the VIP server owns said VIP server?
What I did was I made a few custom pieces that made this easy to deal with.
I made a module that holds all map metadata (place id, teleport loading screens, etc)
I made a script that will check if it’s a VIP server. If the start place is a VIP server, it will first check to see if there is a reserved server that already exists for that VIP owner ID by checking the datastore, and if not it will auto generate a reserved server ID for each of the maps in the map metadata, then save that to the datastore. If a new place was added to the metadata module and the datastore doesn’t have a reserved server ID for that particular place, it will generate one for that place only and then save that ID to the datastore so it exists for the next time it needs to use it.
After that, I created my own custom teleport service. If the script that checks if it’s a VIP server detects that it is, in fact, a VIP server, it will create a folder of string values named the place ID and set their values to the reserve server ID that that place had saved. The custom teleport service then can check for that folder and if it exists then it will teleport to the reserved server, but if it does not exist it will teleport to the public server. This saves you from writing checks in all the millions of scripts that may have a teleport case in them, and lets the game base itself off of a centralized teleport service interface in rep store or something. You can use _G to make requiring common modules easier and treat it more like a roblox service.
Note: Something that threw me off initially was the fact that, after a reserve server “dies” or the player count reaches zero, you can still teleport to it. It will restart the server but keep the same private “slot”. What my script in step 2 does is it creates a personal server “slot” for each place ID in the game, based on owner ID.
Surely this would just build up hundreds of reserved servers? Because I heard that reserved server access codes are “forever”.
How would I go about making it so that only the access codes of reserved servers only show up when there are still players inside said server? No point of retrieving an access code when there’s no players, I want to mimic a non VIP game as much as I can. Or is this not possible