So I am making a feature in my SCPF where high ranks can create a reserved server to access their tryout then get people to join via the code which gets posted on the discord.
The only thing is, I have found the servers stay open even when there are 0 players inside, they dont close, is there a duration a ReservedServer can stay open or is their a way to shut a reservedserver down.
Many thanks, I would like to take any and all suggestions!
A way I can think of doing this is by giving your admins the ability to Delete a server. When this occurs, the server’s ID is logged in a datastore as being deleted. This means that when someone tries to connect with the ID, it checks this datastore.
If the server is flagged as being deleted, you can simply refuse to connect the user.
Looking at the docs I don’t think that the code still being valid means that anything is actually running when no one has joined. The docs say this: “Access codes remain valid indefinitely, meaning reserved servers can still be joined if no game server is running (in this case a new game server will be started)”. It isn’t 100% clear but I interpret it to mean that even if the code is valid, there is no server running and therefore there is not really any load.
Ah, so my problem is the server is not created until the code gets used by the player. so if I do what Elliot says and blacklist the code when they shutdown the server, it theroetically cannot be restarted?
Roblox is able to issue as many server instances as they want at virtually no cost. A reserved server is simply a regular server that is taken out of automatic matchmaking and require a special code and function in order to join the server.
A server is not considered alive when 0 players are in the server, but it is when there are players in the server. Any server id and code are infinitely usable, so simply discarding and forgetting about them is sufficient enough to effectively delete them (just as the site does automatically).
You don’t really need to track deletions or blacklist servers, just don’t show the server id or access code publicly. Save it when you require it, otherwise remove it and discard it. You can add a special join menu in your game or similar if you require joining of servers without showing codes publicly. A certain utility called Adonis admin has this kind of private server management feature in it.
If you absolutely need to delete a server though, then you can save data to that specific server via DataStores. If you don’t need any server configurations, you can open up a deleted servers DataStore and use the server id as a key and true as a value. You’ll then require a script in the overall place that confirms if the running server is a reserved server, then fetch its configurations via the DataStore and act based on those values.