From c2c0b6bef8cded98c380385a033d425a758af7f9 Mon Sep 17 00:00:00 2001 From: xPaw Date: Wed, 30 Jul 2014 23:00:28 +0300 Subject: [PATCH] Reset buffer/challenge when disconnecting --- SourceQuery/SourceQuery.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SourceQuery/SourceQuery.class.php b/SourceQuery/SourceQuery.class.php index 6ccb319..4e39fc7 100644 --- a/SourceQuery/SourceQuery.class.php +++ b/SourceQuery/SourceQuery.class.php @@ -128,8 +128,6 @@ public function Connect( $Ip, $Port, $Timeout = 3, $Engine = self :: SOURCE ) { $this->Disconnect( ); - $this->Buffer->Reset( ); - $this->Challenge = 0; if( !is_int( $Timeout ) || $Timeout < 0 ) { @@ -166,6 +164,9 @@ public function Disconnect( ) { $this->Connected = false; + $this->Challenge = 0; + + $this->Buffer->Reset( ); $this->Socket->Close( );