1 | <?php |
||
35 | class Starmade extends Protocol |
||
36 | { |
||
37 | |||
38 | /** |
||
39 | * Array of packets we want to query. |
||
40 | * |
||
41 | * @type array |
||
42 | */ |
||
43 | protected $packets = [ |
||
44 | self::PACKET_STATUS => "\x00\x00\x00\x09\x2a\xff\xff\x01\x6f\x00\x00\x00\x00", |
||
45 | ]; |
||
46 | |||
47 | /** |
||
48 | * The transport mode for this protocol is TCP |
||
49 | * |
||
50 | * @type string |
||
51 | */ |
||
52 | protected $transport = self::TRANSPORT_TCP; |
||
53 | |||
54 | /** |
||
55 | * The query protocol used to make the call |
||
56 | * |
||
57 | * @type string |
||
58 | */ |
||
59 | protected $protocol = 'starmade'; |
||
60 | |||
61 | /** |
||
62 | * String name of this protocol class |
||
63 | * |
||
64 | * @type string |
||
65 | */ |
||
66 | protected $name = 'starmade'; |
||
67 | |||
68 | /** |
||
69 | * Longer string name of this protocol class |
||
70 | * |
||
71 | * @type string |
||
72 | */ |
||
73 | protected $name_long = "StarMade"; |
||
74 | |||
75 | /** |
||
76 | * The client join link |
||
77 | * |
||
78 | * @type string |
||
79 | */ |
||
80 | protected $join_link = null; |
||
81 | |||
82 | /** |
||
83 | * Normalize settings for this protocol |
||
84 | * |
||
85 | * @type array |
||
86 | */ |
||
87 | protected $normalize = [ |
||
88 | // General |
||
89 | 'general' => [ |
||
90 | // target => source |
||
91 | 'dedicated' => 'dedicated', |
||
92 | 'hostname' => 'hostname', |
||
93 | 'maxplayers' => 'max_players', |
||
94 | 'numplayers' => 'num_players', |
||
95 | 'password' => 'password', |
||
96 | ], |
||
97 | ]; |
||
98 | |||
99 | /** |
||
100 | * Process the response for the StarMade server |
||
101 | * |
||
102 | * @return array |
||
103 | * @throws \GameQ\Exception\Protocol |
||
104 | */ |
||
105 | public function processResponse() |
||
150 | |||
151 | /** |
||
152 | * Parse the server response parameters |
||
153 | * |
||
154 | * @SuppressWarnings(PHPMD.CyclomaticComplexity) |
||
155 | * |
||
156 | * @param \GameQ\Buffer $buffer |
||
157 | * |
||
158 | * @return array |
||
159 | * @throws \GameQ\Exception\Protocol |
||
160 | */ |
||
161 | protected function parseServerParameters(Buffer &$buffer) |
||
226 | } |
||
227 |