|
|
@ -200,7 +200,7 @@
|
|
|
|
throw new SocketException( 'Not connected.', SocketException::NOT_CONNECTED );
|
|
|
|
throw new SocketException( 'Not connected.', SocketException::NOT_CONNECTED );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$this->Socket->WritePadded( self::A2S_INFO, "Source Engine Query\0" );
|
|
|
|
$this->Socket->Write( self::A2S_INFO, "Source Engine Query\0" );
|
|
|
|
$Buffer = $this->Socket->Read( );
|
|
|
|
$Buffer = $this->Socket->Read( );
|
|
|
|
|
|
|
|
|
|
|
|
$Type = $Buffer->GetByte( );
|
|
|
|
$Type = $Buffer->GetByte( );
|
|
|
@ -365,7 +365,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
$this->GetChallenge( self::A2S_PLAYER, self::S2A_PLAYER );
|
|
|
|
$this->GetChallenge( self::A2S_PLAYER, self::S2A_PLAYER );
|
|
|
|
|
|
|
|
|
|
|
|
$this->Socket->WritePadded( self::A2S_PLAYER, $this->Challenge );
|
|
|
|
$this->Socket->Write( self::A2S_PLAYER, $this->Challenge );
|
|
|
|
$Buffer = $this->Socket->Read( 14000 ); // Moronic Arma 3 developers do not split their packets, so we have to read more data
|
|
|
|
$Buffer = $this->Socket->Read( 14000 ); // Moronic Arma 3 developers do not split their packets, so we have to read more data
|
|
|
|
// This violates the protocol spec, and they probably should fix it: https://developer.valvesoftware.com/wiki/Server_queries#Protocol
|
|
|
|
// This violates the protocol spec, and they probably should fix it: https://developer.valvesoftware.com/wiki/Server_queries#Protocol
|
|
|
|
|
|
|
|
|
|
|
@ -411,7 +411,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
$this->GetChallenge( self::A2S_RULES, self::S2A_RULES );
|
|
|
|
$this->GetChallenge( self::A2S_RULES, self::S2A_RULES );
|
|
|
|
|
|
|
|
|
|
|
|
$this->Socket->WritePadded( self::A2S_RULES, $this->Challenge );
|
|
|
|
$this->Socket->Write( self::A2S_RULES, $this->Challenge );
|
|
|
|
$Buffer = $this->Socket->Read( );
|
|
|
|
$Buffer = $this->Socket->Read( );
|
|
|
|
|
|
|
|
|
|
|
|
$Type = $Buffer->GetByte( );
|
|
|
|
$Type = $Buffer->GetByte( );
|
|
|
@ -452,13 +452,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
if( $this->UseOldGetChallengeMethod )
|
|
|
|
if( $this->UseOldGetChallengeMethod )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->Socket->Write( self::A2S_SERVERQUERY_GETCHALLENGE, "\xFF\xFF\xFF\xFF" );
|
|
|
|
$Header = self::A2S_SERVERQUERY_GETCHALLENGE;
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$this->Socket->WritePadded( $Header, "\xFF\xFF\xFF\xFF" );
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->Socket->Write( $Header, "\xFF\xFF\xFF\xFF" );
|
|
|
|
$Buffer = $this->Socket->Read( );
|
|
|
|
$Buffer = $this->Socket->Read( );
|
|
|
|
|
|
|
|
|
|
|
|
$Type = $Buffer->GetByte( );
|
|
|
|
$Type = $Buffer->GetByte( );
|
|
|
|