1 | <?php |
||
35 | class Gtan extends Http |
||
36 | { |
||
37 | /** |
||
38 | * Packets to send |
||
39 | * |
||
40 | * @var array |
||
41 | */ |
||
42 | protected $packets = [ |
||
43 | //self::PACKET_STATUS => "GET /apiservers HTTP/1.0\r\nHost: master.gtanet.work\r\nAccept: */*\r\n\r\n", |
||
44 | self::PACKET_STATUS => "GET /gtan/api.php?ip=%s&raw HTTP/1.0\r\nHost: multiplayerhosting.info\r\nAccept: */*\r\n\r\n", |
||
45 | ]; |
||
46 | |||
47 | /** |
||
48 | * Http protocol is SSL |
||
49 | * |
||
50 | * @var string |
||
51 | */ |
||
52 | protected $transport = self::TRANSPORT_SSL; |
||
53 | |||
54 | /** |
||
55 | * The protocol being used |
||
56 | * |
||
57 | * @var string |
||
58 | */ |
||
59 | protected $protocol = 'gtan'; |
||
60 | |||
61 | /** |
||
62 | * String name of this protocol class |
||
63 | * |
||
64 | * @var string |
||
65 | */ |
||
66 | protected $name = 'gtan'; |
||
67 | |||
68 | /** |
||
69 | * Longer string name of this protocol class |
||
70 | * |
||
71 | * @var string |
||
72 | */ |
||
73 | protected $name_long = "Grand Theft Auto Network"; |
||
74 | |||
75 | /** |
||
76 | * Holds the real ip so we can overwrite it back |
||
77 | * |
||
78 | * @var string |
||
79 | */ |
||
80 | protected $realIp = null; |
||
81 | |||
82 | protected $realPortQuery = null; |
||
83 | |||
84 | /** |
||
85 | * Normalize some items |
||
86 | * |
||
87 | * @var array |
||
88 | */ |
||
89 | protected $normalize = [ |
||
90 | // General |
||
91 | 'general' => [ |
||
92 | // target => source |
||
93 | 'dedicated' => 'dedicated', |
||
94 | 'hostname' => 'hostname', |
||
95 | 'mapname' => 'map', |
||
96 | 'mod' => 'mod', |
||
97 | 'maxplayers' => 'maxplayers', |
||
98 | 'numplayers' => 'numplayers', |
||
99 | 'password' => 'password', |
||
100 | ], |
||
101 | ]; |
||
102 | |||
103 | 2 | public function beforeSend(Server $server) |
|
119 | |||
120 | /** |
||
121 | * Process the response |
||
122 | * |
||
123 | * @return array |
||
124 | * @throws Exception |
||
125 | */ |
||
126 | 2 | public function processResponse() |
|
163 | } |
||
164 |