File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -206,11 +206,28 @@ public function GetInfo( )
206
206
throw new SocketException ( 'Not connected. ' , SocketException::NOT_CONNECTED );
207
207
}
208
208
209
- $ this ->Socket ->Write ( self ::A2S_INFO , "Source Engine Query \0" );
209
+ if ( $ this ->Challenge )
210
+ {
211
+ $ this ->Socket ->Write ( self ::A2S_INFO , "Source Engine Query \0" . $ this ->Challenge );
212
+ }
213
+ else
214
+ {
215
+ $ this ->Socket ->Write ( self ::A2S_INFO , "Source Engine Query \0" );
216
+ }
217
+
210
218
$ Buffer = $ this ->Socket ->Read ( );
211
219
212
220
$ Type = $ Buffer ->GetByte ( );
213
221
222
+ if ( $ Type === self ::S2A_CHALLENGE )
223
+ {
224
+ $ this ->Challenge = $ Buffer ->Get ( 4 );
225
+
226
+ $ this ->Socket ->Write ( self ::A2S_INFO , "Source Engine Query \0" . $ this ->Challenge );
227
+ $ Buffer = $ this ->Socket ->Read ( );
228
+ $ Type = $ Buffer ->GetByte ( );
229
+ }
230
+
214
231
// Old GoldSource protocol, HLTV still uses it
215
232
if ( $ Type === self ::S2A_INFO_OLD && $ this ->Socket ->Engine === self ::GOLDSOURCE )
216
233
{
You can’t perform that action at this time.
0 commit comments