From 313a635d1ec368b14a1678bdf7813138972f3bbc Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 9 May 2008 13:21:12 +0000 Subject: * Fix opensim region server shutdown. --- OpenSim/Region/Application/OpenSimMain.cs | 24 +++++++--------------- OpenSim/Region/Application/OpenSimMainConsole.cs | 26 ------------------------ 2 files changed, 7 insertions(+), 43 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index adfddcb..ec26d9d 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -330,20 +330,14 @@ namespace OpenSim // We are done with startup m_log.InfoFormat("[OPENSIM MAIN]: Startup complete, serving {0} region{1}", m_clientServers.Count.ToString(), m_clientServers.Count > 1 ? "s" : ""); + WorldHasComeToAnEnd.WaitOne(); m_log.Info("[OPENSIM MAIN]: Shutdown complete, goodbye."); + Environment.Exit(0); } /// - /// Signal that the end of the world is now. - /// - public void ApocalypseNow() - { - WorldHasComeToAnEnd.Set(); - } - - /// /// Print the version information available to the library. This include a subversion number if the root /// .svn/entries file is present. /// @@ -689,7 +683,7 @@ namespace OpenSim /// /// Performs any last-minute sanity checking and shuts down the region server /// - protected virtual void InternalShutdown() + public override void Shutdown() { if (proxyUrl.Length > 0) { @@ -703,14 +697,10 @@ namespace OpenSim m_log.Info("[SHUTDOWN]: Closing console and terminating"); m_sceneManager.Close(); - // needs to be called by Shutdown() method - // Environment.Exit(0); - } - - public virtual void Shutdown() - { - InternalShutdown(); - ApocalypseNow(); + + WorldHasComeToAnEnd.Set(); + + base.Shutdown(); } /// diff --git a/OpenSim/Region/Application/OpenSimMainConsole.cs b/OpenSim/Region/Application/OpenSimMainConsole.cs index c02095c..f33441f 100644 --- a/OpenSim/Region/Application/OpenSimMainConsole.cs +++ b/OpenSim/Region/Application/OpenSimMainConsole.cs @@ -120,32 +120,6 @@ namespace OpenSim return new ConsoleBase("Region", this); } - /// - /// Performs any last-minute sanity checking and shuts down the region server - /// - public override void Shutdown() - { - if (m_startupCommandsFile != String.Empty) - { - RunCommandScript(m_shutdownCommandsFile); - } - - if (proxyUrl.Length > 0) - { - Util.XmlRpcCommand(proxyUrl, "Stop"); - } - - m_log.Info("[SHUTDOWN]: Closing all threads"); - m_log.Info("[SHUTDOWN]: Killing listener thread"); - m_log.Info("[SHUTDOWN]: Killing clients"); - // TODO: implement this - m_log.Info("[SHUTDOWN]: Closing console and terminating"); - - m_sceneManager.Close(); - - base.Shutdown(); - } - private void RunAutoTimerScript(object sender, EventArgs e) { if (m_timedScript != "disabled") -- cgit v1.1