@@ -23,9 +23,98 @@ You will also need to install [live_map](https://github.com/TGRHavoc/live_map) o
23
23
24
24
## Configuration
25
25
26
+ ### utils/config.php
26
27
Pretty much everything can be configured inside the ` utils/config.php ` file.
27
28
The variables have a brief description so you can get an idea of what values need to be where.
28
29
30
+ ### utils/server.php
31
+ So, this is a new file that you can configure to add more servers to the livemap.
32
+ If you have 3 servers you want to show, this is your config file.
33
+
34
+ The only thing you want to change is the ` $servers ` variable on line 32.
35
+ I'll try and give a detailed description on how you can use this below, hopefully you'll understand :)
36
+
37
+ This array follows a structure and you will need to follow the structure inorder to get multiple servers working.
38
+
39
+ The first thing the array wants, is a ` "name" => array() ` added to it.
40
+ "name" will be the name of the server shown to the user for easy identification.
41
+ The ` array() ` will be another array containing the information of the server.
42
+ If you don't supply any information (e.g. just use ` array() ` ) then, it will default back to the values inside of the ` utils/config.php ` file.
43
+
44
+ The ` array() ` for the server can contain four key-pairs.
45
+ Below is a table showing what the array wants and a brief description of what the value should be.
46
+
47
+
48
+ | Name | Description |
49
+ | ----------- | ------------ |
50
+ | ip | This should be the public IP for the server. Defined in ` utils/config.php ` as ` $fivemIP ` |
51
+ | fivemPort | This should be the FiveM port for the server. Defined in ` utils/config.php ` as ` $fivemPort ` |
52
+ | socketPort | This should be the socket port for the server. Defined in ` utils/config.php ` as ` $socketPort ` |
53
+ | liveMapName | This should be the name of the livemap resource on that server. Defined in ` utils/config.php ` as ` $liveMapName ` |
54
+
55
+ #### Examples
56
+ If you have 3 servers running on the default IP (defined in ` utils/config.php ` )
57
+ ``` php
58
+ private static $servers = array(
59
+ "Server 1" => array(
60
+ "fivemPort" => "30120",
61
+ "socketPort" => "30130",
62
+ ),
63
+ "Server 2" => array(
64
+ "fivemPort" => "30121",
65
+ "socketPort" => "30131",
66
+ ),
67
+ "Server 3" => array(
68
+ "fivemPort" => "30122",
69
+ "socketPort" => "30131",
70
+ )
71
+ );
72
+ ```
73
+
74
+ Or, if you have different servers on different IPs but, use the same ports
75
+ ``` php
76
+ private static $servers = array(
77
+ "Server 1" => array(
78
+ "ip" => "127.0.0.1"
79
+ ),
80
+ "Server 2" => array(
81
+ "ip" => "192.168.0.1"
82
+ ),
83
+ "Server 3" => array(
84
+ "ip" => "192.168.10.1"
85
+ )
86
+ );
87
+ ```
88
+
89
+ Or, a mix of both
90
+ ``` php
91
+ private static $servers = array(
92
+ "Server 1" => array(
93
+ "ip" => "127.0.0.1",
94
+ "fivemPort" => "30121",
95
+ "socketPort" => "4040"
96
+ ),
97
+ "Server 2" => array(
98
+ "ip" => "192.168.0.1"
99
+ ),
100
+ "Server 3" => array(
101
+ "ip" => "192.168.10.1",
102
+ "socketPort" => "20394",
103
+ "liveMapName" => "some_shit_map"
104
+ )
105
+ );
106
+
107
+ ```
108
+
109
+ Below is the code I have running on the [ demo map] ( http://map.tgrhavoc.me )
110
+ ``` php
111
+ private static $servers = array(
112
+ "Havoc's Test server (tgrhavoc.me)" => array(),
113
+ "This is an example of another server (it doesn't exist)" => array()
114
+ );
115
+ ```
116
+
117
+
29
118
## Thanks
30
119
31
120
Special thanks to the people who helped me test this, flushing out any bugs that managed to sneak in.
0 commit comments