New Space Master Server!

My old master server has been bugging me for ages - connections are funky, and people had to constantly clear their cache and refresh the page, to see each other’s servers! It’s been going on for weeks. Ideas kept popping up in my head, about how I could make my own master server… Eventually these ideas lead to my current concept.

After having had this idea pop up a billion times – and having chaos occur during a beta test because of the old master server – I cracked.

I immediately disconnected from my beta chat, and started work on the PHP, and MySQL.

Here is the concept.

 

MySQL acts like a list of servers – each list item containing connection information.

When a player starts a server, the connection information for that server is gathered, and then send to MySQL as a list item.

MySQL then has a date function – it tells how long ago that server has pinged. The server pings every five seconds, and if a server doesn’t ping within 30 seconds of the last ping – the server is removed from the list.

This means that the Master Server (List of servers) automatically removes dead servers – when a server is closed (killed/becomes dead), it stops pinging.

The main bug in the old master server, was browser caching. The new system prevents the browsers from caching (Or storing old copies of) the master server. Instead it caches the API (Application Programming Interface) that displays, and controls the Master server. Since the API doesn’t change its self – only the results it sends to Space. Likewise, one’s browser will only store the way that the API works, not the things that the API returns.

 

The serve list displays the time since the last ping (LSR), in the server list. The text color moves from green, to red depending upon LSR (Last Server Response).

 

If a server is live, it probably won’t go above 6LSR, but the max is 30LSR for leeway.

3 Responses to “New Space Master Server!”

  • Nice!

    You’ll need to be careful though, as Unity’s master server also includes a connection facilitator that helps players with convoluted internet setups to access each other. Here’s the latest status from the front lines of my master server battle: http://forum.unity3d.com/viewtopic.php?t=35724

  • admin:

    Thanks, Aubrey!

    I am seriously new to networking, and most of that stuff is beyond me – but it’ll probably help anyhow!

    My master server is working rather well – except, I cannot connect to other servers… I think that there is an IP issue; The correct IP is not getting recorded into the database, but I don’t really know how to get such an IP.

  • Dadster:

    Sounds daunting! I need to understand a bit more RE what you are doing -may be able to help with the IP issue…

Leave a Reply