Hiah!
In the game I’m writing I want players to have the option to host their own servers. While I wont implement this for awhile, I’ve still been thinking of ways to have server-lists. I’ve tried many techniques in the past but I am not quite sure which is the best way to do it.
In the past, I’ve tried:
-
Have a global “server” that stores all information of the servers running. When a player hosts a server, the server connects to the global server, and tells all its information. When the client wants the list of servers, he connects to the global server and it sends a list of all active servers
-
Servers constantly use an http request on a php script on my website. This php script updates a list of servers stored in a SQL DB. When a client wants the list of servers, he does an http request on on a php file on my website which returns a list of all the servers in the DB.
Any thoughts? I could easily implement either into my game.