Skip to content
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

Closed
alissonlinneker opened this issue May 25, 2012 · 5 comments
Closed

[ Query for the same type css, cscz, cs16 ] #33

alissonlinneker opened this issue May 25, 2012 · 5 comments

Comments

@alissonlinneker
Copy link

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.

@Austinb
Copy link
Owner

Austinb commented May 25, 2012

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.

@Austinb Austinb closed this as completed May 25, 2012
@Austinb
Copy link
Owner

Austinb commented May 25, 2012

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

@alissonlinneker
Copy link
Author

You're confusing what I'm talking about.
rsrs

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"
$result->add('AppID',$buf->readInt8()); // Steam Application ID. Example for Counter-Strike 1.6: 10

in gameq/source.php does not work.

@Austinb
Copy link
Owner

Austinb commented May 25, 2012

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

@Austinb
Copy link
Owner

Austinb commented May 25, 2012

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants