Closed Maverick87Shaka closed 7 years ago
Hi @Maverick87Shaka,
There's a known issue with squad servers: they have changed query protocol recently #19.
Kindly asking Simon @ClundXIII to recap what did they change and what needs to be done in order to fix the squad query protocol.
As discussed here e.g.: http://forums.joinsquad.com/topic/18473-querying-your-server-using-gameq3/
It is a bug. An update will fix this soon. Unfortunately there is no documentation at all. All I can say is that it is prettx much the steam protocol: https://developer.valvesoftware.com/wiki/Server_Queries However, if you clone my repository, I created a workaround. But you have to query players aswell and the implementation filters all players with empty names out of the playercount.
In general, the Squad protocol works, we are actively using it on our website ;)
@KostyaEsmukov do I need to implement anything so that the Protocol appears in list.php? Maybe thats the problem.
Regarding the list.php: These warnings are not related to the squad protocol. I think they are present on PHP 7 only. Anyway they are just harmless warnings.
However what is related is that both query and connect ports are required for a squad protocol to work due to the PT_UNKNOWN
port type. Is this intended, i.e. one can't predict the other port by knowing only one? If they are the same, then the PT_SAME
port type should be used, so that only one port must be defined in a game server info.
Description of port types: https://github.com/KostyaEsmukov/GameQ3/blob/master/gameq3/protocols.php#L28
Source protocol (which uses PT_SAME
ports type): https://github.com/KostyaEsmukov/GameQ3/blob/master/gameq3/protocols/source.php#L34
It uses another port for query and the query port can pretty much not be predicted.
This other GameQ V3 seems to have gotten it to work.
https://github.com/KostyaEsmukov/GameQ3/blob/master/gameq3/protocols/squad.php
@ClundXIII Hmm, okay then.
@Maverick87Shaka So, to sum up:
query_port
and connect_port
options. See https://github.com/KostyaEsmukov/GameQ3#addserver-optionsThanks for the help, finally I've managed to connect to my server using:
$gq = new \GameQ3\GameQ3(); try { $gq->addServer(array( 'id' => 'Banshee Squad Server', 'type' => 'squad', 'connect_host' => '127.0.0.1', 'connect_port' => '27015', 'query_host' => '127.0.0.1', 'query_port' => '27165' )); }
Using the "short" version:
query_addr (alias addr) - host:port
seams doesn't works on my server, actually I can't reproduce with another environment, but on IIS and PHP7 I've got this message:
addServer exception: Wrong address (IPv4 and hostname filters failed): 127.0.0.1:27165
Hi, Thanks for this great job! I would like to use GameQ3 to write a simple page with statistics for my own Squad Server.
I try to use list.php to get some info about the Squad protocol, but seams it doesn't works. My environment is Win2008R2 IIS + PHP 7.1 ( with all required module enabled )
The output of list.php is:
PHP Warning: Declaration of GameQ3\protocols\Ship::_parseDetailsExtension(GameQ3\Buffer &$buf, $appid) should be compatible with GameQ3\protocols\Source::_parseDetailsExtension(&$buf, $appid) in C:\inetpub\wwwroot\gameq3\protocols\ship.php on line 48 PHP Warning: Declaration of GameQ3\protocols\Ut3::_parse_arrays_break(&$buf) should be compatible with GameQ3\protocols\Gamespy3::_parse_arrays_break(GameQ3\Buffer &$buf) in C:\inetpub\wwwroot\gameq3\protocols\ut3.php on line 245
And if I try to use the example query used for CS server i get this error:
addServer exception: Both query and connect ports must be defined for this protocol
I think I have to use more variable then the 'connect_host' used for cs type server, but I can't find the documentation for Squad server.
Thanks