@@ -1,20 +1,20 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This file is part of GameQ. |
|
| 4 | - * |
|
| 5 | - * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | - * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | - * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | - * (at your option) any later version. |
|
| 9 | - * |
|
| 10 | - * GameQ is distributed in the hope that it will be useful, |
|
| 11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | - * GNU Lesser General Public License for more details. |
|
| 14 | - * |
|
| 15 | - * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | - */ |
|
| 3 | + * This file is part of GameQ. |
|
| 4 | + * |
|
| 5 | + * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | + * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | + * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | + * (at your option) any later version. |
|
| 9 | + * |
|
| 10 | + * GameQ is distributed in the hope that it will be useful, |
|
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | + * GNU Lesser General Public License for more details. |
|
| 14 | + * |
|
| 15 | + * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | + */ |
|
| 18 | 18 | |
| 19 | 19 | namespace GameQ; |
| 20 | 20 | |
@@ -134,19 +134,19 @@ discard block |
||
| 134 | 134 | $loop_active = true; |
| 135 | 135 | |
| 136 | 136 | // Will hold the responses read from the sockets |
| 137 | - $responses = [ ]; |
|
| 137 | + $responses = []; |
|
| 138 | 138 | |
| 139 | 139 | // To store the sockets |
| 140 | - $sockets_tmp = [ ]; |
|
| 140 | + $sockets_tmp = []; |
|
| 141 | 141 | |
| 142 | 142 | // Loop and pull out all the actual sockets we need to listen on |
| 143 | 143 | foreach ($sockets as $socket_id => $socket_data) { |
| 144 | 144 | // Get the socket |
| 145 | 145 | /* @var $socket \GameQ\Query\Core */ |
| 146 | - $socket = $socket_data[ 'socket' ]; |
|
| 146 | + $socket = $socket_data['socket']; |
|
| 147 | 147 | |
| 148 | 148 | // Append the actual socket we are listening to |
| 149 | - $sockets_tmp[ $socket_id ] = $socket->get(); |
|
| 149 | + $sockets_tmp[$socket_id] = $socket->get(); |
|
| 150 | 150 | |
| 151 | 151 | unset($socket); |
| 152 | 152 | } |
@@ -191,12 +191,12 @@ discard block |
||
| 191 | 191 | // Check to see if the response is empty, if so we are done with this server |
| 192 | 192 | if (strlen($response) == 0) { |
| 193 | 193 | // Remove this server from any future read loops |
| 194 | - unset($sockets_tmp[ (int) $socket ]); |
|
| 194 | + unset($sockets_tmp[(int) $socket]); |
|
| 195 | 195 | continue; |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | // Add the response we got back |
| 199 | - $responses[ (int) $socket ][] = $response; |
|
| 199 | + $responses[(int) $socket][] = $response; |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | // Because stream_select modifies read we need to reset it each time to the original array of sockets |
@@ -1,22 +1,22 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This file is part of GameQ. |
|
| 4 | - * |
|
| 5 | - * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | - * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | - * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | - * (at your option) any later version. |
|
| 9 | - * |
|
| 10 | - * GameQ is distributed in the hope that it will be useful, |
|
| 11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | - * GNU Lesser General Public License for more details. |
|
| 14 | - * |
|
| 15 | - * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | - * |
|
| 18 | - * |
|
| 19 | - */ |
|
| 3 | + * This file is part of GameQ. |
|
| 4 | + * |
|
| 5 | + * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | + * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | + * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | + * (at your option) any later version. |
|
| 9 | + * |
|
| 10 | + * GameQ is distributed in the hope that it will be useful, |
|
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | + * GNU Lesser General Public License for more details. |
|
| 14 | + * |
|
| 15 | + * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | + * |
|
| 18 | + * |
|
| 19 | + */ |
|
| 20 | 20 | |
| 21 | 21 | namespace GameQ; |
| 22 | 22 | |
@@ -1,22 +1,22 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This file is part of GameQ. |
|
| 4 | - * |
|
| 5 | - * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | - * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | - * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | - * (at your option) any later version. |
|
| 9 | - * |
|
| 10 | - * GameQ is distributed in the hope that it will be useful, |
|
| 11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | - * GNU Lesser General Public License for more details. |
|
| 14 | - * |
|
| 15 | - * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | - * |
|
| 18 | - * |
|
| 19 | - */ |
|
| 3 | + * This file is part of GameQ. |
|
| 4 | + * |
|
| 5 | + * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | + * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | + * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | + * (at your option) any later version. |
|
| 9 | + * |
|
| 10 | + * GameQ is distributed in the hope that it will be useful, |
|
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | + * GNU Lesser General Public License for more details. |
|
| 14 | + * |
|
| 15 | + * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | + * |
|
| 18 | + * |
|
| 19 | + */ |
|
| 20 | 20 | |
| 21 | 21 | namespace GameQ; |
| 22 | 22 | |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $server_addr = explode(':', $ip_address); |
| 171 | 171 | |
| 172 | 172 | // Port is the last item in the array, remove it and save |
| 173 | - $this->port_client = (int)array_pop($server_addr); |
|
| 173 | + $this->port_client = (int) array_pop($server_addr); |
|
| 174 | 174 | |
| 175 | 175 | // The rest is the address, recombine |
| 176 | 176 | $this->ip = implode(':', $server_addr); |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | // Now let's validate the IPv6 value sent, remove the square brackets ([]) first |
| 188 | - if (!filter_var(trim($this->ip, '[]'), FILTER_VALIDATE_IP, ['flags' => FILTER_FLAG_IPV6,])) { |
|
| 188 | + if (!filter_var(trim($this->ip, '[]'), FILTER_VALIDATE_IP, ['flags' => FILTER_FLAG_IPV6, ])) { |
|
| 189 | 189 | throw new Exception("The IPv6 address '{$this->ip}' is invalid."); |
| 190 | 190 | } |
| 191 | 191 | } else { |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | list($this->ip, $this->port_client) = explode(':', $ip_address); |
| 195 | 195 | |
| 196 | 196 | // Type case the port |
| 197 | - $this->port_client = (int)$this->port_client; |
|
| 197 | + $this->port_client = (int) $this->port_client; |
|
| 198 | 198 | } else { |
| 199 | 199 | // No port, fail |
| 200 | 200 | throw new Exception( |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | // Validate the IPv4 value, if FALSE is not a valid IP, maybe a hostname. Try to resolve |
| 207 | - if (!filter_var($this->ip, FILTER_VALIDATE_IP, ['flags' => FILTER_FLAG_IPV4,]) |
|
| 207 | + if (!filter_var($this->ip, FILTER_VALIDATE_IP, ['flags' => FILTER_FLAG_IPV4, ]) |
|
| 208 | 208 | && $this->ip === gethostbyname($this->ip) |
| 209 | 209 | ) { |
| 210 | 210 | // When gethostbyname() fails it returns the original string |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | |
| 223 | 223 | // Specific query port defined |
| 224 | 224 | if (array_key_exists(self::SERVER_OPTIONS_QUERY_PORT, $this->options)) { |
| 225 | - $this->port_query = (int)$this->options[self::SERVER_OPTIONS_QUERY_PORT]; |
|
| 225 | + $this->port_query = (int) $this->options[self::SERVER_OPTIONS_QUERY_PORT]; |
|
| 226 | 226 | } else { |
| 227 | 227 | // Do math based on the protocol class |
| 228 | 228 | $this->port_query = $this->protocol->findQueryPort($this->port_client); |
@@ -1,20 +1,20 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This file is part of GameQ. |
|
| 4 | - * |
|
| 5 | - * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | - * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | - * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | - * (at your option) any later version. |
|
| 9 | - * |
|
| 10 | - * GameQ is distributed in the hope that it will be useful, |
|
| 11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | - * GNU Lesser General Public License for more details. |
|
| 14 | - * |
|
| 15 | - * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | - */ |
|
| 3 | + * This file is part of GameQ. |
|
| 4 | + * |
|
| 5 | + * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | + * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | + * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | + * (at your option) any later version. |
|
| 9 | + * |
|
| 10 | + * GameQ is distributed in the hope that it will be useful, |
|
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | + * GNU Lesser General Public License for more details. |
|
| 14 | + * |
|
| 15 | + * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | + */ |
|
| 18 | 18 | |
| 19 | 19 | namespace GameQ; |
| 20 | 20 | |
@@ -1,20 +1,20 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This file is part of GameQ. |
|
| 4 | - * |
|
| 5 | - * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | - * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | - * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | - * (at your option) any later version. |
|
| 9 | - * |
|
| 10 | - * GameQ is distributed in the hope that it will be useful, |
|
| 11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | - * GNU Lesser General Public License for more details. |
|
| 14 | - * |
|
| 15 | - * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | - */ |
|
| 3 | + * This file is part of GameQ. |
|
| 4 | + * |
|
| 5 | + * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | + * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | + * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | + * (at your option) any later version. |
|
| 9 | + * |
|
| 10 | + * GameQ is distributed in the hope that it will be useful, |
|
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | + * GNU Lesser General Public License for more details. |
|
| 14 | + * |
|
| 15 | + * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | + */ |
|
| 18 | 18 | |
| 19 | 19 | namespace GameQ; |
| 20 | 20 | |
@@ -1,20 +1,20 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This file is part of GameQ. |
|
| 4 | - * |
|
| 5 | - * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | - * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | - * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | - * (at your option) any later version. |
|
| 9 | - * |
|
| 10 | - * GameQ is distributed in the hope that it will be useful, |
|
| 11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | - * GNU Lesser General Public License for more details. |
|
| 14 | - * |
|
| 15 | - * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | - */ |
|
| 3 | + * This file is part of GameQ. |
|
| 4 | + * |
|
| 5 | + * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | + * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | + * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | + * (at your option) any later version. |
|
| 9 | + * |
|
| 10 | + * GameQ is distributed in the hope that it will be useful, |
|
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | + * GNU Lesser General Public License for more details. |
|
| 14 | + * |
|
| 15 | + * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | + */ |
|
| 18 | 18 | |
| 19 | 19 | namespace GameQ; |
| 20 | 20 | |
@@ -1,20 +1,20 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This file is part of GameQ. |
|
| 4 | - * |
|
| 5 | - * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | - * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | - * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | - * (at your option) any later version. |
|
| 9 | - * |
|
| 10 | - * GameQ is distributed in the hope that it will be useful, |
|
| 11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | - * GNU Lesser General Public License for more details. |
|
| 14 | - * |
|
| 15 | - * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | - */ |
|
| 3 | + * This file is part of GameQ. |
|
| 4 | + * |
|
| 5 | + * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | + * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | + * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | + * (at your option) any later version. |
|
| 9 | + * |
|
| 10 | + * GameQ is distributed in the hope that it will be useful, |
|
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | + * GNU Lesser General Public License for more details. |
|
| 14 | + * |
|
| 15 | + * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | + */ |
|
| 18 | 18 | |
| 19 | 19 | namespace GameQ; |
| 20 | 20 | |
@@ -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]; |
@@ -1,20 +1,20 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This file is part of GameQ. |
|
| 4 | - * |
|
| 5 | - * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | - * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | - * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | - * (at your option) any later version. |
|
| 9 | - * |
|
| 10 | - * GameQ is distributed in the hope that it will be useful, |
|
| 11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | - * GNU Lesser General Public License for more details. |
|
| 14 | - * |
|
| 15 | - * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | - */ |
|
| 3 | + * This file is part of GameQ. |
|
| 4 | + * |
|
| 5 | + * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | + * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | + * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | + * (at your option) any later version. |
|
| 9 | + * |
|
| 10 | + * GameQ is distributed in the hope that it will be useful, |
|
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | + * GNU Lesser General Public License for more details. |
|
| 14 | + * |
|
| 15 | + * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | + */ |
|
| 18 | 18 | |
| 19 | 19 | namespace GameQ; |
| 20 | 20 | |