Skip to content

Commit e00235c

Browse files
committed
Add S2A extra data comments
1 parent 75d3465 commit e00235c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

SourceQuery/SourceQuery.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,13 +289,13 @@ public function GetInfo( )
289289
{
290290
$Server[ 'ExtraDataFlags' ] = $Flags = $Buffer->GetByte( );
291291

292-
// The server's game port
292+
// S2A_EXTRA_DATA_HAS_GAME_PORT - Next 2 bytes include the game port.
293293
if( $Flags & 0x80 )
294294
{
295295
$Server[ 'GamePort' ] = $Buffer->GetShort( );
296296
}
297297

298-
// The server's steamid
298+
// S2A_EXTRA_DATA_HAS_STEAMID - Next 8 bytes are the steamID
299299
// Want to play around with this?
300300
// You can use https://github.com/xPaw/SteamID.php
301301
if( $Flags & 0x10 )
@@ -327,20 +327,20 @@ public function GetInfo( )
327327
unset( $SteamIDLower, $SteamIDInstance, $SteamID );
328328
}
329329

330-
// The spectator port and then the spectator server name
330+
// S2A_EXTRA_DATA_HAS_SPECTATOR_DATA - Next 2 bytes include the spectator port, then the spectator server name.
331331
if( $Flags & 0x40 )
332332
{
333333
$Server[ 'SpecPort' ] = $Buffer->GetShort( );
334334
$Server[ 'SpecName' ] = $Buffer->GetString( );
335335
}
336336

337-
// The game tag data string for the server
337+
// S2A_EXTRA_DATA_HAS_GAMETAG_DATA - Next bytes are the game tag string
338338
if( $Flags & 0x20 )
339339
{
340340
$Server[ 'GameTags' ] = $Buffer->GetString( );
341341
}
342342

343-
// GameID -- alternative to AppID?
343+
// S2A_EXTRA_DATA_GAMEID - Next 8 bytes are the gameID of the server
344344
if( $Flags & 0x01 )
345345
{
346346
$Server[ 'GameID' ] = $Buffer->GetUnsignedLong( ) | ( $Buffer->GetUnsignedLong( ) << 32 );

0 commit comments

Comments
 (0)