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 /OpenSim | |
parent | Management scripts encounters the real world, needs patching up. (diff) | |
download | opensim-SC_OLD-f921cb712e67893b44496192e5297335ed65caf7.zip opensim-SC_OLD-f921cb712e67893b44496192e5297335ed65caf7.tar.gz opensim-SC_OLD-f921cb712e67893b44496192e5297335ed65caf7.tar.bz2 opensim-SC_OLD-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.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs | 20 | ||||
-rw-r--r-- | OpenSim/Framework/RegionInfo.cs | 22 |
2 files changed, 33 insertions, 9 deletions
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 | { |