From 0c9933fd0f68187a0150f9dfefe4748256e52849 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Tue, 23 Oct 2007 12:44:12 +0000 Subject: * Added "create-region" console command. Syntax: create-region * Spring cleaning. --- OpenSim/Region/Application/OpenSimMain.cs | 62 +++++++++++++--------- .../MonoSqliteDataStore.cs | 5 -- 2 files changed, 36 insertions(+), 31 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 9de3831..67713d3 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -218,32 +218,7 @@ namespace OpenSim //Console.WriteLine("Loading region config file"); RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), configFiles[i]); - - UDPServer udpServer; - Scene scene = SetupScene(regionInfo, out udpServer); - - m_moduleLoader.InitialiseSharedModules(scene); - MainLog.Instance.Verbose("Loading Region's Modules"); - - m_moduleLoader.PickupModules(scene, "."); - m_moduleLoader.PickupModules(scene, "ScriptEngines"); - - scene.SetModuleInterfaces(); - - // Check if we have a script engine to load - //if (m_scriptEngine != null && m_scriptEngine != "") - //{ - // OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface ScriptEngine = ScriptEngineLoader.LoadScriptEngine(m_scriptEngine); - // scene.AddScriptEngine(ScriptEngine, m_log); - //} - - //Server side object editing permissions checking - scene.PermissionsMngr.BypassPermissions = !m_permissions; - - m_sceneManager.Add(scene); - - m_udpServers.Add(udpServer); - m_regionData.Add(regionInfo); + CreateRegion(regionInfo); } m_moduleLoader.PostInitialise(); @@ -268,6 +243,37 @@ namespace OpenSim MainLog.Instance.Status("STARTUP","Startup complete, serving " + m_udpServers.Count.ToString() + " region(s)"); } + public UDPServer CreateRegion(RegionInfo regionInfo) + { + UDPServer udpServer; + Scene scene = SetupScene(regionInfo, out udpServer); + + m_moduleLoader.InitialiseSharedModules(scene); + MainLog.Instance.Verbose("MODULES", "Loading Region's Modules"); + + m_moduleLoader.PickupModules(scene, "."); + m_moduleLoader.PickupModules(scene, "ScriptEngines"); + + scene.SetModuleInterfaces(); + + // Check if we have a script engine to load + //if (m_scriptEngine != null && m_scriptEngine != "") + //{ + // OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface ScriptEngine = ScriptEngineLoader.LoadScriptEngine(m_scriptEngine); + // scene.AddScriptEngine(ScriptEngine, m_log); + //} + + //Server side object editing permissions checking + scene.PermissionsMngr.BypassPermissions = !m_permissions; + + m_sceneManager.Add(scene); + + m_udpServers.Add(udpServer); + m_regionData.Add(regionInfo); + + return udpServer; + } + private static void CreateDefaultRegionInfoXml(string fileName) { new RegionInfo("DEFAULT REGION CONFIG", fileName); @@ -549,6 +555,10 @@ namespace OpenSim } break; + case "create-region": + CreateRegion(new RegionInfo(cmdparams[0], "Regions/" + cmdparams[1])).ServerListener(); + break; + case "quit": case "shutdown": Shutdown(); diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs index 95772df..c69200a 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs @@ -331,11 +331,6 @@ namespace OpenSim.DataStore.MonoSqlite createCol(terrain, "Revision", typeof(System.Int32)); createCol(terrain, "Heightfield", typeof(System.Byte[])); - /* // Attempting to work out requirements to get SQLite to actually *save* the data. - createCol(terrain, "PrIndex", typeof(System.String)); - terrain.PrimaryKey = new DataColumn[] { terrain.Columns["PrIndex"] }; - */ - return terrain; } -- cgit v1.1