@@ -200,7 +200,7 @@ public function GetInfo( ) : array
200200 throw new SocketException ( 'Not connected. ' , SocketException::NOT_CONNECTED );
201201 }
202202
203- $ this ->Socket ->WritePadded ( self ::A2S_INFO , "Source Engine Query \0" );
203+ $ this ->Socket ->Write ( self ::A2S_INFO , "Source Engine Query \0" );
204204 $ Buffer = $ this ->Socket ->Read ( );
205205
206206 $ Type = $ Buffer ->GetByte ( );
@@ -365,7 +365,7 @@ public function GetPlayers( ) : array
365365
366366 $ this ->GetChallenge ( self ::A2S_PLAYER , self ::S2A_PLAYER );
367367
368- $ this ->Socket ->WritePadded ( self ::A2S_PLAYER , $ this ->Challenge );
368+ $ this ->Socket ->Write ( self ::A2S_PLAYER , $ this ->Challenge );
369369 $ Buffer = $ this ->Socket ->Read ( 14000 ); // Moronic Arma 3 developers do not split their packets, so we have to read more data
370370 // This violates the protocol spec, and they probably should fix it: https://developer.valvesoftware.com/wiki/Server_queries#Protocol
371371
@@ -411,7 +411,7 @@ public function GetRules( ) : array
411411
412412 $ this ->GetChallenge ( self ::A2S_RULES , self ::S2A_RULES );
413413
414- $ this ->Socket ->WritePadded ( self ::A2S_RULES , $ this ->Challenge );
414+ $ this ->Socket ->Write ( self ::A2S_RULES , $ this ->Challenge );
415415 $ Buffer = $ this ->Socket ->Read ( );
416416
417417 $ Type = $ Buffer ->GetByte ( );
@@ -452,13 +452,10 @@ private function GetChallenge( int $Header, int $ExpectedResult ) : void
452452
453453 if ( $ this ->UseOldGetChallengeMethod )
454454 {
455- $ this ->Socket ->Write ( self ::A2S_SERVERQUERY_GETCHALLENGE , "\xFF\xFF\xFF\xFF" );
456- }
457- else
458- {
459- $ this ->Socket ->WritePadded ( $ Header , "\xFF\xFF\xFF\xFF" );
455+ $ Header = self ::A2S_SERVERQUERY_GETCHALLENGE ;
460456 }
461457
458+ $ this ->Socket ->Write ( $ Header , "\xFF\xFF\xFF\xFF" );
462459 $ Buffer = $ this ->Socket ->Read ( );
463460
464461 $ Type = $ Buffer ->GetByte ( );
0 commit comments