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: | * Class Battlefield 1942 |
23: | * |
24: | * @package GameQ\Protocols |
25: | * @author Austin Bischoff <austin@codebeard.com> |
26: | */ |
27: | class Bf1942 extends Gamespy |
28: | { |
29: | /** |
30: | * String name of this protocol class |
31: | * |
32: | * @var string |
33: | */ |
34: | protected $name = 'bf1942'; |
35: | |
36: | /** |
37: | * Longer string name of this protocol class |
38: | * |
39: | * @var string |
40: | */ |
41: | protected $name_long = "Battlefield 1942"; |
42: | |
43: | /** |
44: | * query_port = client_port + 8433 |
45: | * 23000 = 14567 + 8433 |
46: | * |
47: | * @var int |
48: | */ |
49: | protected $port_diff = 8433; |
50: | |
51: | /** |
52: | * The client join link |
53: | * |
54: | * @var string |
55: | */ |
56: | protected $join_link = "bf1942://%s:%d"; |
57: | |
58: | /** |
59: | * Normalize settings for this protocol |
60: | * |
61: | * @var array |
62: | */ |
63: | protected $normalize = [ |
64: | // General |
65: | 'general' => [ |
66: | // target => source |
67: | 'dedicated' => 'dedicated', |
68: | 'gametype' => 'gametype', |
69: | 'hostname' => 'hostname', |
70: | 'mapname' => 'mapname', |
71: | 'maxplayers' => 'maxplayers', |
72: | 'numplayers' => 'numplayers', |
73: | 'password' => 'password', |
74: | ], |
75: | // Individual |
76: | 'player' => [ |
77: | 'name' => 'playername', |
78: | 'kills' => 'kills', |
79: | 'deaths' => 'deaths', |
80: | 'ping' => 'ping', |
81: | 'score' => 'score', |
82: | ], |
83: | 'team' => [ |
84: | 'name' => 'teamname', |
85: | ], |
86: | ]; |
87: | } |
88: |