Finding a Client

If I had three servers:

  1. Master Server
  2. Game Server 1
  3. Game Server 2

If Master Server wanted to find out if a specific client (SteamID64) was on Game Server 1 or Game Server 2, what would be the best way to do it?

I could send a message to both Game Servers and ask, and let them report back using MySQL, but is there a way to do this directly from the Master Server? EG. Query a server IP and get a list of Steam ID’s? I wanted to avoid the Game Servers finding the client, and instead send the message directly to the client’s server.

All servers involved are ran by me, so not other people’s servers :wink:

might be a good place to start if you can figure out how to get steamids from it

I would use mysql anyways - since you can then define yourself data you want to fetch from within the game (like money, inventory etc).

Thanks, that would be useful if I ever get around to writing a Web API ( something I really should have attempted by now but keep putting it off ), but atm I was just wondering if it’s possible to do in Lua or through a get request.

Thanks a lot though as that will be useful.

[editline]30th March 2016[/editline]

Again - exactly the reason a web api would be much better then doing it the way I’m doing :stuck_out_tongue: All data such as stats etc is stored in MySQL, but not what server a player is on. I’ll just do it how I was going to - send a message to all game servers and let them shout back if they have the client.

using mysql is the only other way i can think of like neth said.

[editline]30th March 2016[/editline]

going through the source quarry documentation i dont see a way to get steam id actually.

the PHP Source Query does return an array of all players with their info(Like SteamID)

But I still would preffer MySQL, an example would be:

Set a var “gameserver” to the gameserver ID(which you can then “langualize” on the master server) on join, and upon Disconnect/ShutDown hook, simply set the var to nil. Way easier and doesn’t need 2 different ‘apis’ if I may say so.