@@ -70,14 +70,14 @@ class SourceQuery
7070 /**
7171 * Points to rcon class
7272 *
73- * @var SourceRcon
73+ * @var SourceRcon|GoldSourceRcon|null
7474 */
7575 private $ Rcon ;
7676
7777 /**
7878 * Points to socket class
7979 *
80- * @var Socket
80+ * @var BaseSocket
8181 */
8282 private $ Socket ;
8383
@@ -159,7 +159,7 @@ public function SetUseOldGetChallengeMethod( $Value )
159159 public function Disconnect ( )
160160 {
161161 $ this ->Connected = false ;
162- $ this ->Challenge = 0 ;
162+ $ this ->Challenge = '' ;
163163
164164 $ this ->Socket ->Close ( );
165165
@@ -212,6 +212,7 @@ public function GetInfo( )
212212 $ Buffer = $ this ->Socket ->Read ( );
213213
214214 $ Type = $ Buffer ->GetByte ( );
215+ $ Server = [];
215216
216217 // Old GoldSource protocol, HLTV still uses it
217218 if ( $ Type === self ::S2A_INFO_OLD && $ this ->Socket ->Engine === self ::GOLDSOURCE )
@@ -237,6 +238,7 @@ public function GetInfo( )
237238
238239 if ( $ Server [ 'IsMod ' ] )
239240 {
241+ $ Mod = [];
240242 $ Mod [ 'Url ' ] = $ Buffer ->GetString ( );
241243 $ Mod [ 'Download ' ] = $ Buffer ->GetString ( );
242244 $ Buffer ->Get ( 1 ); // NULL byte
@@ -391,6 +393,7 @@ public function GetPlayers( )
391393
392394 while ( $ Count -- > 0 && $ Buffer ->Remaining ( ) > 0 )
393395 {
396+ $ Player = [];
394397 $ Player [ 'Id ' ] = $ Buffer ->GetByte ( ); // PlayerID, is it just always 0?
395398 $ Player [ 'Name ' ] = $ Buffer ->GetString ( );
396399 $ Player [ 'Frags ' ] = $ Buffer ->GetLong ( );
@@ -527,6 +530,10 @@ public function SetRconPassword( $Password )
527530
528531 break ;
529532 }
533+ default :
534+ {
535+ throw new SocketException ( 'Unknown engine. ' , SocketException::INVALID_ENGINE );
536+ }
530537 }
531538
532539 $ this ->Rcon ->Open ( );
0 commit comments