@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | * @param \GameQ\Buffer $buffer |
| 149 | 149 | * @param \GameQ\Result $result |
| 150 | 150 | */ |
| 151 | - protected function processKeyValuePairs(Buffer &$buffer, Result &$result) |
|
| 151 | + protected function processKeyValuePairs(Buffer & $buffer, Result & $result) |
|
| 152 | 152 | { |
| 153 | 153 | |
| 154 | 154 | // Key / value pairs |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * @param \GameQ\Buffer $buffer |
| 177 | 177 | * @param \GameQ\Result $result |
| 178 | 178 | */ |
| 179 | - protected function processPlayersAndTeams(Buffer &$buffer, Result &$result) |
|
| 179 | + protected function processPlayersAndTeams(Buffer & $buffer, Result & $result) |
|
| 180 | 180 | { |
| 181 | 181 | |
| 182 | 182 | // Players and team info |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | * @param string $data |
| 201 | 201 | * @param \GameQ\Result $result |
| 202 | 202 | */ |
| 203 | - protected function processDetails($data, Result &$result) |
|
| 203 | + protected function processDetails($data, Result & $result) |
|
| 204 | 204 | { |
| 205 | 205 | |
| 206 | 206 | // Create a buffer |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | * @param string $data |
| 231 | 231 | * @param \GameQ\Result $result |
| 232 | 232 | */ |
| 233 | - protected function processChannels($data, Result &$result) |
|
| 233 | + protected function processChannels($data, Result & $result) |
|
| 234 | 234 | { |
| 235 | 235 | |
| 236 | 236 | // Create a buffer |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | * @param string $data |
| 263 | 263 | * @param \GameQ\Result $result |
| 264 | 264 | */ |
| 265 | - protected function processPlayers($data, Result &$result) |
|
| 265 | + protected function processPlayers($data, Result & $result) |
|
| 266 | 266 | { |
| 267 | 267 | |
| 268 | 268 | // Create a buffer |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | // Multiply so we move the decimal point out of the way, if there is one |
| 93 | - $key = (int)(floatval($matches[2]) * 1000); |
|
| 93 | + $key = (int) (floatval($matches[2]) * 1000); |
|
| 94 | 94 | |
| 95 | 95 | // Add this packet to the processed |
| 96 | 96 | $processed[$key] = $matches[1]; |
@@ -200,12 +200,12 @@ |
||
| 200 | 200 | // Check to see if the response is empty, if so we are done with this server |
| 201 | 201 | if (strlen($response) == 0) { |
| 202 | 202 | // Remove this server from any future read loops |
| 203 | - unset($sockets_tmp[(int)$socket]); |
|
| 203 | + unset($sockets_tmp[(int) $socket]); |
|
| 204 | 204 | continue; |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | // Add the response we got back |
| 208 | - $responses[(int)$socket][] = $response; |
|
| 208 | + $responses[(int) $socket][] = $response; |
|
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | // Because stream_select modifies read we need to reset it each time to the original array of sockets |
@@ -838,7 +838,7 @@ discard block |
||
| 838 | 838 | * @param int $fieldCount |
| 839 | 839 | * @param \GameQ\Result $result |
| 840 | 840 | */ |
| 841 | - protected function processChannel($data, $fieldCount, Result &$result) |
|
| 841 | + protected function processChannel($data, $fieldCount, Result & $result) |
|
| 842 | 842 | { |
| 843 | 843 | |
| 844 | 844 | // Split the items on the comma |
@@ -860,7 +860,7 @@ discard block |
||
| 860 | 860 | * @param int $fieldCount |
| 861 | 861 | * @param \GameQ\Result $result |
| 862 | 862 | */ |
| 863 | - protected function processPlayer($data, $fieldCount, Result &$result) |
|
| 863 | + protected function processPlayer($data, $fieldCount, Result & $result) |
|
| 864 | 864 | { |
| 865 | 865 | |
| 866 | 866 | // Split the items on the comma |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | * @param \GameQ\Buffer $buffer |
| 223 | 223 | * @param \GameQ\Result $result |
| 224 | 224 | */ |
| 225 | - protected function processDetails(Buffer &$buffer, Result &$result) |
|
| 225 | + protected function processDetails(Buffer & $buffer, Result & $result) |
|
| 226 | 226 | { |
| 227 | 227 | |
| 228 | 228 | // We go until we hit an empty key |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | * @param \GameQ\Buffer $buffer |
| 242 | 242 | * @param \GameQ\Result $result |
| 243 | 243 | */ |
| 244 | - protected function processPlayersAndTeams(Buffer &$buffer, Result &$result) |
|
| 244 | + protected function processPlayersAndTeams(Buffer & $buffer, Result & $result) |
|
| 245 | 245 | { |
| 246 | 246 | |
| 247 | 247 | /* |
@@ -164,7 +164,7 @@ |
||
| 164 | 164 | * @param array $data |
| 165 | 165 | * @param \GameQ\Result $result |
| 166 | 166 | */ |
| 167 | - protected function processChannelsAndUsers(array $data, Result &$result) |
|
| 167 | + protected function processChannelsAndUsers(array $data, Result & $result) |
|
| 168 | 168 | { |
| 169 | 169 | |
| 170 | 170 | // Let's add all of the channel information |
@@ -241,13 +241,13 @@ discard block |
||
| 241 | 241 | |
| 242 | 242 | // These are the same no matter what mode the server is in |
| 243 | 243 | $result->add('hostname', $items[1]); |
| 244 | - $result->add('num_players', (int)$items[2]); |
|
| 245 | - $result->add('max_players', (int)$items[3]); |
|
| 244 | + $result->add('num_players', (int) $items[2]); |
|
| 245 | + $result->add('max_players', (int) $items[3]); |
|
| 246 | 246 | $result->add('gametype', $items[4]); |
| 247 | 247 | $result->add('map', $items[5]); |
| 248 | - $result->add('roundsplayed', (int)$items[6]); |
|
| 249 | - $result->add('roundstotal', (int)$items[7]); |
|
| 250 | - $result->add('num_teams', (int)$items[8]); |
|
| 248 | + $result->add('roundsplayed', (int) $items[6]); |
|
| 249 | + $result->add('roundstotal', (int) $items[7]); |
|
| 250 | + $result->add('num_teams', (int) $items[8]); |
|
| 251 | 251 | |
| 252 | 252 | // Set the current index |
| 253 | 253 | $index_current = 9; |
@@ -264,22 +264,22 @@ discard block |
||
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | // Get and set the rest of the data points. |
| 267 | - $result->add('targetscore', (int)$items[$index_current]); |
|
| 267 | + $result->add('targetscore', (int) $items[$index_current]); |
|
| 268 | 268 | $result->add('online', 1); // Forced true, it seems $words[$index_current + 1] is always empty |
| 269 | - $result->add('ranked', (int)$items[$index_current + 2]); |
|
| 270 | - $result->add('punkbuster', (int)$items[$index_current + 3]); |
|
| 271 | - $result->add('password', (int)$items[$index_current + 4]); |
|
| 272 | - $result->add('uptime', (int)$items[$index_current + 5]); |
|
| 273 | - $result->add('roundtime', (int)$items[$index_current + 6]); |
|
| 269 | + $result->add('ranked', (int) $items[$index_current + 2]); |
|
| 270 | + $result->add('punkbuster', (int) $items[$index_current + 3]); |
|
| 271 | + $result->add('password', (int) $items[$index_current + 4]); |
|
| 272 | + $result->add('uptime', (int) $items[$index_current + 5]); |
|
| 273 | + $result->add('roundtime', (int) $items[$index_current + 6]); |
|
| 274 | 274 | // Added in R9 |
| 275 | 275 | $result->add('ip_port', $items[$index_current + 7]); |
| 276 | 276 | $result->add('punkbuster_version', $items[$index_current + 8]); |
| 277 | - $result->add('join_queue', (int)$items[$index_current + 9]); |
|
| 277 | + $result->add('join_queue', (int) $items[$index_current + 9]); |
|
| 278 | 278 | $result->add('region', $items[$index_current + 10]); |
| 279 | 279 | $result->add('pingsite', $items[$index_current + 11]); |
| 280 | 280 | $result->add('country', $items[$index_current + 12]); |
| 281 | 281 | // Added in R29, No docs as of yet |
| 282 | - $result->add('quickmatch', (int)$items[$index_current + 13]); // Guessed from research |
|
| 282 | + $result->add('quickmatch', (int) $items[$index_current + 13]); // Guessed from research |
|
| 283 | 283 | |
| 284 | 284 | unset($items, $index_current, $teamCount, $buffer); |
| 285 | 285 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | * @return array |
| 159 | 159 | * @throws \GameQ\Exception\Protocol |
| 160 | 160 | */ |
| 161 | - protected function parseServerParameters(Buffer &$buffer) |
|
| 161 | + protected function parseServerParameters(Buffer & $buffer) |
|
| 162 | 162 | { |
| 163 | 163 | |
| 164 | 164 | // Init the parsed data array |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | |
| 202 | 202 | // Boolean |
| 203 | 203 | case 5: |
| 204 | - $parsed[$i] = (bool)$buffer->readInt8Signed(); |
|
| 204 | + $parsed[$i] = (bool) $buffer->readInt8Signed(); |
|
| 205 | 205 | break; |
| 206 | 206 | |
| 207 | 207 | // 8-bit int |