How would yous make a Server list appear on your game?

Edit: solved, thanks to 7z99 and Kdude_YT. I used a SubscrybeAsync on the main place, and a PublishAsync on the secondary ones, publishing a message every 5 seconds. The subscrybeasync collects the info and discards it after 7.5 seconds, or if an updated info is recieved.

I want to make a GUI that shows servers of active golf tournaments on my main place. It would be like a list showing the map (Beach course, Forest Course, etc.), the max players and active players, time left for the tournament to end and a play button.

The problem is that I don’t know what function to use to retrieve server data from a specific place.
I saw people using HttpService, so I tried that, but when I did there were errors of authentication from the urls I used. I don’t know if using datastores to update the server list would be a good idea, because if it fails to remove a server that was shutdown from the datastore, for example, there would be a phantom server on the game.

Maybe MessagingService could work?

When a server starts up, send a message to add the server to the list, when the server is going to end, send another message.

If it fails, no messages will be sent which eliminates the phantom server thing you said.

But what If a main place server starts, the current servers wouldn’t have been messaged to that particular server. Unless I message a ‘RetrieveServers’ Message so they do retrieve it. Would that be a good fix for it?

Oh yeah, forgot about that.

That could probably work, yeah. But honestly it’s pretty hard to navigate having a list of servers without an external program because it’s easy to reach the DS limit and creating a “return” system isn’t really easy either.

But I’m thinking if you had a server send out a signal like “ServerStarted” to all active servers, then you could probably formulate a return system using GenerateGUID.

I guess the size of the message wouldn’t be enough too if it got famous. A message maximum size is 1kb, which from what I saw holds 1000 characters. If I were to return tables containing compressed server data (Ex: {course,p,maxp,time} course=courseid,p=players playing,maxp=max players of server, time = timeleftinseconds on the tournament) each game would hold about 14 bytes of data, meaning that it could message up to math.floor(1000/14)=71 games per message. That would be for the entire game, not just a particular main server.

Yeah, I am not that good on HttpService, but I guess I’ll probably have to do this, try messageservice or datastores. Maybe I’ll try doing a DataStore, then if someone clicks a phantom service play button, a message is sent to test if such server exists and if it doesnt, remove it from the datastore, while also giving the player a message the game has ended.

Yeah, it’s pretty hard to navigate systems like this especially when you are taking into account old/new servers which sucks.

And for the HTTPService thing, you would only need the GUID thing, it creates a code that hasn’t been used before, this could probably be used to simulate a return system. You’d use that in combination with MessagingService.

For the maximum amount of reliability, you would probably need an external database to host what servers are up and running.

Instead of sending a message to the main place from every other server, why not send a message from the main place to all servers, which those servers then send a message back. That way you don’t need datastores to check if the server exists anymore. Then you can just refresh servers in main place easily.

Well I’ll try this message system then, as you and 7z99 suggested. Thank you both for the help.

Hey, sorry for the bump but I created a post that solved another users’ problem that is similar to the one you’re experiencing. This would be more of a visual example of what @KdudeDev said, creating a sort of “response” system from the other servers.

Take a read if you want: