From fc6c4dc399587f6f920d3f0759b1bd7a8b9b4ac8 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 1 May 2008 16:41:01 +0000 Subject: * Cleaning code still. --- OpenSim/Grid/GridServer/GridServerBase.cs | 60 ++++++++++++++++--------------- 1 file changed, 32 insertions(+), 28 deletions(-) (limited to 'OpenSim/Grid/GridServer/GridServerBase.cs') diff --git a/OpenSim/Grid/GridServer/GridServerBase.cs b/OpenSim/Grid/GridServer/GridServerBase.cs index 2feaac3..ac33a6c 100644 --- a/OpenSim/Grid/GridServer/GridServerBase.cs +++ b/OpenSim/Grid/GridServer/GridServerBase.cs @@ -44,6 +44,34 @@ namespace OpenSim.Grid.GridServer protected GridManager m_gridManager; protected List m_plugins = new List(); + public GridServerBase() + { + m_console = new ConsoleBase("OpenGrid", this); + MainConsole.Instance = m_console; + } + + #region conscmd_callback Members + + public override void RunCmd(string cmd, string[] cmdparams) + { + 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; + } + } + + #endregion + public void Work() { m_console.Notice("Enter help for a list of commands\n"); @@ -54,12 +82,6 @@ namespace OpenSim.Grid.GridServer } } - public GridServerBase() - { - m_console = new ConsoleBase("OpenGrid", this); - MainConsole.Instance = m_console; - } - public void managercallback(string cmd) { switch (cmd) @@ -83,14 +105,14 @@ namespace OpenSim.Grid.GridServer AddHttpHandlers(); - LoadGridPlugins( ); + LoadGridPlugins(); m_httpServer.Start(); m_console.Status("[GRID]: Starting sim status checker"); Timer simCheckTimer = new Timer(3600000 * 3); // 3 Hours between updates. - simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims); + simCheckTimer.Elapsed += CheckSims; simCheckTimer.Enabled = true; } @@ -122,7 +144,7 @@ namespace OpenSim.Grid.GridServer foreach (TypeExtensionNode node in nodes) { m_console.Status("[GRIDPLUGINS]: Loading OpenSim plugin " + node.Path); - IGridPlugin plugin = (IGridPlugin)node.CreateInstance(); + IGridPlugin plugin = (IGridPlugin) node.CreateInstance(); plugin.Initialise(this); m_plugins.Add(plugin); } @@ -177,23 +199,5 @@ namespace OpenSim.Grid.GridServer } */ } - - public override void RunCmd(string cmd, string[] cmdparams) - { - 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; - } - } } -} +} \ No newline at end of file -- cgit v1.1