From ee60bef189970bd4cae19d535c92ec3576f58385 Mon Sep 17 00:00:00 2001 From: Byte Date: Wed, 27 Dec 2017 03:23:43 +1100 Subject: [PATCH] Only write SERVERDATA_RESPONSE_VALUE once for multi packet responses This fixes the bug where all RCON queries on same SourceQuery object would return empty responses --- SourceQuery/SourceRcon.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SourceQuery/SourceRcon.php b/SourceQuery/SourceRcon.php index c132ad9..b1002b9 100644 --- a/SourceQuery/SourceRcon.php +++ b/SourceQuery/SourceRcon.php @@ -146,10 +146,10 @@ // See https://developer.valvesoftware.com/wiki/Source_RCON_Protocol#Multiple-packet_Responses if( StrLen( $Data ) >= 4000 ) { + $this->Write( SourceQuery::SERVERDATA_RESPONSE_VALUE ); + do - { - $this->Write( SourceQuery::SERVERDATA_RESPONSE_VALUE ); - + { $Buffer = $this->Read( ); $Buffer->GetLong( ); // RequestID