How to check if a reserved server still exists?

Lets say I have a clan system in my game, and being part of a clan grants you access to a server in the game that is unique to that clan. I can reserve a server for the clan, and attach the access key to the clan’s data, so that future players in the clan can join that same server. One issue, however, is that if every one leaves the reserved server, the reserved server will close. So i need a way to check if the reserved server still exists, then create one if it doesn’t, or teleport the player if it does. Does anyone know if there is a way to do this? The Teleport Service API doesnt seem to have any info on it

Im not sure if there is any built in way to know if a server is still active, but using the MessagingService is always an option. You can use it to get a list of active server id’s and find out if the one you are looking for is in there

I see. So the idea here would be to publish a request to all servers, then wait for a response from the server which has the jobId the game is looking for?

Either you wait specifically for an answer from that server, or you take all the answers and put them together in a table and use table.find. For the second one you would need to put a timer of a few seconds to make sure you collected all the server id’s though

I dont see a reason to collect all IDs, since the original request message can indicate which server it is looking for. Having only the target server respond would greatly reduce the number of messages published, which is definitely a plus

I would recommend using the requesting server’s jobId as a topic then for a callback then, so that the messages don’t land in the wrong server

1 Like

I think ill go with this then, thank you

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.