Page 1 of 1

Server Query

Posted: Wed Mar 02, 2016 11:24 am
by sotn0r
Hi,

is there a possibility yet to query the factorio dedicated server for current player count, max players etc.?

Re: Server Query

Posted: Wed Mar 02, 2016 1:04 pm
by Kane
I feel this could be a good mod but I think in 0.13 they will have one for sure since their planning a server list so yeah you will see it in 13 :)

Re: Server Query

Posted: Tue Jun 28, 2016 8:49 am
by wh1tebird
Now that 0.13 is here, is there any information published surrounding the server query protocol?

edit: I looked at the traffic and found that the master server list is served on https://multiplayer.factorio.com/get-ga ... oken=TOKEN , but I haven't found the method yet how the master server list queries for the servers.

(for those intersted as how I found this information, i saw with wireshark that there was a DNS request for multiplayer.factorio.com, but the data is encrypted with ssl. I then locally hosted a dummy webserver with ssl and a self-signed certificate. Added multiplayer.factorio.com to the hosts file and then query the servers and look at the log files.)

Re: Server Query

Posted: Tue Jun 28, 2016 12:07 pm
by Bisa
I guess you could achieve a lot of this stuff using the added rcon feature, at least /players is a command that would give you some output to work with

Re: Server Query

Posted: Tue Jun 28, 2016 12:14 pm
by NoPantsMcDance
wh1tebird wrote:Now that 0.13 is here, is there any information published surrounding the server query protocol?

edit: I looked at the traffic and found that the master server list is served on https://multiplayer.factorio.com/get-ga ... oken=TOKEN , but I haven't found the method yet how the master server list queries for the servers.

(for those intersted as how I found this information, i saw with wireshark that there was a DNS request for multiplayer.factorio.com, but the data is encrypted with ssl. I then locally hosted a dummy webserver with ssl and a self-signed certificate. Added multiplayer.factorio.com to the hosts file and then query the servers and look at the log files.)
http://pastebin.com/n9GpAJka have fun parsing it

For anyone that's curious in order to query the browserlist you have to take this link https://multiplayer.factorio.com/get-ga ... oken=TOKEN and change "username" and "token" your username is your factorio account username (not your forum name) and you can find your token in the player-data.json located in your gamdir.

Re: Server Query

Posted: Wed Jun 29, 2016 9:40 am
by wh1tebird
NoPantsMcDance wrote:
wh1tebird wrote:Now that 0.13 is here, is there any information published surrounding the server query protocol?

edit: I looked at the traffic and found that the master server list is served on https://multiplayer.factorio.com/get-ga ... oken=TOKEN , but I haven't found the method yet how the master server list queries for the servers.

(for those intersted as how I found this information, i saw with wireshark that there was a DNS request for multiplayer.factorio.com, but the data is encrypted with ssl. I then locally hosted a dummy webserver with ssl and a self-signed certificate. Added multiplayer.factorio.com to the hosts file and then query the servers and look at the log files.)
http://pastebin.com/n9GpAJka have fun parsing it

For anyone that's curious in order to query the browserlist you have to take this link https://multiplayer.factorio.com/get-ga ... oken=TOKEN and change "username" and "token" your username is your factorio account username (not your forum name) and you can find your token in the player-data.json located in your gamdir.
Indeed, that's the result that I had. But I'm curious as to how does the server give that information to the master list?

Re: Server Query

Posted: Wed Jun 29, 2016 8:12 pm
by Bisa
Try setting up a ssl proxy and tap the wires with wireshark if you want to see what's going on ;) (please devs, make this easier by publishing the api docs?)

Re: Server Query

Posted: Wed Jun 29, 2016 9:59 pm
by wh1tebird
Bisa wrote:Try setting up a ssl proxy and tap the wires with wireshark if you want to see what's going on ;) (please devs, make this easier by publishing the api docs?)
Yeah, that's what I was going to do, but don't have the time for it atm.

edit: Currently solved it by making an RCON connection and issue the /players command. The result is then parsed into JSON and served by a local http server.

Re: Server Query

Posted: Mon Jul 25, 2016 10:08 am
by Khorne