How to prevent duplicate servers?

I’m currently working on a game in which you can create maps and there will be map servers. The map can be edited by the users, so there should always only be 1 active place server for a map server. Assuming I’m creating a map server place with CreatePlaceAsync() (unless there’s a better way), how would I make sure there’s always only 1 active server?

(scripts not necessay if you can explain the logic) thanks

How are you planning to let your players edit their maps? Do you provide the tools for them to edit, and by that keep track of all objects ingame? With the CreatePlaceAsync(), do you plan to only take a mirror-shot of the current place, or do you create a new place first and bring that player to the new place and let them go wild?

Keep in mind that CreatePlaceAsync() instance will create a new place in that lasts forever, and this place can have multiple servers. Is it necessary to create a new place for every time the user wants to make a map, or is it sufficient to have a “default” state in a place where you can “load in” their map?

The only way I can think of to really restrict the amount of servers is to use ReserveServer and TeleportToPrivateServer. Be aware that you need to keep track of the access code from the ReseveServer-method because you cannot retrieve the code later, and will be forced to reserve a new server instead.


Ah thanks, ReserveServer is what I was looking for. I will be saving the map with a special JSON table that will load from a DataStorage

1 Like