-
-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ Query for the same type css, cscz, cs16 ] #33
Comments
They all work because they are all based off of source. The idea being source is used as the primary class to make all the calls with but in some rare cases even source based games do not have the same behavior. For example cscz behaves differently for rules. But overall this is expected behavior for different games that use the same engine and/or query protocols. The main reason for the different classes (and thus names) is to allow different defaults such as game name, port, etc... This also makes the server add calls uniform when doing different engines in the same request (i.e. quake based and steam based together). $data['gamename'] would be done by using type and using an array of keys with your own values or you can use the long name from the class. This should be $data['gq_type'] but this is defined in the actual protocol class file. According to https://developer.valvesoftware.com/wiki/Server_queries#A2S_PLAYER this is the only information available from the player query. I am sure there are addons for specific games that allow you to get the steamid. |
Just one final note, I believe the only way to get the steamid is to use the RCON protocol which you have to have the rcon password to the server. GameQ does not do any kind of RCON for any server type. https://developer.valvesoftware.com/wiki/Source_RCON_Protocol |
You're confusing what I'm talking about. How to get "Game Description" and "AppID"? Adding: $result->add('Game Description', $buf->readString()); // A friendly string name for the game type, eg: "Counter Strike: Source" in gameq/source.php does not work. |
App ID is steamappid so $data['steamappid']. This is assuming it has an id. game_descr is the game description returned by the info response. There are some extra fields that are missing from the code that can be added in when I have time: https://developer.valvesoftware.com/wiki/Server_Queries#Source_servers_2 |
I would recommend doing one server you want and print_r the results so you can see all the of the keys available in the response. The documentation is lacking in this aspect mainly of the vast differences between different query protocols. |
Examples for Counter-Strike 1.6 (123.123.123.123:27015):
$servers[] = array("id" => "1", "type" => "css", "host" => "123.123.123.123:27015");
$servers[] = array("id" => "2", "type" => "cs16", "host" => "123.123.123.123:27015");
In this way it works:
$servers[] = array("id" => "1", "type" => "css", "host" => "123.123.123.123:27015");
This also works:
$servers[] = array("id" => "2", "type" => "cs16", "host" => "123.123.123.123:27015");
It works with any type.
How do I get the value $ data ['gamename'] and $ data ['steamid']?
These values are in HLSW.
The text was updated successfully, but these errors were encountered: