aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs31
1 files changed, 16 insertions, 15 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index 16bb69e..e9151b5 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -35,6 +35,8 @@ using OpenSim.Framework;
35using OpenSim.Framework.Communications.Cache; 35using OpenSim.Framework.Communications.Cache;
36using OpenSim.Framework.Console; 36using OpenSim.Framework.Console;
37using OpenSim.Framework.Servers; 37using OpenSim.Framework.Servers;
38using OpenSim.Framework.RegionLoader.Filesystem;
39using OpenSim.Framework.RegionLoader.Web;
38using OpenSim.Region.ClientStack; 40using OpenSim.Region.ClientStack;
39using OpenSim.Region.Communications.Local; 41using OpenSim.Region.Communications.Local;
40using OpenSim.Region.Communications.OGS1; 42using OpenSim.Region.Communications.OGS1;
@@ -43,6 +45,7 @@ using OpenSim.Region.Environment.Interfaces;
43using OpenSim.Region.Environment.Scenes; 45using OpenSim.Region.Environment.Scenes;
44using OpenSim.Region.Physics.Manager; 46using OpenSim.Region.Physics.Manager;
45 47
48
46namespace OpenSim 49namespace OpenSim
47{ 50{
48 public delegate void ConsoleCommand(string[] comParams); 51 public delegate void ConsoleCommand(string[] comParams);
@@ -272,21 +275,21 @@ namespace OpenSim
272 m_httpServer.AddStreamHandler(new SimStatusHandler()); 275 m_httpServer.AddStreamHandler(new SimStatusHandler());
273 } 276 }
274 277
275 string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); 278 IRegionLoader regionLoader;
276 279 if (m_config.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem")
277 if (!Directory.Exists(regionConfigPath))
278 { 280 {
279 Directory.CreateDirectory(regionConfigPath); 281 MainLog.Instance.Notice("Loading Region Info from filesystem");
282 regionLoader = new RegionLoaderFileSystem();
280 } 283 }
281 284 else
282 string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml");
283
284 if (configFiles.Length == 0)
285 { 285 {
286 CreateDefaultRegionInfoXml(Path.Combine(regionConfigPath, "default.xml")); 286 MainLog.Instance.Notice("Loading Region Info from web");
287 configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); 287 regionLoader = new RegionLoaderWebServer();
288 } 288 }
289 289
290 regionLoader.SetIniConfigSource(m_config);
291 RegionInfo[] regionsToLoad = regionLoader.LoadRegions();
292
290 m_moduleLoader = new ModuleLoader(m_log, m_config); 293 m_moduleLoader = new ModuleLoader(m_log, m_config);
291 MainLog.Instance.Verbose("Loading Shared Modules"); 294 MainLog.Instance.Verbose("Loading Shared Modules");
292 m_moduleLoader.LoadDefaultSharedModules(); 295 m_moduleLoader.LoadDefaultSharedModules();
@@ -294,12 +297,10 @@ namespace OpenSim
294 // Load all script engines found (scripting engine is now a IRegionModule so loaded in the module loader 297 // Load all script engines found (scripting engine is now a IRegionModule so loaded in the module loader
295 // OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineLoader ScriptEngineLoader = new OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineLoader(m_log); 298 // OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineLoader ScriptEngineLoader = new OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineLoader(m_log);
296 299
297 for (int i = 0; i < configFiles.Length; i++) 300 for (int i = 0; i < regionsToLoad.Length; i++)
298 { 301 {
299 //Console.WriteLine("Loading region config file"); 302 MainLog.Instance.Debug("Creating Region: " + regionsToLoad[i].RegionName);
300 RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), configFiles[i]); 303 CreateRegion(regionsToLoad[i]);
301
302 CreateRegion(regionInfo);
303 } 304 }
304 305
305 m_moduleLoader.PostInitialise(); 306 m_moduleLoader.PostInitialise();