Skip to content

Commit dc2a08e

Browse files
committed
Less spacing
1 parent 41741b2 commit dc2a08e

File tree

7 files changed

+39
-39
lines changed

7 files changed

+39
-39
lines changed

Examples/Example.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
define( 'SQ_SERVER_ADDR', 'localhost' );
1212
define( 'SQ_SERVER_PORT', 27015 );
1313
define( 'SQ_TIMEOUT', 1 );
14-
define( 'SQ_ENGINE', SourceQuery :: SOURCE );
14+
define( 'SQ_ENGINE', SourceQuery::SOURCE );
1515
// Edit this <-
1616

1717
$Query = new SourceQuery( );

Examples/RconExample.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
define( 'SQ_SERVER_ADDR', 'localhost' );
1212
define( 'SQ_SERVER_PORT', 27015 );
1313
define( 'SQ_TIMEOUT', 1 );
14-
define( 'SQ_ENGINE', SourceQuery :: SOURCE );
14+
define( 'SQ_ENGINE', SourceQuery::SOURCE );
1515
// Edit this <-
1616

1717
$Query = new SourceQuery( );

Examples/View.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
define( 'SQ_SERVER_ADDR', 'localhost' );
88
define( 'SQ_SERVER_PORT', 27015 );
99
define( 'SQ_TIMEOUT', 3 );
10-
define( 'SQ_ENGINE', SourceQuery :: SOURCE );
10+
define( 'SQ_ENGINE', SourceQuery::SOURCE );
1111
// Edit this <-
1212

1313
$Timer = MicroTime( true );

SourceQuery/GoldSourceRcon.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function Read( $Length = 1400 )
7777
// GoldSource RCON has same structure as Query
7878
$this->Socket->Read( );
7979

80-
if( $this->Buffer->GetByte( ) !== SourceQuery :: S2A_RCON )
80+
if( $this->Buffer->GetByte( ) !== SourceQuery::S2A_RCON )
8181
{
8282
return false;
8383
}
@@ -102,7 +102,7 @@ public function Read( $Length = 1400 )
102102
{
103103
$this->Socket->Read( );
104104

105-
$ReadMore = $this->Buffer->Remaining( ) > 0 && $this->Buffer->GetByte( ) === SourceQuery :: S2A_RCON;
105+
$ReadMore = $this->Buffer->Remaining( ) > 0 && $this->Buffer->GetByte( ) === SourceQuery::S2A_RCON;
106106

107107
if( $ReadMore )
108108
{

SourceQuery/Socket.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@ protected function ReadBuffer( $Buffer, $Length )
115115

116116
switch( $this->Engine )
117117
{
118-
case SourceQuery :: GOLDSOURCE:
118+
case SourceQuery::GOLDSOURCE:
119119
{
120120
$PacketCountAndNumber = $this->Buffer->GetByte( );
121121
$PacketCount = $PacketCountAndNumber & 0xF;
122122
$PacketNumber = $PacketCountAndNumber >> 4;
123123

124124
break;
125125
}
126-
case SourceQuery :: SOURCE:
126+
case SourceQuery::SOURCE:
127127
{
128128
$IsCompressed = ( $RequestID & 0x80000000 ) !== 0;
129129
$PacketCount = $this->Buffer->GetByte( );

SourceQuery/SourceQuery.php

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function __destruct( )
138138
* @throws InvalidArgumentException
139139
* @throws TimeoutException
140140
*/
141-
public function Connect( $Ip, $Port, $Timeout = 3, $Engine = self :: SOURCE )
141+
public function Connect( $Ip, $Port, $Timeout = 3, $Engine = self::SOURCE )
142142
{
143143
$this->Disconnect( );
144144

@@ -204,10 +204,10 @@ public function Ping( )
204204
return false;
205205
}
206206

207-
$this->Socket->Write( self :: A2S_PING );
207+
$this->Socket->Write( self::A2S_PING );
208208
$this->Socket->Read( );
209209

210-
return $this->Buffer->GetByte( ) === self :: S2A_PING;
210+
return $this->Buffer->GetByte( ) === self::S2A_PING;
211211
}
212212

213213
/**
@@ -224,7 +224,7 @@ public function GetInfo( )
224224
return false;
225225
}
226226

227-
$this->Socket->Write( self :: A2S_INFO, "Source Engine Query\0" );
227+
$this->Socket->Write( self::A2S_INFO, "Source Engine Query\0" );
228228
$this->Socket->Read( );
229229

230230
$Type = $this->Buffer->GetByte( );
@@ -235,7 +235,7 @@ public function GetInfo( )
235235
}
236236

237237
// Old GoldSource protocol, HLTV still uses it
238-
if( $Type === self :: S2A_INFO_OLD && $this->Socket->Engine === self :: GOLDSOURCE )
238+
if( $Type === self::S2A_INFO_OLD && $this->Socket->Engine === self::GOLDSOURCE )
239239
{
240240
/**
241241
* If we try to read data again, and we get the result with type S2A_INFO (0x49)
@@ -278,7 +278,7 @@ public function GetInfo( )
278278
return $Server;
279279
}
280280

281-
if( $Type !== self :: S2A_INFO )
281+
if( $Type !== self::S2A_INFO )
282282
{
283283
throw new InvalidPacketException( 'GetInfo: Packet header mismatch. (0x' . DecHex( $Type ) . ')', InvalidPacketException::PACKET_HEADER_MISMATCH );
284284
}
@@ -367,15 +367,15 @@ public function GetPlayers( )
367367
return false;
368368
}
369369

370-
switch( $this->GetChallenge( self :: A2S_PLAYER, self :: S2A_PLAYER ) )
370+
switch( $this->GetChallenge( self::A2S_PLAYER, self::S2A_PLAYER ) )
371371
{
372-
case self :: GETCHALLENGE_FAILED:
372+
case self::GETCHALLENGE_FAILED:
373373
{
374374
return false;
375375
}
376-
case self :: GETCHALLENGE_ALL_CLEAR:
376+
case self::GETCHALLENGE_ALL_CLEAR:
377377
{
378-
$this->Socket->Write( self :: A2S_PLAYER, $this->Challenge );
378+
$this->Socket->Write( self::A2S_PLAYER, $this->Challenge );
379379
$this->Socket->Read( 14000 ); // Moronic Arma 3 developers do not split their packets, so we have to read more data
380380
// This violates the protocol spec, and they probably should fix it: https://developer.valvesoftware.com/wiki/Server_queries#Protocol
381381

@@ -385,7 +385,7 @@ public function GetPlayers( )
385385
{
386386
return false;
387387
}
388-
else if( $Type !== self :: S2A_PLAYER )
388+
else if( $Type !== self::S2A_PLAYER )
389389
{
390390
throw new InvalidPacketException( 'GetPlayers: Packet header mismatch. (0x' . DecHex( $Type ) . ')', InvalidPacketException::PACKET_HEADER_MISMATCH );
391391
}
@@ -425,15 +425,15 @@ public function GetRules( )
425425
return false;
426426
}
427427

428-
switch( $this->GetChallenge( self :: A2S_RULES, self :: S2A_RULES ) )
428+
switch( $this->GetChallenge( self::A2S_RULES, self::S2A_RULES ) )
429429
{
430-
case self :: GETCHALLENGE_FAILED:
430+
case self::GETCHALLENGE_FAILED:
431431
{
432432
return false;
433433
}
434-
case self :: GETCHALLENGE_ALL_CLEAR:
434+
case self::GETCHALLENGE_ALL_CLEAR:
435435
{
436-
$this->Socket->Write( self :: A2S_RULES, $this->Challenge );
436+
$this->Socket->Write( self::A2S_RULES, $this->Challenge );
437437
$this->Socket->Read( );
438438

439439
$Type = $this->Buffer->GetByte( );
@@ -442,7 +442,7 @@ public function GetRules( )
442442
{
443443
return false;
444444
}
445-
else if( $Type !== self :: S2A_RULES )
445+
else if( $Type !== self::S2A_RULES )
446446
{
447447
throw new InvalidPacketException( 'GetRules: Packet header mismatch. (0x' . DecHex( $Type ) . ')', InvalidPacketException::PACKET_HEADER_MISMATCH );
448448
}
@@ -480,12 +480,12 @@ private function GetChallenge( $Header, $ExpectedResult )
480480
{
481481
if( $this->Challenge )
482482
{
483-
return self :: GETCHALLENGE_ALL_CLEAR;
483+
return self::GETCHALLENGE_ALL_CLEAR;
484484
}
485485

486486
if( $this->UseOldGetChallengeMethod )
487487
{
488-
$Header = self :: A2S_SERVERQUERY_GETCHALLENGE;
488+
$Header = self::A2S_SERVERQUERY_GETCHALLENGE;
489489
}
490490

491491
$this->Socket->Write( $Header, 0xFFFFFFFF );
@@ -495,21 +495,21 @@ private function GetChallenge( $Header, $ExpectedResult )
495495

496496
switch( $Type )
497497
{
498-
case self :: S2A_CHALLENGE:
498+
case self::S2A_CHALLENGE:
499499
{
500500
$this->Challenge = $this->Buffer->Get( 4 );
501501

502-
return self :: GETCHALLENGE_ALL_CLEAR;
502+
return self::GETCHALLENGE_ALL_CLEAR;
503503
}
504504
case $ExpectedResult:
505505
{
506506
// Goldsource (HLTV)
507507

508-
return self :: GETCHALLENGE_CONTAINS_ANSWER;
508+
return self::GETCHALLENGE_CONTAINS_ANSWER;
509509
}
510510
case 0:
511511
{
512-
return self :: GETCHALLENGE_FAILED;
512+
return self::GETCHALLENGE_FAILED;
513513
}
514514
default:
515515
{
@@ -534,13 +534,13 @@ public function SetRconPassword( $Password )
534534

535535
switch( $this->Socket->Engine )
536536
{
537-
case SourceQuery :: GOLDSOURCE:
537+
case SourceQuery::GOLDSOURCE:
538538
{
539539
$this->Rcon = new GoldSourceRcon( $this->Buffer, $this->Socket );
540540

541541
break;
542542
}
543-
case SourceQuery :: SOURCE:
543+
case SourceQuery::SOURCE:
544544
{
545545
$this->Rcon = new SourceRcon( $this->Buffer, $this->Socket );
546546

SourceQuery/SourceRcon.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,19 @@ public function Read( )
129129

130130
public function Command( $Command )
131131
{
132-
$this->Write( SourceQuery :: SERVERDATA_EXECCOMMAND, $Command );
132+
$this->Write( SourceQuery::SERVERDATA_EXECCOMMAND, $Command );
133133

134134
$this->Read( );
135135

136136
$this->Buffer->GetLong( ); // RequestID
137137

138138
$Type = $this->Buffer->GetLong( );
139139

140-
if( $Type === SourceQuery :: SERVERDATA_AUTH_RESPONSE )
140+
if( $Type === SourceQuery::SERVERDATA_AUTH_RESPONSE )
141141
{
142142
throw new AuthenticationException( 'Bad rcon_password.', AuthenticationException::BAD_PASSWORD );
143143
}
144-
else if( $Type !== SourceQuery :: SERVERDATA_RESPONSE_VALUE )
144+
else if( $Type !== SourceQuery::SERVERDATA_RESPONSE_VALUE )
145145
{
146146
return false;
147147
}
@@ -154,13 +154,13 @@ public function Command( $Command )
154154
{
155155
do
156156
{
157-
$this->Write( SourceQuery :: SERVERDATA_RESPONSE_VALUE );
157+
$this->Write( SourceQuery::SERVERDATA_RESPONSE_VALUE );
158158

159159
$this->Read( );
160160

161161
$this->Buffer->GetLong( ); // RequestID
162162

163-
if( $this->Buffer->GetLong( ) !== SourceQuery :: SERVERDATA_RESPONSE_VALUE )
163+
if( $this->Buffer->GetLong( ) !== SourceQuery::SERVERDATA_RESPONSE_VALUE )
164164
{
165165
break;
166166
}
@@ -182,7 +182,7 @@ public function Command( $Command )
182182

183183
public function Authorize( $Password )
184184
{
185-
$this->Write( SourceQuery :: SERVERDATA_AUTH, $Password );
185+
$this->Write( SourceQuery::SERVERDATA_AUTH, $Password );
186186
$this->Read( );
187187

188188
$RequestID = $this->Buffer->GetLong( );
@@ -191,15 +191,15 @@ public function Authorize( $Password )
191191
// If we receive SERVERDATA_RESPONSE_VALUE, then we need to read again
192192
// More info: https://developer.valvesoftware.com/wiki/Source_RCON_Protocol#Additional_Comments
193193

194-
if( $Type === SourceQuery :: SERVERDATA_RESPONSE_VALUE )
194+
if( $Type === SourceQuery::SERVERDATA_RESPONSE_VALUE )
195195
{
196196
$this->Read( );
197197

198198
$RequestID = $this->Buffer->GetLong( );
199199
$Type = $this->Buffer->GetLong( );
200200
}
201201

202-
if( $RequestID === -1 || $Type !== SourceQuery :: SERVERDATA_AUTH_RESPONSE )
202+
if( $RequestID === -1 || $Type !== SourceQuery::SERVERDATA_AUTH_RESPONSE )
203203
{
204204
throw new AuthenticationException( 'RCON authorization failed.', AuthenticationException::BAD_PASSWORD );
205205
}

0 commit comments

Comments
 (0)