@ -1,7 +1,4 @@
<?php
<?php
use xPaw\SourceQuery\Exception\AuthenticationException;
use xPaw\SourceQuery\Exception\TimeoutException;
/**
/**
* Class written by xPaw
* Class written by xPaw
*
*
@ -9,6 +6,10 @@ use xPaw\SourceQuery\Exception\TimeoutException;
* GitHub: https://github.com/xPaw/PHP-Source-Query-Class
* GitHub: https://github.com/xPaw/PHP-Source-Query-Class
*/
*/
use xPaw\SourceQuery\Exception\AuthenticationException;
use xPaw\SourceQuery\Exception\TimeoutException;
use xPaw\SourceQuery\Exception\InvalidPacketException;
class SourceQuerySourceRcon
class SourceQuerySourceRcon
{
{
/**
/**
@ -78,6 +79,11 @@ use xPaw\SourceQuery\Exception\TimeoutException;
{
{
$this->Buffer->Set( FRead( $this->RconSocket, $Length ) );
$this->Buffer->Set( FRead( $this->RconSocket, $Length ) );
if( $this->Buffer->Remaining( ) < 4 )
{
throw new InvalidPacketException( 'Rcon read: Failed to read any data from socket', InvalidPacketException::BUFFER_EMPTY );
}
$PacketSize = $this->Buffer->GetLong( );
$PacketSize = $this->Buffer->GetLong( );
$Buffer = $this->Buffer->Get( );
$Buffer = $this->Buffer->Get( );
@ -102,6 +108,7 @@ use xPaw\SourceQuery\Exception\TimeoutException;
$this->Read( );
$this->Read( );
$this->Buffer->GetLong( ); // RequestID
$this->Buffer->GetLong( ); // RequestID
$Type = $this->Buffer->GetLong( );
$Type = $this->Buffer->GetLong( );
if( $Type === SourceQuery :: SERVERDATA_AUTH_RESPONSE )
if( $Type === SourceQuery :: SERVERDATA_AUTH_RESPONSE )