diff options
author | onefang | 2019-05-28 06:19:38 +1000 |
---|---|---|
committer | onefang | 2019-05-28 06:19:38 +1000 |
commit | f921cb712e67893b44496192e5297335ed65caf7 (patch) | |
tree | b3b2782530414e23400f10ecc5b718682d2745b1 | |
parent | Management scripts encounters the real world, needs patching up. (diff) | |
download | opensim-SC-f921cb712e67893b44496192e5297335ed65caf7.zip opensim-SC-f921cb712e67893b44496192e5297335ed65caf7.tar.gz opensim-SC-f921cb712e67893b44496192e5297335ed65caf7.tar.bz2 opensim-SC-f921cb712e67893b44496192e5297335ed65caf7.tar.xz |
Add [Region] .ini block.
For including actual region definition in the normal .ini stack.
Same as the usual Region.ini format, except we add a RegionName
parameter.
-rw-r--r-- | INSTALL.md | 4 | ||||
-rw-r--r-- | OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs | 20 | ||||
-rw-r--r-- | OpenSim/Framework/RegionInfo.cs | 22 | ||||
-rw-r--r-- | bin/OpenSimDefaults.ini | 2 | ||||
-rw-r--r-- | bin/Regions/Regions.ini.example | 101 | ||||
-rw-r--r-- | example/config/sim_skeleton/My_sim.xml | 20 | ||||
-rw-r--r-- | example/config/sim_skeleton/ThisSim.ini | 23 | ||||
-rwxr-xr-x | scripts/common.sh | 4 | ||||
-rwxr-xr-x | scripts/install/create_sim.sh | 15 | ||||
-rwxr-xr-x | scripts/start-sim | 2 |
10 files changed, 167 insertions, 46 deletions
@@ -47,8 +47,8 @@ want your new random sim to be part of Infinite Grid (IG) or Misfitz Grid | |||
47 | (MG) then you'll have to change that syml/ink to point to config_IG.ini or | 47 | (MG) then you'll have to change that syml/ink to point to config_IG.ini or |
48 | config_MG.ini respectively. | 48 | config_MG.ini respectively. |
49 | 49 | ||
50 | /opt/opensim_SC/config/sim01 now contains the aactual configuration of | 50 | /opt/opensim_SC/config/sim01 now contains the actual configuration of |
51 | your randomly created sim. Edit the .xml file to make that sim a little | 51 | your randomly created sim. Edit the .ini file to make that sim a little |
52 | less random. | 52 | less random. |
53 | 53 | ||
54 | Finally run - | 54 | Finally run - |
diff --git a/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs b/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs index 0187418..4160483 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs | |||
@@ -68,9 +68,8 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
68 | } | 68 | } |
69 | 69 | ||
70 | string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); | 70 | string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); |
71 | //// Causes problems with the actual .ini files if they are in the same place. | 71 | |
72 | //// Coz it tries to load each .ini section as a sim, and hangs. | 72 | string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); |
73 | //// string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); | ||
74 | 73 | ||
75 | // Create an empty Regions.xml if there are no existing config files. | 74 | // Create an empty Regions.xml if there are no existing config files. |
76 | if (!allowRegionless && configFiles.Length == 0 /*&& iniFiles.Length == 0*/) | 75 | if (!allowRegionless && configFiles.Length == 0 /*&& iniFiles.Length == 0*/) |
@@ -84,7 +83,18 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
84 | List<RegionInfo> regionInfos = new List<RegionInfo>(); | 83 | List<RegionInfo> regionInfos = new List<RegionInfo>(); |
85 | 84 | ||
86 | int i = 0; | 85 | int i = 0; |
87 | /* | 86 | |
87 | IConfig regionConfig = (IConfig)m_configSource.Configs["Region"]; | ||
88 | string name = regionConfig.GetString("RegionName", string.Empty).Trim(); | ||
89 | if (string.Empty != name) | ||
90 | { | ||
91 | RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), string.Empty, false, m_configSource, name); | ||
92 | regionInfos.Add(regionInfo); | ||
93 | |||
94 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName); | ||
95 | i++; | ||
96 | } | ||
97 | |||
88 | foreach (string file in iniFiles) | 98 | foreach (string file in iniFiles) |
89 | { | 99 | { |
90 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); | 100 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); |
@@ -101,7 +111,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
101 | i++; | 111 | i++; |
102 | } | 112 | } |
103 | } | 113 | } |
104 | */ | 114 | |
105 | foreach (string file in configFiles) | 115 | foreach (string file in configFiles) |
106 | { | 116 | { |
107 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); | 117 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); |
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 75ed999..8dac0ac 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs | |||
@@ -197,6 +197,12 @@ namespace OpenSim.Framework | |||
197 | { | 197 | { |
198 | // m_configSource = configSource; | 198 | // m_configSource = configSource; |
199 | 199 | ||
200 | if (string.Empty == filename) | ||
201 | { | ||
202 | ReadNiniConfig(configSource, "Region", configName); | ||
203 | return; | ||
204 | } | ||
205 | |||
200 | if (filename.ToLower().EndsWith(".ini")) | 206 | if (filename.ToLower().EndsWith(".ini")) |
201 | { | 207 | { |
202 | if (!File.Exists(filename)) // New region config request | 208 | if (!File.Exists(filename)) // New region config request |
@@ -420,7 +426,7 @@ namespace OpenSim.Framework | |||
420 | set { m_remotingPort = value; } | 426 | set { m_remotingPort = value; } |
421 | } | 427 | } |
422 | 428 | ||
423 | 429 | ||
424 | /// <value> | 430 | /// <value> |
425 | /// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw. | 431 | /// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw. |
426 | /// | 432 | /// |
@@ -509,6 +515,10 @@ namespace OpenSim.Framework | |||
509 | 515 | ||
510 | private void ReadNiniConfig(IConfigSource source, string name) | 516 | private void ReadNiniConfig(IConfigSource source, string name) |
511 | { | 517 | { |
518 | ReadNiniConfig(source, name, name); | ||
519 | } | ||
520 | private void ReadNiniConfig(IConfigSource source, string section, string name) | ||
521 | { | ||
512 | bool creatingNew = false; | 522 | bool creatingNew = false; |
513 | 523 | ||
514 | if (source.Configs.Count == 0) | 524 | if (source.Configs.Count == 0) |
@@ -544,8 +554,7 @@ namespace OpenSim.Framework | |||
544 | source.AddConfig(name); | 554 | source.AddConfig(name); |
545 | } | 555 | } |
546 | 556 | ||
547 | RegionName = name; | 557 | IConfig config = source.Configs[section]; |
548 | IConfig config = source.Configs[name]; | ||
549 | 558 | ||
550 | // Track all of the keys in this config and remove as they are processed | 559 | // Track all of the keys in this config and remove as they are processed |
551 | // The remaining keys will be added to generic key-value storage for | 560 | // The remaining keys will be added to generic key-value storage for |
@@ -556,6 +565,11 @@ namespace OpenSim.Framework | |||
556 | allKeys.Add(s); | 565 | allKeys.Add(s); |
557 | } | 566 | } |
558 | 567 | ||
568 | // RegionName | ||
569 | // | ||
570 | allKeys.Remove("RegionName"); | ||
571 | RegionName = config.GetString("RegionName", name); | ||
572 | |||
559 | // RegionUUID | 573 | // RegionUUID |
560 | // | 574 | // |
561 | allKeys.Remove("RegionUUID"); | 575 | allKeys.Remove("RegionUUID"); |
@@ -670,7 +684,7 @@ namespace OpenSim.Framework | |||
670 | m_externalHostName = Util.GetLocalHost().ToString(); | 684 | m_externalHostName = Util.GetLocalHost().ToString(); |
671 | m_log.InfoFormat( | 685 | m_log.InfoFormat( |
672 | "[REGIONINFO]: Resolving SYSTEMIP to {0} for external hostname of region {1}", | 686 | "[REGIONINFO]: Resolving SYSTEMIP to {0} for external hostname of region {1}", |
673 | m_externalHostName, name); | 687 | m_externalHostName, RegionName); |
674 | } | 688 | } |
675 | else if (!m_resolveAddress) | 689 | else if (!m_resolveAddress) |
676 | { | 690 | { |
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 228b59d..a2de4ba 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini | |||
@@ -109,7 +109,7 @@ | |||
109 | 109 | ||
110 | ; Determines where the region XML files are stored if you are loading these from the filesystem. | 110 | ; Determines where the region XML files are stored if you are loading these from the filesystem. |
111 | ; Defaults to bin/Regions in your OpenSimulator installation directory | 111 | ; Defaults to bin/Regions in your OpenSimulator installation directory |
112 | regionload_regionsdir="${Paths|ConfigPath}Regions" | 112 | regionload_regionsdir="Regions" |
113 | 113 | ||
114 | ; Determines the page from which regions xml is retrieved if you are loading these from the web | 114 | ; Determines the page from which regions xml is retrieved if you are loading these from the web |
115 | ; The XML here has the same format as it does on the filesystem (including the <Root> tag), | 115 | ; The XML here has the same format as it does on the filesystem (including the <Root> tag), |
diff --git a/bin/Regions/Regions.ini.example b/bin/Regions/Regions.ini.example new file mode 100644 index 0000000..97d1c4f --- /dev/null +++ b/bin/Regions/Regions.ini.example | |||
@@ -0,0 +1,101 @@ | |||
1 | ; * This is an example region config file. | ||
2 | ; * | ||
3 | ; * If OpenSimulator is started up without any regions, it will ask you configuration questions to generate a Regions.ini file for you. | ||
4 | ; * So there is no need to change this file directly, it is only for reference. | ||
5 | ; * However, if you prefer you can also copy this file to Regions.ini and appropriately change the parameters below. | ||
6 | ; * Only files ending with .ini and .xml in this directly will be loaded by OpenSimulator. | ||
7 | ; * | ||
8 | ; * You can multiple regions into one file or make one file per region | ||
9 | ; * The section name is the region name | ||
10 | ; * | ||
11 | |||
12 | [Default Region] | ||
13 | |||
14 | ; * | ||
15 | ; * You MUST change this! It will NOT be done for you! | ||
16 | ; * | ||
17 | |||
18 | RegionUUID = 11111111-2222-3333-4444-555555555555 | ||
19 | |||
20 | Location = 1000,1000 | ||
21 | InternalAddress = 0.0.0.0 | ||
22 | InternalPort = 9000 | ||
23 | AllowAlternatePorts = False | ||
24 | ExternalHostName = SYSTEMIP | ||
25 | |||
26 | ; * | ||
27 | ; * Variable-sized regions allows the creation of large, borderless spaces. | ||
28 | ; * The default is 256 meters. For larger spaces, set these to multiples of 256. | ||
29 | ; * For the time being, X and Y need to be the same. | ||
30 | ; * | ||
31 | ; SizeX = 512 | ||
32 | ; SizeY = 512 | ||
33 | |||
34 | ; * Default region landing point used when no teleport coords are specified | ||
35 | ; DefaultLanding = <128,128,30> | ||
36 | |||
37 | ; * | ||
38 | ; * Prim data | ||
39 | ; * This allows limiting the sizes of prims and the region prim count | ||
40 | ; * | ||
41 | |||
42 | ; NonPhysicalPrimMax = 256 | ||
43 | ; PhysicalPrimMax = 64 | ||
44 | ; ClampPrimSize = False | ||
45 | ; MaxPrims = 15000 | ||
46 | ; MaxAgents = 100 | ||
47 | |||
48 | ; * Max prims per user (per parcel). | ||
49 | ; * Negative values will disable the check. | ||
50 | ; MaxPrimsPerUser = -1 | ||
51 | |||
52 | ; * | ||
53 | ; * Multi-Tenancy. Only set if needed | ||
54 | ; * | ||
55 | |||
56 | ; ScopeID = "00000000-0000-0000-0000-000000000000" | ||
57 | |||
58 | ; * | ||
59 | ; * Product name (used in search from viewer 1.23 | ||
60 | ; * | ||
61 | |||
62 | ; RegionType = "Mainland" | ||
63 | |||
64 | ; * Region Specific Static Maptiles: | ||
65 | ; * Important: To use any kind of texture *assets* as a static maptile, the following | ||
66 | ; * things must be set in the [Map] section of OpenSim.ini : | ||
67 | ; * | ||
68 | ; * MapImageModule = "MapImageModule" | ||
69 | ; * GenerateMaptiles = false | ||
70 | ; * | ||
71 | ; * Now, there is a setting in [Map] in OpenSim.ini called | ||
72 | ; * | ||
73 | ; * MaptileStaticUUID = 00000000-0000-0000-0000-000000000000 | ||
74 | ; * | ||
75 | ; * where, given the criteria above, lets you specify the UUID of a texture asset to use | ||
76 | ; * as a maptile *Simulator Wide*. Here, you can override that on a per region basis for | ||
77 | ; * Simulators that run multiple regions: | ||
78 | |||
79 | ; MaptileStaticUUID = 00000000-0000-0000-0000-000000000000 | ||
80 | |||
81 | |||
82 | ; * Region Specific Static Maptiles from file: | ||
83 | ; * It is also possible to create maptiles using external image files of the right size | ||
84 | ; * and supported formats (bmp,png,jpg in RGB 24bpp format) | ||
85 | ; * | ||
86 | ; * Important: To use any kind of texture *files* as a static maptile, the following | ||
87 | ; * things must be set in the [Map] section of OpenSim.ini : | ||
88 | ; * | ||
89 | ; * MapImageModule = "MapImageModule" | ||
90 | ; * GenerateMaptiles = true | ||
91 | ; * | ||
92 | ; * The image must be the same size in pixels as the region or varregion is in meters. | ||
93 | ; * i.e. 256x256 pixels for single region of 256x256m, or 1280x1280 pixels for a varregion | ||
94 | ; * of size 1280x1280m. The image can be loaded from anywhere by setting the path | ||
95 | ; * ie: MaptileStaticFile = "maptiles/SomeFile.png" | ||
96 | ; * | ||
97 | ; * If this setting is used, then the base map is generated from this file instead of being | ||
98 | ; * built using MapImageModule's terrain and prim renderer. Parcel 'for sale' overlays are | ||
99 | ; * still drawn on top of the static map by the World Map module. | ||
100 | |||
101 | ; MaptileStaticFile = "SomeFile.png" | ||
diff --git a/example/config/sim_skeleton/My_sim.xml b/example/config/sim_skeleton/My_sim.xml deleted file mode 100644 index f71df57..0000000 --- a/example/config/sim_skeleton/My_sim.xml +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | <Nini> | ||
2 | <Section Name="SIM_NAME"> | ||
3 | <Key Name="RegionUUID" Value="SIM_UUID" /> | ||
4 | <Key Name="Location" Value="SIM_POS" /> | ||
5 | <Key Name="InternalAddress" Value="SIM_IP" /> | ||
6 | <Key Name="InternalPort" Value="SIM_INT_PORT" /> | ||
7 | <Key Name="AllowAlternatePorts" Value="False" /> | ||
8 | <Key Name="ExternalHostName" Value="SIM_URL" /> | ||
9 | <Key Name="RegionType" Value="private sim" /> | ||
10 | <Key Name="SizeX" Value="SIM_SIZE" /> | ||
11 | <Key Name="SizeY" Value="SIM_SIZE" /> | ||
12 | <Key Name="SizeZ" Value="16384" /> | ||
13 | <Key Name="MaxAgents" Value="100" /> | ||
14 | <Key Name="MaxPrims" Value="45000" /> | ||
15 | <Key Name="PhysicalPrimMax" Value="640" /> | ||
16 | <Key Name="NonphysicalPrimMax" Value="2560" /> | ||
17 | <Key Name="ClampPrimSize" Value="False" /> | ||
18 | <Key Name="MaptileStaticUUID" Value="00000000-0000-0000-0000-000000000000" /> | ||
19 | </Section> | ||
20 | </Nini> | ||
diff --git a/example/config/sim_skeleton/ThisSim.ini b/example/config/sim_skeleton/ThisSim.ini index 140cf3b..a1a209a 100644 --- a/example/config/sim_skeleton/ThisSim.ini +++ b/example/config/sim_skeleton/ThisSim.ini | |||
@@ -5,7 +5,25 @@ | |||
5 | PIDFile = "${Paths|CachePath}/sim${Const|mysim}.pid" | 5 | PIDFile = "${Paths|CachePath}/sim${Const|mysim}.pid" |
6 | LogFile = "${Paths|LogPath}/OpenSim_sim${Const|mysim}.log" | 6 | LogFile = "${Paths|LogPath}/OpenSim_sim${Const|mysim}.log" |
7 | ConsoleHistoryFile = "${Paths|LogPath}/OpenSimConsoleHistory_sim${Const|mysim}.txt" | 7 | ConsoleHistoryFile = "${Paths|LogPath}/OpenSimConsoleHistory_sim${Const|mysim}.txt" |
8 | regionload_regionsdir="../../config/sim${Const|mysim}" | 8 | |
9 | [Region] | ||
10 | RegionName = "SIM_NAME" | ||
11 | RegionUUID = "SIM_UUID" | ||
12 | Location = "SIM_POS" | ||
13 | InternalAddress = "SIM_IP" | ||
14 | InternalPort = "SIM_INT_PORT" | ||
15 | AllowAlternatePorts = False | ||
16 | ExternalHostName = "SIM_URL" | ||
17 | RegionType = "private sim" | ||
18 | SizeX = SIM_SIZE | ||
19 | SizeY = SIM_SIZE | ||
20 | SizeZ = 16384 | ||
21 | MaxAgents = 100 | ||
22 | MaxPrims = 45000 | ||
23 | PhysicalPrimMax = 640 | ||
24 | NonphysicalPrimMax = 2560 | ||
25 | ClampPrimSize = False | ||
26 | MaptileStaticUUID = "00000000-0000-0000-0000-000000000000" | ||
9 | 27 | ||
10 | [Map] | 28 | [Map] |
11 | enablePosition = true | 29 | enablePosition = true |
@@ -21,5 +39,4 @@ | |||
21 | Include-Performance = "config-include/SimBalanced.ini" | 39 | Include-Performance = "config-include/SimBalanced.ini" |
22 | ; Include-Performance = "config-include/SimDefault.ini" | 40 | ; Include-Performance = "config-include/SimDefault.ini" |
23 | ; Include-Performance = "config-include/SimLean.ini" | 41 | ; Include-Performance = "config-include/SimLean.ini" |
24 | │ 2621 mysql 20 0 4131620 483696 17640 S 0.3 2.9 8:07.82 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/x86_64-linux-gnu/mariadb18/plugin --user=m+ | 42 | |
25 | \ No newline at end of file | ||
diff --git a/scripts/common.sh b/scripts/common.sh index c5a86ab..9d985f2 100755 --- a/scripts/common.sh +++ b/scripts/common.sh | |||
@@ -42,11 +42,11 @@ sanitize() | |||
42 | } | 42 | } |
43 | 43 | ||
44 | 44 | ||
45 | # Grab the first Section line of the sims .xml file, cut it down to the name. | 45 | # Grab the first Section line of the sims .ini file, cut it down to the name. |
46 | # name=$(getSimName 1) | 46 | # name=$(getSimName 1) |
47 | getSimName() | 47 | getSimName() |
48 | { | 48 | { |
49 | grep "<Section " ${PRGDIR}/../../config/$(num2name $1)/*.xml | head -n 1 | cut -d '"' -f 2 | 49 | grep "RegionName" ${PRGDIR}/../../config/$(num2name $1)/*.ini | head -n 1 | cut -d '"' -f 2 |
50 | } | 50 | } |
51 | 51 | ||
52 | 52 | ||
diff --git a/scripts/install/create_sim.sh b/scripts/install/create_sim.sh index 08cedba..475c127 100755 --- a/scripts/install/create_sim.sh +++ b/scripts/install/create_sim.sh | |||
@@ -71,14 +71,13 @@ echo "Creating sim${NUM} on port ${PORT} @ ${LOCATION} - ${NAME}." | |||
71 | cp -r sim_skeleton sim${NUM} | 71 | cp -r sim_skeleton sim${NUM} |
72 | 72 | ||
73 | cd sim${NUM} | 73 | cd sim${NUM} |
74 | mv My_sim.xml ${sim}.xml | 74 | sed -i "s@SIM_NAME@${NAME}@g" ThisSim.ini |
75 | sed -i "s@SIM_NAME@${NAME}@g" ${sim}.xml | 75 | sed -i "s@SIM_UUID@${UUID}@g" ThisSim.ini |
76 | sed -i "s@SIM_UUID@${UUID}@g" ${sim}.xml | 76 | sed -i "s@SIM_POS@${LOCATION}@g" ThisSim.ini |
77 | sed -i "s@SIM_POS@${LOCATION}@g" ${sim}.xml | 77 | sed -i "s@SIM_IP@${IP}@g" ThisSim.ini |
78 | sed -i "s@SIM_IP@${IP}@g" ${sim}.xml | 78 | sed -i "s@SIM_INT_PORT@$(( ${PORT} + 1 ))@g" ThisSim.ini |
79 | sed -i "s@SIM_INT_PORT@$(( ${PORT} + 1 ))@g" ${sim}.xml | 79 | sed -i "s@SIM_URL@${URL}@g" ThisSim.ini |
80 | sed -i "s@SIM_URL@${URL}@g" ${sim}.xml | 80 | sed -i "s@SIM_SIZE@${SIZE}@g" ThisSim.ini |
81 | sed -i "s@SIM_SIZE@${SIZE}@g" ${sim}.xml | ||
82 | 81 | ||
83 | ln -s ../../current/scripts/common.sh common.sh | 82 | ln -s ../../current/scripts/common.sh common.sh |
84 | ln -s ../../current/scripts/start-sim start-sim | 83 | ln -s ../../current/scripts/start-sim start-sim |
diff --git a/scripts/start-sim b/scripts/start-sim index 3c6370f..4bcc803 100755 --- a/scripts/start-sim +++ b/scripts/start-sim | |||
@@ -71,7 +71,7 @@ if [ "x$tgt" = "xROBUST" ]; then | |||
71 | title="ROBUST" | 71 | title="ROBUST" |
72 | elif [ "x$inventory" = "x" ]; then | 72 | elif [ "x$inventory" = "x" ]; then |
73 | exe="OpenSim" | 73 | exe="OpenSim" |
74 | # Grab the first Section line of the sims .xml file, cut it down to the name. | 74 | # Grab the first RegionName line of the sims .ini file, cut it down to the name. |
75 | title=$(getSimName ${num}) | 75 | title=$(getSimName ${num}) |
76 | fi | 76 | fi |
77 | 77 | ||