From 33e7c09b7b894551b35fb8ab29133c96a5d7b037 Mon Sep 17 00:00:00 2001 From: MW Date: Thu, 26 Feb 2009 20:01:20 +0000 Subject: Added IRegistryCore and RegistryCore to OpenSim.Framework. Added a ApplicationRegistry to OpenSimBase. Changed LoadRegionsPlugin so it registers itself to that application registry. Added a event to LoadRegionsPlugin, that is triggered when it creates a new scene ,although maybe this event should actually be in opensimBase incase other plugins are creating regions (like the RemoteAdminPlugin). --- OpenSim/Region/Application/OpenSim.cs | 67 +++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 31 deletions(-) (limited to 'OpenSim/Region/Application/OpenSim.cs') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index a17d92f..a8adf58 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -95,6 +95,40 @@ namespace OpenSim m_console.SetGuiMode(m_gui); MainConsole.Instance = m_console; + RegisterConsoleCommands(); + + base.StartupSpecific(); + + //Run Startup Commands + if (String.IsNullOrEmpty( m_startupCommandsFile )) + { + m_log.Info("[STARTUP]: No startup command script specified. Moving on..."); + } + else + { + RunCommandScript(m_startupCommandsFile); + } + + // Start timer script (run a script every xx seconds) + if (m_timedScript != "disabled") + { + m_scriptTimer = new Timer(); + m_scriptTimer.Enabled = true; + m_scriptTimer.Interval = 1200 * 1000; + m_scriptTimer.Elapsed += RunAutoTimerScript; + } + + PrintFileToConsole("startuplogo.txt"); + + // For now, start at the 'root' level by default + if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it + ChangeSelectedRegion("region", new string[] {"change", "region", m_sceneManager.Scenes[0].RegionInfo.RegionName}); + else + ChangeSelectedRegion("region", new string[] {"change", "region", "root"}); + } + + private void RegisterConsoleCommands() + { m_console.Commands.AddCommand("region", false, "clear assets", "clear assets", "Clear the asset cache", HandleClearAssets); @@ -255,35 +289,6 @@ namespace OpenSim "reset user password [ [ []]]", "Reset a user password", HandleResetUserPassword); } - - base.StartupSpecific(); - - //Run Startup Commands - if (String.IsNullOrEmpty( m_startupCommandsFile )) - { - m_log.Info("[STARTUP]: No startup command script specified. Moving on..."); - } - else - { - RunCommandScript(m_startupCommandsFile); - } - - // Start timer script (run a script every xx seconds) - if (m_timedScript != "disabled") - { - m_scriptTimer = new Timer(); - m_scriptTimer.Enabled = true; - m_scriptTimer.Interval = 1200 * 1000; - m_scriptTimer.Elapsed += RunAutoTimerScript; - } - - PrintFileToConsole("startuplogo.txt"); - - // For now, start at the 'root' level by default - if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it - ChangeSelectedRegion("region", new string[] {"change", "region", m_sceneManager.Scenes[0].RegionInfo.RegionName}); - else - ChangeSelectedRegion("region", new string[] {"change", "region", "root"}); } public override void ShutdownSpecific() @@ -410,9 +415,9 @@ namespace OpenSim { m_console.Error("Usage: create region "); } - - CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source), true); + IScene scene; + CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source), true, out scene); } private void HandleLoginEnable(string module, string[] cmd) -- cgit v1.1