1: | <?php |
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: | namespace GameQ\Protocols; |
20: | |
21: | /** |
22: | * Hidden & Dangerous 2 Protocol Class |
23: | * |
24: | * @author Wilson Jesus <> |
25: | */ |
26: | class Had2 extends Gamespy2 |
27: | { |
28: | |
29: | /** |
30: | * String name of this protocol class |
31: | * |
32: | * @type string |
33: | */ |
34: | protected $name = 'had2'; |
35: | |
36: | /** |
37: | * Longer string name of this protocol class |
38: | * |
39: | * @type string |
40: | */ |
41: | protected $name_long = "Hidden & Dangerous 2"; |
42: | |
43: | /** |
44: | * The difference between the client port and query port |
45: | * |
46: | * @type int |
47: | */ |
48: | protected $port_diff = 3; |
49: | |
50: | /** |
51: | * Normalize settings for this protocol |
52: | * |
53: | * @type array |
54: | */ |
55: | protected $normalize = [ |
56: | // General |
57: | 'general' => [ |
58: | // target => source |
59: | 'dedicated' => 'isdedicated', |
60: | 'gametype' => 'gametype', |
61: | 'hostname' => 'hostname', |
62: | 'mapname' => 'mapname', |
63: | 'maxplayers' => 'maxplayers', |
64: | 'numplayers' => 'numplayers', |
65: | 'password' => 'password', |
66: | ], |
67: | // Individual |
68: | 'player' => [ |
69: | 'name' => 'player', |
70: | 'score' => 'score', |
71: | 'deaths' => 'deaths', |
72: | 'ping' => 'ping', |
73: | ], |
74: | ]; |
75: | } |
76: |