aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/RegionLoader/Filesystem
diff options
context:
space:
mode:
authorMelanie Thielker2009-06-25 15:48:54 +0000
committerMelanie Thielker2009-06-25 15:48:54 +0000
commitd9528bd06e770d9d0bfc1c34d83abb02e7489e66 (patch)
tree34aa2d5d244d188213357441254fd5b826af2767 /OpenSim/Framework/RegionLoader/Filesystem
parentAdded a note to the ScenePresence.UpdateMovement() method, to remind everyone... (diff)
downloadopensim-SC_OLD-d9528bd06e770d9d0bfc1c34d83abb02e7489e66.zip
opensim-SC_OLD-d9528bd06e770d9d0bfc1c34d83abb02e7489e66.tar.gz
opensim-SC_OLD-d9528bd06e770d9d0bfc1c34d83abb02e7489e66.tar.bz2
opensim-SC_OLD-d9528bd06e770d9d0bfc1c34d83abb02e7489e66.tar.xz
Allow the reading of ini files instead of xml files when reading region
definitions from the file system
Diffstat (limited to 'OpenSim/Framework/RegionLoader/Filesystem')
-rw-r--r--OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs29
1 files changed, 23 insertions, 6 deletions
diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs
index c58c41d..b4b15e4 100644
--- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs
+++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections.Generic;
29using System.IO; 30using System.IO;
30using Nini.Config; 31using Nini.Config;
31 32
@@ -60,21 +61,37 @@ namespace OpenSim.Framework.RegionLoader.Filesystem
60 } 61 }
61 62
62 string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); 63 string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml");
64 string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini");
63 65
64 if (configFiles.Length == 0) 66 if (configFiles.Length == 0 && iniFiles.Length == 0)
65 { 67 {
66 new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "default.xml"), false, m_configSource); 68 new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "default.xml"), false, m_configSource);
67 configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); 69 configFiles = Directory.GetFiles(regionConfigPath, "*.xml");
68 } 70 }
69 71
70 RegionInfo[] regionInfos = new RegionInfo[configFiles.Length]; 72 List<RegionInfo> regionInfos = new List<RegionInfo>();
71 for (int i = 0; i < configFiles.Length; i++) 73
74 int i = 0;
75 foreach (string file in iniFiles)
76 {
77 IConfigSource source = new IniConfigSource(file);
78
79 foreach (IConfig config in source.Configs)
80 {
81 RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name);
82 regionInfos.Add(regionInfo);
83 i++;
84 }
85 }
86
87 foreach (string file in configFiles)
72 { 88 {
73 RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), configFiles[i], false, m_configSource); 89 RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource);
74 regionInfos[i] = regionInfo; 90 regionInfos.Add(regionInfo);
91 i++;
75 } 92 }
76 93
77 return regionInfos; 94 return regionInfos.ToArray();
78 } 95 }
79 } 96 }
80} 97}