diff options
author | David Walter Seikel | 2016-11-05 18:24:40 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-11-05 18:24:40 +1000 |
commit | 09531a03055f0f053bf55d860137c54c7f3a09b3 (patch) | |
tree | 7a5dcbe370de811692f19f26990711281f1d8715 /OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs | |
parent | Fix up maptiles location. (diff) | |
download | opensim-SC-09531a03055f0f053bf55d860137c54c7f3a09b3.zip opensim-SC-09531a03055f0f053bf55d860137c54c7f3a09b3.tar.gz opensim-SC-09531a03055f0f053bf55d860137c54c7f3a09b3.tar.bz2 opensim-SC-09531a03055f0f053bf55d860137c54c7f3a09b3.tar.xz |
More config path fixes.
Diffstat (limited to 'OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs')
-rw-r--r-- | OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs b/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs index 1873a06..130a523 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs | |||
@@ -38,7 +38,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
38 | public class RegionLoaderFileSystem : IRegionLoader | 38 | public class RegionLoaderFileSystem : IRegionLoader |
39 | { | 39 | { |
40 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 40 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
41 | 41 | ||
42 | private IConfigSource m_configSource; | 42 | private IConfigSource m_configSource; |
43 | 43 | ||
44 | public void SetIniConfigSource(IConfigSource configSource) | 44 | public void SetIniConfigSource(IConfigSource configSource) |
@@ -48,7 +48,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
48 | 48 | ||
49 | public RegionInfo[] LoadRegions() | 49 | public RegionInfo[] LoadRegions() |
50 | { | 50 | { |
51 | string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); | 51 | string regionConfigPath = Util.configDir(); |
52 | bool allowRegionless = false; | 52 | bool allowRegionless = false; |
53 | 53 | ||
54 | try | 54 | try |
@@ -68,47 +68,54 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
68 | } | 68 | } |
69 | 69 | ||
70 | string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); | 70 | string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); |
71 | string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); | 71 | //// Causes hangs with the actual .ini files. |
72 | //// string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); | ||
72 | 73 | ||
73 | // Create an empty Regions.ini if there are no existing config files. | 74 | // Create an empty Regions.ini if there are no existing config files. |
74 | if (!allowRegionless && configFiles.Length == 0 && iniFiles.Length == 0) | 75 | if (!allowRegionless && configFiles.Length == 0 /*&& iniFiles.Length == 0*/) |
75 | { | 76 | { |
76 | new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource); | 77 | new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource); |
77 | iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); | 78 | //// iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); |
78 | } | 79 | } |
79 | 80 | ||
80 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config files from {0}", regionConfigPath); | 81 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config files from {0}", regionConfigPath); |
81 | 82 | ||
82 | List<RegionInfo> regionInfos = new List<RegionInfo>(); | 83 | List<RegionInfo> regionInfos = new List<RegionInfo>(); |
83 | 84 | ||
84 | int i = 0; | 85 | int i = 0; |
86 | /* | ||
85 | foreach (string file in iniFiles) | 87 | foreach (string file in iniFiles) |
86 | { | 88 | { |
87 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); | 89 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); |
88 | 90 | ||
89 | IConfigSource source = new IniConfigSource(file); | 91 | IConfigSource source = new IniConfigSource(file); |
90 | 92 | ||
91 | foreach (IConfig config in source.Configs) | 93 | foreach (IConfig config in source.Configs) |
92 | { | 94 | { |
93 | RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name); | 95 | RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name); |
94 | regionInfos.Add(regionInfo); | 96 | regionInfos.Add(regionInfo); |
95 | 97 | ||
96 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName); | 98 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName); |
97 | 99 | ||
98 | i++; | 100 | i++; |
99 | } | 101 | } |
100 | } | 102 | } |
101 | 103 | */ | |
102 | foreach (string file in configFiles) | 104 | foreach (string file in configFiles) |
103 | { | 105 | { |
104 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); | 106 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); |
105 | 107 | ||
106 | RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource); | 108 | IConfigSource source = new XmlConfigSource(file); |
107 | regionInfos.Add(regionInfo); | 109 | |
108 | 110 | foreach (IConfig config in source.Configs) | |
109 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName); | 111 | { |
110 | 112 | RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name); | |
111 | i++; | 113 | regionInfos.Add(regionInfo); |
114 | |||
115 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName); | ||
116 | |||
117 | i++; | ||
118 | } | ||
112 | } | 119 | } |
113 | 120 | ||
114 | return regionInfos.ToArray(); | 121 | return regionInfos.ToArray(); |