|
17 | 17 | // along with this program in the file "LICENSE". If not, see <http://www.gnu.org/licenses/>. |
18 | 18 | // ************************************************************************** // |
19 | 19 |
|
20 | | -/* |
21 | | - This is the config for the webapp. |
22 | | - Please change the values to make it work. |
23 | | -
|
24 | | - DO NOT CHANGE ANY VARIABLE THAT SAYS NOT TO CHANGE. |
25 | | -*/ |
26 | | - |
27 | | -// Set to false to enable the miinified versions of JS and CSS files |
28 | | -// that should speed up content delivery on production websites |
29 | | -$debug = false; |
30 | | - |
31 | | -// Set to the IP of your FiveM server (public address). |
32 | | -$fivemIP = "127.0.0.1"; |
33 | | - |
34 | | -// Set to the port your FiveM server is using (needs to be reachable from the internet) |
35 | | -$fivemPort = "30120"; |
36 | | - |
37 | | -// Set to the port that you set in the "socket_port" convar. |
38 | | -// If you haven't set this in the config, don't change this. |
39 | | -$socketPort = "30121"; |
40 | | - |
41 | | -// Set to the name of the "live_map" resourcee that is added to the FiveM server. |
42 | | -// Note: If you change the folder name on the GTA server you NEED to change this |
43 | | -$liveMapName = "live_map"; |
44 | | - |
45 | | -// These will be injected into the JS code to configure how the map works |
46 | | - |
47 | | -// The directory that contains the folders for the map tiles. Can be relative or, full URL.. |
48 | | -// Make sure it has the trailing slash |
49 | | -$mapTileUrl = "images/map/"; |
50 | | - |
51 | | -// The directory that contains the folders for the map icons. Can be relative or a URL. |
52 | | -// Make sure it has the trailing slash. |
53 | | -$mapIconUrl = "images/icons/"; |
54 | | - |
55 | | -// Controls whether the atlas map is enabled or not |
56 | | -// (WARNING: REQUIRES "atlas" TILE DIRECTORY INSIDE "mapTileUrl") |
57 | | -$atlasEnabled = true; |
58 | | -// Controls whether the satellite map is enabled or not |
59 | | -// (WARNING: REQUIRES "satellite" TILE DIRECTORY INSIDE "mapTileUrl") |
60 | | -$satelliteEnabled = true; |
61 | | -// Controls whether the road map is enabled or not |
62 | | -// (WARNING: REQUIRES "road" TILE DIRECTORY INSIDE "mapTileUrl") |
63 | | -$roadEnabled = true; |
64 | | -// Controls whether the uv-invert map is enabled or not |
65 | | -// (WARNING: REQUIRES "uv-invert" TILE DIRECTORY INSIDE "mapTileUrl" |
66 | | -$uvInveredEnabled = true; |
67 | | - |
68 | | -// Do you want to show the player's identifiers on the map? |
69 | | -// Note: THIS MAY BE THE PLAYER'S IP ADDRESS |
70 | | -$showIdentifiers = true; |
71 | | - |
72 | | -// DO NOT CHANGE |
73 | | -$gtaServer = "http://$fivemIP:$fivemPort/"; |
74 | | -// DO NOT CHANGE |
75 | | -$socketUrl = "ws://$fivemIP:$socketPort/"; |
76 | | - |
77 | | -// Builds the url that we need to use in ajax requests to get the blips |
78 | | -// DO NOT CHANGE |
79 | | -$blipUrl = $gtaServer . $liveMapName . "/blips.json"; |
| 20 | +class Config{ |
| 21 | + |
| 22 | + /* |
| 23 | + This is the config for the webapp. |
| 24 | + Please change the values to make it work. |
| 25 | +
|
| 26 | + DO NOT CHANGE ANY VARIABLE THAT SAYS NOT TO CHANGE. |
| 27 | + */ |
| 28 | + |
| 29 | + // Set to false to enable the miinified versions of JS and CSS files |
| 30 | + // that should speed up content delivery on production websites |
| 31 | + public $debug = false; |
| 32 | + |
| 33 | + // Set to the IP of your FiveM server (public address). |
| 34 | + public $fivemIP = "127.0.0.1"; |
| 35 | + |
| 36 | + // Set to the port your FiveM server is using (needs to be reachable from the internet) |
| 37 | + public $fivemPort = "30120"; |
| 38 | + |
| 39 | + // Set to the port that you set in the "socket_port" convar. |
| 40 | + // If you haven't set this in the config, don't change this. |
| 41 | + public $socketPort = "30121"; |
| 42 | + |
| 43 | + // Set to the name of the "live_map" resourcee that is added to the FiveM server. |
| 44 | + // Note: If you change the folder name on the GTA server you NEED to change this |
| 45 | + public $liveMapName = "live_map"; |
| 46 | + |
| 47 | + // These will be injected into the JS code to configure how the map works |
| 48 | + |
| 49 | + // The directory that contains the folders for the map tiles. Can be relative or, full URL.. |
| 50 | + // Make sure it has the trailing slash |
| 51 | + public $mapTileUrl = "images/map/"; |
| 52 | + |
| 53 | + // The directory that contains the folders for the map icons. Can be relative or a URL. |
| 54 | + // Make sure it has the trailing slash. |
| 55 | + public $mapIconUrl = "images/icons/"; |
| 56 | + |
| 57 | + // Controls whether the atlas map is enabled or not |
| 58 | + // (WARNING: REQUIRES "atlas" TILE DIRECTORY INSIDE "mapTileUrl") |
| 59 | + public $atlasEnabled = true; |
| 60 | + // Controls whether the satellite map is enabled or not |
| 61 | + // (WARNING: REQUIRES "satellite" TILE DIRECTORY INSIDE "mapTileUrl") |
| 62 | + public $satelliteEnabled = true; |
| 63 | + // Controls whether the road map is enabled or not |
| 64 | + // (WARNING: REQUIRES "road" TILE DIRECTORY INSIDE "mapTileUrl") |
| 65 | + public $roadEnabled = true; |
| 66 | + // Controls whether the uv-invert map is enabled or not |
| 67 | + // (WARNING: REQUIRES "uv-invert" TILE DIRECTORY INSIDE "mapTileUrl" |
| 68 | + public $uvInveredEnabled = true; |
| 69 | + |
| 70 | + // Do you want to show the player's identifiers on the map? |
| 71 | + // Note: THIS MAY BE THE PLAYER'S IP ADDRESS |
| 72 | + public $showIdentifiers = true; |
| 73 | + |
| 74 | + public function gtaServer(){ |
| 75 | + return "http://$this->fivemIP:$this->fivemPort/"; |
| 76 | + } |
| 77 | + |
| 78 | + public function socketUrl(){ |
| 79 | + return "ws://$this->fivemIP:$this->socketPort/"; |
| 80 | + } |
| 81 | + |
| 82 | + public function blipUrl(){ |
| 83 | + return $this->gtaServer() . $this->liveMapName . "/blips.json"; |
| 84 | + } |
| 85 | + |
| 86 | + /* |
| 87 | + // DO NOT CHANGE |
| 88 | + public $gtaServer = "http://$this->fivemIP:$this->fivemPort/"; |
| 89 | + // DO NOT CHANGE |
| 90 | + public $socketUrl = "ws://$this->fivemIP:$this->socketPort/"; |
| 91 | +
|
| 92 | + // Builds the url that we need to use in ajax requests to get the blips |
| 93 | + // DO NOT CHANGE |
| 94 | + public $blipUrl = $this->gtaServer . $this->liveMapName . "/blips.json"; |
| 95 | + */ |
| 96 | + |
| 97 | + private static $instance = NULL; |
| 98 | + |
| 99 | + public static function getConfig(){ |
| 100 | + if (is_null(self::$instance)){ |
| 101 | + self::$instance = new self(); |
| 102 | + } |
| 103 | + return self::$instance; |
| 104 | + } |
| 105 | +} |
80 | 106 |
|
81 | 107 |
|
82 | 108 | ?> |
0 commit comments