diff options
-rw-r--r-- | OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs | 23 | ||||
-rwxr-xr-x | OpenSim/Framework/RegionInfo.cs | 21 |
2 files changed, 35 insertions, 9 deletions
diff --git a/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs b/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs index 976714c..77a2c27 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs | |||
@@ -70,11 +70,11 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
70 | string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); | 70 | string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); |
71 | string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); | 71 | string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); |
72 | 72 | ||
73 | // Create an empty Regions.ini if there are no existing config files. | 73 | // Create an empty Regions.xml if there are no existing config files. |
74 | if (!allowRegionless && configFiles.Length == 0 && iniFiles.Length == 0) | 74 | if (!allowRegionless && configFiles.Length == 0 /*&& iniFiles.Length == 0*/) |
75 | { | 75 | { |
76 | new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource); | 76 | new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.xml"), false, m_configSource); |
77 | iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); | 77 | configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); |
78 | } | 78 | } |
79 | 79 | ||
80 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config files from {0}", regionConfigPath); | 80 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config files from {0}", regionConfigPath); |
@@ -82,6 +82,18 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
82 | List<RegionInfo> regionInfos = new List<RegionInfo>(); | 82 | List<RegionInfo> regionInfos = new List<RegionInfo>(); |
83 | 83 | ||
84 | int i = 0; | 84 | int i = 0; |
85 | |||
86 | IConfig regionConfig = (IConfig)m_configSource.Configs["Region"]; | ||
87 | string name = regionConfig.GetString("RegionName", string.Empty).Trim(); | ||
88 | if (string.Empty != name) | ||
89 | { | ||
90 | RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), string.Empty, false, m_configSource, name); | ||
91 | regionInfos.Add(regionInfo); | ||
92 | |||
93 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName); | ||
94 | i++; | ||
95 | } | ||
96 | |||
85 | foreach (string file in iniFiles) | 97 | foreach (string file in iniFiles) |
86 | { | 98 | { |
87 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); | 99 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); |
@@ -114,4 +126,5 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
114 | return regionInfos.ToArray(); | 126 | return regionInfos.ToArray(); |
115 | } | 127 | } |
116 | } | 128 | } |
117 | } \ No newline at end of file | 129 | } |
130 | |||
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 5a3b814..b88d31f 100755 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs | |||
@@ -198,6 +198,11 @@ namespace OpenSim.Framework | |||
198 | { | 198 | { |
199 | // m_configSource = configSource; | 199 | // m_configSource = configSource; |
200 | CacheID = UUID.Random(); | 200 | CacheID = UUID.Random(); |
201 | if (string.Empty == filename) | ||
202 | { | ||
203 | ReadNiniConfig(configSource, "Region", configName); | ||
204 | return; | ||
205 | } | ||
201 | 206 | ||
202 | if (filename.ToLower().EndsWith(".ini")) | 207 | if (filename.ToLower().EndsWith(".ini")) |
203 | { | 208 | { |
@@ -425,7 +430,7 @@ namespace OpenSim.Framework | |||
425 | set { m_remotingPort = value; } | 430 | set { m_remotingPort = value; } |
426 | } | 431 | } |
427 | 432 | ||
428 | 433 | ||
429 | /// <value> | 434 | /// <value> |
430 | /// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw. | 435 | /// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw. |
431 | /// | 436 | /// |
@@ -514,6 +519,10 @@ namespace OpenSim.Framework | |||
514 | 519 | ||
515 | private void ReadNiniConfig(IConfigSource source, string name) | 520 | private void ReadNiniConfig(IConfigSource source, string name) |
516 | { | 521 | { |
522 | ReadNiniConfig(source, name, name); | ||
523 | } | ||
524 | private void ReadNiniConfig(IConfigSource source, string section, string name) | ||
525 | { | ||
517 | bool creatingNew = false; | 526 | bool creatingNew = false; |
518 | 527 | ||
519 | if (source.Configs.Count == 0) | 528 | if (source.Configs.Count == 0) |
@@ -549,8 +558,7 @@ namespace OpenSim.Framework | |||
549 | source.AddConfig(name); | 558 | source.AddConfig(name); |
550 | } | 559 | } |
551 | 560 | ||
552 | RegionName = name; | 561 | IConfig config = source.Configs[section]; |
553 | IConfig config = source.Configs[name]; | ||
554 | 562 | ||
555 | // Track all of the keys in this config and remove as they are processed | 563 | // Track all of the keys in this config and remove as they are processed |
556 | // The remaining keys will be added to generic key-value storage for | 564 | // The remaining keys will be added to generic key-value storage for |
@@ -561,6 +569,11 @@ namespace OpenSim.Framework | |||
561 | allKeys.Add(s); | 569 | allKeys.Add(s); |
562 | } | 570 | } |
563 | 571 | ||
572 | // RegionName | ||
573 | // | ||
574 | allKeys.Remove("RegionName"); | ||
575 | RegionName = config.GetString("RegionName", name); | ||
576 | |||
564 | // RegionUUID | 577 | // RegionUUID |
565 | // | 578 | // |
566 | allKeys.Remove("RegionUUID"); | 579 | allKeys.Remove("RegionUUID"); |
@@ -675,7 +688,7 @@ namespace OpenSim.Framework | |||
675 | m_externalHostName = Util.GetLocalHost().ToString(); | 688 | m_externalHostName = Util.GetLocalHost().ToString(); |
676 | m_log.InfoFormat( | 689 | m_log.InfoFormat( |
677 | "[REGIONINFO]: Resolving SYSTEMIP to {0} for external hostname of region {1}", | 690 | "[REGIONINFO]: Resolving SYSTEMIP to {0} for external hostname of region {1}", |
678 | m_externalHostName, name); | 691 | m_externalHostName, RegionName); |
679 | } | 692 | } |
680 | else if (!m_resolveAddress) | 693 | else if (!m_resolveAddress) |
681 | { | 694 | { |