Hi,
is there a possibility yet to query the factorio dedicated server for current player count, max players etc.?
Server Query
- StoneLegion
- Filter Inserter
- Posts: 687
- Joined: Fri Sep 05, 2014 7:34 pm
- Contact:
Re: Server Query
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
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.)
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
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
Hosting a factorio server? Take a look at this || init script ||.
-
- Filter Inserter
- Posts: 478
- Joined: Fri Jul 17, 2015 6:56 pm
- Contact:
Re: Server Query
http://pastebin.com/n9GpAJka have fun parsing itwh1tebird 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.)
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.
Looking for a multiplayer server? Check out my servers Vanilla Server
Re: Server Query
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?NoPantsMcDance wrote:http://pastebin.com/n9GpAJka have fun parsing itwh1tebird 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.)
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
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?)
Hosting a factorio server? Take a look at this || init script ||.
Re: Server Query
Yeah, that's what I was going to do, but don't have the time for it atm.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?)
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.