1 | <?php |
||
32 | class Justcause2 extends Gamespy4 |
||
33 | { |
||
34 | /** |
||
35 | * String name of this protocol class |
||
36 | * |
||
37 | * @type string |
||
38 | */ |
||
39 | protected $name = 'justcause2'; |
||
40 | |||
41 | /** |
||
42 | * Longer string name of this protocol class |
||
43 | * |
||
44 | * @type string |
||
45 | */ |
||
46 | protected $name_long = "Just Cause 2 Multiplayer"; |
||
47 | |||
48 | /** |
||
49 | * The client join link |
||
50 | * |
||
51 | * @type string |
||
52 | */ |
||
53 | protected $join_link = "steam://connect/%s:%d/"; |
||
54 | |||
55 | /** |
||
56 | * Change the packets used |
||
57 | * |
||
58 | * @var array |
||
59 | */ |
||
60 | protected $packets = [ |
||
61 | self::PACKET_CHALLENGE => "\xFE\xFD\x09\x10\x20\x30\x40", |
||
62 | self::PACKET_ALL => "\xFE\xFD\x00\x10\x20\x30\x40%s\xFF\xFF\xFF\x02", |
||
63 | ]; |
||
64 | |||
65 | /** |
||
66 | * Override the packet split |
||
67 | * |
||
68 | * @var string |
||
69 | */ |
||
70 | protected $packetSplit = "/\\x00\\x00\\x00/m"; |
||
71 | |||
72 | /** |
||
73 | * Normalize settings for this protocol |
||
74 | * |
||
75 | * @type array |
||
76 | */ |
||
77 | protected $normalize = [ |
||
78 | 'general' => [ |
||
79 | // target => source |
||
80 | 'dedicated' => 'dedicated', |
||
81 | 'gametype' => 'gametype', |
||
82 | 'hostname' => 'hostname', |
||
83 | 'mapname' => 'mapname', |
||
84 | 'maxplayers' => 'maxplayers', |
||
85 | 'numplayers' => 'numplayers', |
||
86 | 'password' => 'password', |
||
87 | ], |
||
88 | // Individual |
||
89 | 'player' => [ |
||
90 | 'name' => 'name', |
||
91 | 'ping' => 'ping', |
||
92 | ], |
||
93 | ]; |
||
94 | |||
95 | /** |
||
96 | * Overload so we can add in some static data points |
||
97 | * |
||
98 | * @param Buffer $buffer |
||
99 | * @param Result $result |
||
100 | */ |
||
101 | protected function processDetails(Buffer &$buffer, Result &$result) |
||
109 | |||
110 | /** |
||
111 | * Override the parent, this protocol is returned differently |
||
112 | * |
||
113 | * @param Buffer $buffer |
||
114 | * @param Result $result |
||
115 | * |
||
116 | * @see Gamespy3::processPlayersAndTeams() |
||
117 | */ |
||
118 | protected function processPlayersAndTeams(Buffer &$buffer, Result &$result) |
||
127 | } |
||
128 |