From 250fb6f5dbcd6665c2783db08389b7e5ce698d5e Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 7 May 2008 16:24:15 +0000 Subject: * Move shutdown processing to base OpenSimServer, overriding the method where appropriate * This also means that the command quit (as well as shutdown) will now close down grid servers (instead of only being in place for the region server) --- OpenSim/Grid/AssetServer/Main.cs | 4 +--- OpenSim/Grid/GridServer/GridServerBase.cs | 21 +++++---------------- OpenSim/Grid/InventoryServer/Main.cs | 4 ---- OpenSim/Grid/MessagingServer/Main.cs | 24 ++++-------------------- OpenSim/Grid/ScriptServer/ScriptServerMain.cs | 4 ---- OpenSim/Grid/UserServer/Main.cs | 16 ++++++++-------- 6 files changed, 18 insertions(+), 55 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/AssetServer/Main.cs b/OpenSim/Grid/AssetServer/Main.cs index 26f4bc8..77e4628 100644 --- a/OpenSim/Grid/AssetServer/Main.cs +++ b/OpenSim/Grid/AssetServer/Main.cs @@ -181,9 +181,7 @@ namespace OpenSim.Grid.AssetServer switch (cmd) { case "help": - m_console.Notice( - @"shutdown - shutdown this asset server (USE CAUTION!) - stats - statistical information for this server"); + m_console.Notice("stats - statistical information for this server"); break; diff --git a/OpenSim/Grid/GridServer/GridServerBase.cs b/OpenSim/Grid/GridServer/GridServerBase.cs index 2feaac3..49c53e9 100644 --- a/OpenSim/Grid/GridServer/GridServerBase.cs +++ b/OpenSim/Grid/GridServer/GridServerBase.cs @@ -177,23 +177,12 @@ namespace OpenSim.Grid.GridServer } */ } - - public override void RunCmd(string cmd, string[] cmdparams) + + protected override void Shutdown() { - base.RunCmd(cmd, cmdparams); - - switch (cmd) - { - case "help": - m_console.Notice("shutdown - shutdown the grid (USE CAUTION!)"); - break; - - case "shutdown": - foreach (IGridPlugin plugin in m_plugins) plugin.Close(); - m_console.Close(); - Environment.Exit(0); - break; - } + foreach (IGridPlugin plugin in m_plugins) plugin.Close(); + + base.Shutdown(); } } } diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs index 4076d21..f1bd60f 100644 --- a/OpenSim/Grid/InventoryServer/Main.cs +++ b/OpenSim/Grid/InventoryServer/Main.cs @@ -144,10 +144,6 @@ namespace OpenSim.Grid.InventoryServer case "add-user": m_inventoryService.CreateUsersInventory(LLUUID.Random().UUID); break; - case "shutdown": - m_console.Close(); - Environment.Exit(0); - break; } } } diff --git a/OpenSim/Grid/MessagingServer/Main.cs b/OpenSim/Grid/MessagingServer/Main.cs index bf793bf..22a7d9c 100644 --- a/OpenSim/Grid/MessagingServer/Main.cs +++ b/OpenSim/Grid/MessagingServer/Main.cs @@ -140,29 +140,13 @@ namespace OpenSim.Grid.MessagingServer // m_lastCreatedUser = userID; break; } - } + } - public override void RunCmd(string cmd, string[] cmdparams) + protected override void Shutdown() { - base.RunCmd(cmd, cmdparams); + msgsvc.deregisterWithUserServer(); - switch (cmd) - { - case "help": - m_console.Notice("shutdown - shutdown the message server (USE CAUTION!)"); - break; - - case "shutdown": - msgsvc.deregisterWithUserServer(); - m_console.Close(); - Environment.Exit(0); - break; - } - } - - public override void Show(string ShowWhat) - { - base.Show(ShowWhat); + base.Shutdown(); } } } diff --git a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs index 528b51c..e487c02 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs @@ -97,10 +97,6 @@ namespace OpenSim.Grid.ScriptServer } } - ~ScriptServerMain() - { - } - protected ConsoleBase CreateConsole() { return new ConsoleBase("ScriptServer", this); diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 8e6559c..d60c205 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -219,19 +219,12 @@ namespace OpenSim.Grid.UserServer { case "help": m_console.Notice("create user - create a new user"); - m_console.Notice("stats - statistical information for this server"); - m_console.Notice("shutdown - shutdown the grid (USE CAUTION!)"); + m_console.Notice("stats - statistical information for this server"); break; case "create": do_create(cmdparams[0]); break; - - case "shutdown": - m_loginService.OnUserLoggedInAtLocation -= NotifyMessageServersUserLoggedInToLocation; - m_console.Close(); - Environment.Exit(0); - break; case "stats": m_console.Notice(StatsManager.UserStats.Report()); @@ -251,6 +244,13 @@ namespace OpenSim.Grid.UserServer } } + protected override void Shutdown() + { + m_loginService.OnUserLoggedInAtLocation -= NotifyMessageServersUserLoggedInToLocation; + + base.Shutdown(); + } + public void TestResponse(List resp) { m_console.Notice("response got"); -- cgit v1.1