aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs
diff options
context:
space:
mode:
authorSean McNamara2011-04-10 18:28:54 -0400
committerSean McNamara2011-04-10 18:28:54 -0400
commit9c0f3c73b1fd56ac145e866af0316a3285ddb689 (patch)
tree03541a853c2ecf5829ac296537b14d4553ad4b2e /OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs
parentMerge git://opensimulator.org/git/opensim (diff)
parentminor: remove mono compiler warnings (diff)
downloadopensim-SC_OLD-9c0f3c73b1fd56ac145e866af0316a3285ddb689.zip
opensim-SC_OLD-9c0f3c73b1fd56ac145e866af0316a3285ddb689.tar.gz
opensim-SC_OLD-9c0f3c73b1fd56ac145e866af0316a3285ddb689.tar.bz2
opensim-SC_OLD-9c0f3c73b1fd56ac145e866af0316a3285ddb689.tar.xz
Merge git://opensimulator.org/git/opensim
Diffstat (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs')
-rw-r--r--OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs24
1 files changed, 20 insertions, 4 deletions
diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs
index 63e09ae..0aae4ff 100644
--- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs
+++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs
@@ -25,15 +25,19 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using log4net;
28using System; 29using System;
29using System.Collections.Generic; 30using System.Collections.Generic;
30using System.IO; 31using System.IO;
32using System.Reflection;
31using Nini.Config; 33using Nini.Config;
32 34
33namespace OpenSim.Framework.RegionLoader.Filesystem 35namespace OpenSim.Framework.RegionLoader.Filesystem
34{ 36{
35 public class RegionLoaderFileSystem : IRegionLoader 37 public class RegionLoaderFileSystem : IRegionLoader
36 { 38 {
39 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
40
37 private IConfigSource m_configSource; 41 private IConfigSource m_configSource;
38 42
39 public void SetIniConfigSource(IConfigSource configSource) 43 public void SetIniConfigSource(IConfigSource configSource)
@@ -63,36 +67,48 @@ namespace OpenSim.Framework.RegionLoader.Filesystem
63 string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); 67 string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml");
64 string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); 68 string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini");
65 69
70 // Create an empty Regions.ini if there are no existing config files.
66 if (configFiles.Length == 0 && iniFiles.Length == 0) 71 if (configFiles.Length == 0 && iniFiles.Length == 0)
67 { 72 {
68 new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource); 73 new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource);
69 iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); 74 iniFiles = Directory.GetFiles(regionConfigPath, "*.ini");
70 } 75 }
76
77 m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config files from {0}", regionConfigPath);
71 78
72 List<RegionInfo> regionInfos = new List<RegionInfo>(); 79 List<RegionInfo> regionInfos = new List<RegionInfo>();
73 80
74 int i = 0; 81 int i = 0;
75 foreach (string file in iniFiles) 82 foreach (string file in iniFiles)
76 { 83 {
84 m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file);
85
77 IConfigSource source = new IniConfigSource(file); 86 IConfigSource source = new IniConfigSource(file);
78 87
79 foreach (IConfig config in source.Configs) 88 foreach (IConfig config in source.Configs)
80 { 89 {
81 //m_log.Info("[REGIONLOADERFILESYSTEM]: Creating RegionInfo for " + config.Name);
82 RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name); 90 RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name);
83 regionInfos.Add(regionInfo); 91 regionInfos.Add(regionInfo);
92
93 m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName);
94
84 i++; 95 i++;
85 } 96 }
86 } 97 }
87 98
88 foreach (string file in configFiles) 99 foreach (string file in configFiles)
89 { 100 {
101 m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file);
102
90 RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource); 103 RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource);
91 regionInfos.Add(regionInfo); 104 regionInfos.Add(regionInfo);
105
106 m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName);
107
92 i++; 108 i++;
93 } 109 }
94 110
95 return regionInfos.ToArray(); 111 return regionInfos.ToArray();
96 } 112 }
97 } 113 }
98} 114} \ No newline at end of file