How to get all available servers?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By GoGirlGaming

I’m making a game where when you want to join the game, you’ll be taken to an existing server if one exists and is not full, or if their is no available server, it will create a new one. The only problem is I don’t know how I’d check to see if their are any available servers. How should I go about doing this?

:bust_in_silhouette: Reply From: sparkart

You would have a master list server, which keeps track of all of the sessions available. When you want to join a game, you connect to this server, and this server will see who else is online… if you’re the only one on… it tells you so that you can host your own server and send the master server your information so that people can connect to you. When another person wishes to join, it connects to the master server, who tells them that you have a session available. The master server sends the other player your information so that they can connect to you.