|
30 | 30 |
|
31 | 31 | Update::getCurrentVersion(); |
32 | 32 |
|
33 | | - $config = Config::getConfig(); |
| 33 | + $debug = true; |
| 34 | + |
34 | 35 | $parser = ParamParser::getParser(); |
35 | 36 |
|
36 | 37 | if(ISSET($_GET["server"])){ |
| 38 | + /* |
37 | 39 | $name = $_GET["server"]; |
38 | 40 |
|
39 | 41 | if(array_key_exists($name, Config::$servers)){ |
|
42 | 44 | $name = key(Config::$servers); // get the first server in array |
43 | 45 | $srv = Config::$servers[$name]; |
44 | 46 | } |
| 47 | + */ |
45 | 48 |
|
46 | 49 | unset($_GET["server"]); |
47 | 50 | }else{ |
48 | 51 | $name = key(Config::$servers); // get the first server in array |
49 | 52 | $srv = Config::$servers[$name]; |
50 | 53 | } |
51 | | - |
52 | | - // Update the config for the new server |
53 | | - if(array_key_exists("ip", $srv)){ |
54 | | - $config->fivemIP = $srv["ip"]; |
55 | | - } |
56 | | - if(array_key_exists("fivemPort", $srv)){ |
57 | | - $config->fivemPort = $srv["fivemPort"]; |
58 | | - } |
59 | | - if(array_key_exists("socketPort", $srv)){ |
60 | | - $config->socketPort = $srv["socketPort"]; |
61 | | - } |
62 | | - if(array_key_exists("liveMapName", $srv)){ |
63 | | - $config->liveMapName = $srv["liveMapName"]; |
64 | | - } |
65 | | - if(array_key_exists("reverseProxy", $srv)){ |
66 | | - $config->reverseProxy = $srv["reverseProxy"]; |
67 | | - } |
68 | | - |
69 | | - $config->currentServer = $name; |
70 | | - |
71 | 54 | ?> |
72 | 55 |
|
73 | 56 | <html> |
|
104 | 87 | <link type="text/css" rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700"> |
105 | 88 | <?php |
106 | 89 | // Print the CSS stuff for the webapp. This will either print the minfied version or, links to the CSS filees |
107 | | - Minifier::printCss($config->debug); |
| 90 | + Minifier::printCss($debug); |
108 | 91 | ?> |
109 | 92 | <link type="text/css" rel="stylesheet" href="style/fontawesome-all.min.css" /> |
110 | 93 |
|
|
115 | 98 | <script src="js/bootstrap.bundle.min.js"></script> |
116 | 99 | <script src="js/bootstrap.min.js"></script> |
117 | 100 | <script src="js/bootstrap-notify.min.js"></script> |
118 | | - |
| 101 | + |
119 | 102 | <link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.4/dist/leaflet.css" integrity="sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA==" crossorigin=""/> |
120 | 103 | <script src="https://unpkg.com/leaflet@1.3.4/dist/leaflet.js" integrity="sha512-nMMmRyTVoLYqjP9hrbed9S+FzjZHW5gY1TWCHA5ckwXZBadntCNs8kEqAWdrb9O7rxbCaA4lKTIWjDXZxflOcA==" crossorigin=""></script> |
121 | 104 |
|
122 | | - |
123 | | - <script> |
124 | | - |
125 | | - /////////////////////////////////////////////////////////////////////////// |
126 | | - // PLEASE CHNAGE THE VAUES INSIDE THE CONFIG FILE |
127 | | - /////////////////////////////////////////////////////////////////////////// |
128 | | - var _MAP_tileURL = "<?php echo $config->mapTileUrl; ?>"; |
129 | | - var _MAP_iconURL = "<?php echo $config->mapIconUrl; ?>"; |
130 | | - |
131 | | - var _MAP_currentUri = "<?php echo $_SERVER["REQUEST_URI"]; ?>"; |
132 | | - |
133 | | - // Sets whether it should showSets whether it should show Atlas map (WARNING: REQUIRES "atlas" TILE DIRECTORY) |
134 | | - var _MAP_atlasMap = <?php echo json_encode($config->atlasEnabled); ?>; |
135 | | - |
136 | | - // Sets whether it should show Satellite map (WARNING: REQUIRES "satellite" TILE DIRECTORY) |
137 | | - var _MAP_satelliteMap = <?php echo json_encode($config->satelliteEnabled); ?>; |
138 | | - |
139 | | - // Sets whether it should show Road map (WARNING: REQUIRES "road" TILE DIRECTORY) |
140 | | - var _MAP_roadMap = <?php echo json_encode($config->roadEnabled); ?>; |
141 | | - |
142 | | - // Sets whether it should show UV Invert map (WARNING: REQUIRES "uv-invert" TILE DIRECTORY) |
143 | | - var _MAP_UVInvMap = <?php echo json_encode($config->uvInveredEnabled); ?>; |
144 | | - |
145 | | - // Sets whether it should show Postcode map (WARNING: REQUIRES "postcode" TILE DIRECTORY) |
146 | | - var _MAP_PostcodeMap = <?php echo json_encode($config->postcodeEnabled); ?>; |
147 | | - |
148 | | - // Set to the IP of the GTA server running "live_map" and change the port to the |
149 | | - // number that is set |
150 | | - var _SETTINGS_socketUrl = "<?php echo $config->socketUrl(); ?>"; |
151 | | - |
152 | | - // Set to false if you don't want to show the player's identifiers (this may be their IP) |
153 | | - var _SETTINGS_showIdentifiers = <?php echo json_encode($config->showIdentifiers); ?>; |
154 | | - |
155 | | - // show debug information in the console |
156 | | - var _SETTINGS_debug = <?php echo json_encode($config->debug); ?>; |
157 | | - |
158 | | - var _SETTINGS_blipUrl = "<?php echo $config->blipUrl(); ?>"; |
159 | | - </script> |
160 | 105 | <?php |
161 | | - Minifier::printFirstJs($config->debug); |
| 106 | + Minifier::printFirstJs($debug); |
162 | 107 | ?> |
163 | 108 |
|
164 | 109 | </head> |
|
182 | 127 | <a class="nav-link dropdown-toggle" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
183 | 128 | Select a server |
184 | 129 | </a> |
185 | | - <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink"> |
186 | | - <?php |
187 | | - $srvs = Config::$servers; |
188 | | - foreach ($srvs as $key => $value) { |
189 | | - $uri = urlencode($key); |
190 | | - echo "<a class='dropdown-item' href='?server=$uri'>$key</a>"; |
191 | | - } |
192 | | - ?> |
| 130 | + <div id="server_menu" class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink"> |
193 | 131 | </div> |
194 | 132 | </li> |
195 | 133 |
|
|
252 | 190 |
|
253 | 191 | <a class="list-group-item d-inline-block collapsed">Currently viewing: |
254 | 192 | <p id="server_name" style="white-space: normal; color: #17A2B8"> |
255 | | - <?php echo $config->currentServer; ?> |
256 | 193 | </p> |
257 | 194 | </a> |
258 | 195 |
|
|
289 | 226 | </div> |
290 | 227 |
|
291 | 228 | <?php |
292 | | - Minifier::printLastJs($config->debug); |
| 229 | + Minifier::printLastJs($debug); |
293 | 230 | $parser->printJsForParams(); |
294 | 231 | if(!Update::latestVersion()){ |
295 | 232 | echo Update::alertJs(); |
296 | 233 | } |
297 | 234 | ?> |
298 | 235 |
|
299 | 236 | <script> |
300 | | - var _MAP_currentMarker; |
301 | | - var _MAP_markerStore; |
302 | | - var _MAP_map; |
303 | | - |
304 | | - |
305 | 237 | var greenIcon = L.icon({ |
306 | 238 | iconUrl: 'images/icons/debug.png', |
307 | 239 |
|
|
316 | 248 | iconAnchor: [23, 32/2], // point of the icon which will correspond to marker's location |
317 | 249 | popupAnchor: [-3, -76] // point from which the popup should open relative to the iconAnchor |
318 | 250 | }); |
319 | | - |
320 | | - function drawRect(sw, ne){ |
321 | | - return L.rectangle(new L.LatLngBounds( |
322 | | - _MAP_map.unproject(sw, _MAP_map.getMaxZoom()), |
323 | | - _MAP_map.unproject(ne, _MAP_map.getMaxZoom()) |
324 | | - )).addTo(_MAP_map); |
325 | | - } |
326 | | - |
327 | | - function drawRectAroundTile(x, y){ |
328 | | - var scaleMulti = 1024 / 256; |
329 | | - |
330 | | - var currentTileXStart = 512 * x; |
331 | | - var currentTileYStart = 512 * y; |
332 | | - |
333 | | - var currentTileXEnd = currentTileXStart + (512); |
334 | | - var currentTileYEnd = currentTileYStart + (512); |
335 | | - |
336 | | - |
337 | | - return drawRect( |
338 | | - [currentTileXStart * scaleMulti, currentTileYEnd * scaleMulti], |
339 | | - [currentTileXEnd* scaleMulti, currentTileYStart* scaleMulti] |
340 | | - ) |
341 | | - } |
342 | | - |
343 | | - function debugMarker(){ |
344 | | - var ltln = convertToMap(0,0); |
345 | | - L.marker(ltln, {icon: greenIcon, title:"Test"}).addTo(_MAP_map); |
346 | | - _MAP_map.panTo(ltln); |
347 | | - } |
348 | 251 | </script> |
349 | 252 | </body> |
350 | 253 |
|
|
0 commit comments