koraktor / steam-condenser

A multi-language library for querying the Steam Community, Source, GoldSrc servers and Steam master servers
https://koraktor.de/steam-condenser
Other
359 stars 65 forks source link

SRCDS [CS:GO] (php) - Get client ID #290

Closed iNilo closed 8 years ago

iNilo commented 8 years ago

In CSGO (and other source games), status reports the client userid and the client id.

# 3944 2 "Clayton *FI the Grey" STEAM_1:1:13967715 12:23 78 0 active 128000 0.0.0.0:27005

Userid = 3944. Client id = 2.

When debugging the GameServer.php its not included into the array.

Dump of $playerData on this line

Array ( [userid] => 3944 [name] => Clayton *FI the Grey [uniqueid] => STEAM_1:1:13967715 [time] => 08:05 [ping] => 76 [loss] => 0 [state] => active [rate] => 128000 [adr] => 0.0.0.0:27005 )

would it be possible to include the clientid ?

Thanks

koraktor commented 8 years ago

Shouldn’t that match the index of the player in the array?

$players = $server->getPlayers();
$player = $players[1]; // "Client ID" - 1

I know this second part of the user ID is actively stripped out (IIRC here).