From 673e572233c3ab4b70b302d648ebaf5a8d9ba32b Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Fri, 4 Dec 2020 10:20:42 +0200 Subject: [PATCH] Use challenge straight away if available --- SourceQuery/SourceQuery.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/SourceQuery/SourceQuery.php b/SourceQuery/SourceQuery.php index 7100366..a29d7f3 100644 --- a/SourceQuery/SourceQuery.php +++ b/SourceQuery/SourceQuery.php @@ -200,7 +200,15 @@ throw new SocketException( 'Not connected.', SocketException::NOT_CONNECTED ); } - $this->Socket->Write( self::A2S_INFO, "Source Engine Query\0" ); + if( $this->Challenge ) + { + $this->Socket->Write( self::A2S_INFO, "Source Engine Query\0" . $this->Challenge ); + } + else + { + $this->Socket->Write( self::A2S_INFO, "Source Engine Query\0" ); + } + $Buffer = $this->Socket->Read( ); $Type = $Buffer->GetByte( ); $Server = [];