diff options
Diffstat (limited to 'OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs')
-rw-r--r-- | OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs b/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs index ea95696..976714c 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs | |||
@@ -48,7 +48,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
48 | 48 | ||
49 | public RegionInfo[] LoadRegions() | 49 | public RegionInfo[] LoadRegions() |
50 | { | 50 | { |
51 | string regionConfigPath = Util.configDir(); | 51 | string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); |
52 | bool allowRegionless = false; | 52 | bool allowRegionless = false; |
53 | 53 | ||
54 | try | 54 | try |
@@ -68,14 +68,13 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
68 | } | 68 | } |
69 | 69 | ||
70 | string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); | 70 | string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); |
71 | //// Causes hangs with the actual .ini files if they are in the same place. | 71 | string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); |
72 | //// string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); | ||
73 | 72 | ||
74 | // Create an empty Regions.ini if there are no existing config files. | 73 | // Create an empty Regions.ini if there are no existing config files. |
75 | if (!allowRegionless && configFiles.Length == 0 /*&& iniFiles.Length == 0*/) | 74 | if (!allowRegionless && configFiles.Length == 0 && iniFiles.Length == 0) |
76 | { | 75 | { |
77 | new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource); | 76 | new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource); |
78 | //// iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); | 77 | iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); |
79 | } | 78 | } |
80 | 79 | ||
81 | 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); |
@@ -83,7 +82,6 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
83 | List<RegionInfo> regionInfos = new List<RegionInfo>(); | 82 | List<RegionInfo> regionInfos = new List<RegionInfo>(); |
84 | 83 | ||
85 | int i = 0; | 84 | int i = 0; |
86 | /* | ||
87 | foreach (string file in iniFiles) | 85 | foreach (string file in iniFiles) |
88 | { | 86 | { |
89 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); | 87 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); |
@@ -100,22 +98,17 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
100 | i++; | 98 | i++; |
101 | } | 99 | } |
102 | } | 100 | } |
103 | */ | 101 | |
104 | foreach (string file in configFiles) | 102 | foreach (string file in configFiles) |
105 | { | 103 | { |
106 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); | 104 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); |
107 | 105 | ||
108 | IConfigSource source = new XmlConfigSource(file); | 106 | RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource); |
109 | 107 | regionInfos.Add(regionInfo); | |
110 | foreach (IConfig config in source.Configs) | ||
111 | { | ||
112 | RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name); | ||
113 | regionInfos.Add(regionInfo); | ||
114 | 108 | ||
115 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName); | 109 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName); |
116 | 110 | ||
117 | i++; | 111 | i++; |
118 | } | ||
119 | } | 112 | } |
120 | 113 | ||
121 | return regionInfos.ToArray(); | 114 | return regionInfos.ToArray(); |