Making a Server List UI to teleport to places

I’d like to create a UI that contains all of the available servers of the places under a game. I have a Hub (start place of the game) and in that hub I’d like for players to be able to teleport to the different places under the game.

I’m not sure how to achieve this, and I’m looking for ideas with an explanation of how I could tackle this. I’ve brainstormed some possible solutions such as DataStores but it’s quite painful to do especially since OnUpdate isn’t working properly.

Thanks.

2 Likes

You can use MessagingService to do this. Have all game broadcast that they are live once a minute. Subscribe to this in all live servers. If a server failed to broadcast, assume it’s dead. When a game server is about to shut down, use game:BindToClose() to attempt to get a message out that it’s shutting down, but do not rely on this occurring.

Alternatively, use this web API.

4 Likes

DataStores are definitely not ideal for this, whether or not OnUpdate works. They’re an awkward work around and OnUpdate needs to be polled to function properly, which is stupid.

MessagingService is the number one pick for you if you are looking to keep everything in-house. Your lobby would act as the dedicated “server” and all other places in your game would act as member places.

All your places will work around two messages to avoid redundancy and possible issues with MessagingService due to fetching irrelevant data or circular receiving; let’s say those messages are “A” and “B”. The lobby, or your dedicated server, will send A and receive B. Your other places will send B and receive A.

To make it easier, let’s use an HQ-Unit scenario as an example. “A” that comes from the dedicated server will be used to message out to your game’s places. Those places will receive A and say “alright, HQ asked for a report back, let’s give them our report (B)”. Those places now send out B including their report data (game data, such as JobId) to HQ (dedicated server). The lobby (HQ) receives B, which is data coming from other games. That data is now ready to be processed.

I’d include a diagram but I’m at school.


Alternatively, you can use the API Avigant linked. Never really used it though, but I feel like MS would be better to apply here over an endpoint. I like keeping things in-house, personally.

11 Likes

I went with using MessagingService to broadcast data to servers for what’s alive and what’s not, using the method @Avigant described.


The other issue I’m facing is how to go about managing a list of servers that are alive.

I thought of wiping a table and then populating it with the newly sent data from servers, but this doesn’t seem like a good idea. On top of this I’m not sure to have the server list readily available for players when they first make a server at the Hub

1 Like

A hack would be that new lobby servers coudl send out “requests for identification” that all game servers would listen for and respond to with a message that new lobby servers would subscribe to. The data sent could include who the response is being sent to.

1 Like