Austinb / GameQ

A PHP Gameserver Status Query Library
https://austinb.github.io/GameQ/
GNU Lesser General Public License v3.0
403 stars 134 forks source link

Add support for Factorio #398

Closed shyim closed 6 years ago

shyim commented 6 years ago

Page: https://www.factorio.com/

Austinb commented 6 years ago

If there is a way to query the server and for servers to test on I can build one out. I am not finding any documenation on querying one of these servers. Just requests to add such a feature. If you have info pleas update this issue.

Yive commented 6 years ago

Servers in factorio use a master server sort of method. That being said though, I've managed to capture what's sent back to a client upon entering the "Play on lan" menu ingame. Unfortunately I don't have enough knowledge within PHP or dealing with bytes, but I have figured out that 0090 2a is the max player count. I could be wrong, but I also think 0090 0d is the players online count.

Note that these bytes are from a server which has public visibility set to false along with lan visibility set to true. Only real changes are to the IP and whatever's in the first half of 0000. Sadly I have no friends so I can't really test on where the player list would be found. My guess would be after 00F0.

All that is sent to the server upon query seems to be a 0x10 byte.

Hex Dump:

0000  11 7c 41 1e 06 32 00 00  00 53 65 72 76 65 72 20   .|A..2.. .Server 
0010  6e 61 6d 65 20 73 65 74  74 69 6e 67 20 77 69 74   name set ting wit
0020  68 20 61 20 6c 69 6d 69  74 20 6f 66 20 35 31 20   h a limi t of 51 
0030  63 68 61 72 61 63 74 65  72 73 73 00 0f 22 9b 78   characte rss..".x
0040  53 00 00 00 53 6f 6d 65  20 73 6f 72 74 20 6f 66   S...Some  sort of
0050  20 73 65 72 76 65 72 20  64 65 73 63 72 69 70 74    server  descript
0060  69 6f 6e 20 73 65 74 74  69 6e 67 2e 20 4e 6f 74   ion sett ing. Not
0070  20 73 75 72 65 20 69 66  20 69 74 20 68 61 73 20    sure if  it has 
0080  61 20 6c 69 6d 69 74 20  6f 6e 20 69 74 27 73 20   a limit  on it's 
0090  6c 65 6e 67 74 68 2e 2a  00 00 00 00 00 01 0d 00   length.* ........
00A0  00 00 30 2e 30 2e 30 2e  30 3a 33 34 31 39 37 01   ..0.0.0. 0:34197.
00B0  00 00 00 04 62 61 73 65  00 0f 22 c1 1b a4 59 06   ....base .."...Y.
00C0  00 00 00 04 00 00 00 73  6f 6d 65 04 00 00 00 73   .......s ome....s
00D0  6f 72 74 02 00 00 00 6f  66 04 00 00 00 67 61 6d   ort....o f....gam
00E0  65 03 00 00 00 74 61 67  05 00 00 00 61 72 72 61   e....tag ....arra
00F0  79 00 00 00 00                                     y....

Not sure if this helps, but here's the view from ingame. ingame

I could provide a pcap file if needed.

Austinb commented 6 years ago

Unless there is a way to send a query packet to the server on demand similar to other protocols like Source and the old Gamespy protocols I will be unable to add support.

If you find some documentation on how to send a request to a server and have it respond with the server information please open this issue back up.