From baefa05b575b28e1ed08670e9c937ca307f09269 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 4 Feb 2008 18:52:24 +0000 Subject: * Rebase all current servers on common abstract BaseOpenSimServer class * The immediate upshot is that "show uptime" from the console will now show uptime on all server types (user, asset, grid, etc) * DEV: This refactoring is far from complete - only just enough to makes the "show uptime" command common accross the servers. More is needed, but in this case it's somewhat like eating cabbage, which I prefer not to do all at once --- OpenSim/Grid/GridServer/Main.cs | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'OpenSim/Grid/GridServer') diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs index d4947b3..8a522c2 100644 --- a/OpenSim/Grid/GridServer/Main.cs +++ b/OpenSim/Grid/GridServer/Main.cs @@ -37,7 +37,7 @@ namespace OpenSim.Grid.GridServer { /// /// - public class OpenGrid_Main : conscmd_callback + public class OpenGrid_Main : BaseOpenSimServer, conscmd_callback { public GridConfig Cfg; @@ -51,8 +51,6 @@ namespace OpenSim.Grid.GridServer private GridManager m_gridManager; - private LogBase m_console; - [STAThread] public static void Main(string[] args) { @@ -70,11 +68,11 @@ namespace OpenSim.Grid.GridServer private void Work() { - m_console.Notice("Enter help for a list of commands\n"); + m_log.Notice("Enter help for a list of commands\n"); while (true) { - m_console.MainLogPrompt(); + m_log.MainLogPrompt(); } } @@ -84,9 +82,9 @@ namespace OpenSim.Grid.GridServer { Directory.CreateDirectory(Util.logDir()); } - m_console = + m_log = new LogBase((Path.Combine(Util.logDir(), "opengrid-gridserver-console.log")), "OpenGrid", this, true); - MainLog.Instance = m_console; + MainLog.Instance = m_log; } public void managercallback(string cmd) @@ -106,12 +104,12 @@ namespace OpenSim.Grid.GridServer //Yeah srsly, that's it. if (setuponly) Environment.Exit(0); - m_console.Verbose("GRID", "Connecting to Storage Server"); + m_log.Verbose("GRID", "Connecting to Storage Server"); m_gridManager = new GridManager(); m_gridManager.AddPlugin(Cfg.DatabaseProvider); // Made of win m_gridManager.config = Cfg; - m_console.Verbose("GRID", "Starting HTTP process"); + m_log.Verbose("GRID", "Starting HTTP process"); BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort); //GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback); @@ -137,7 +135,7 @@ namespace OpenSim.Grid.GridServer httpServer.Start(); - m_console.Verbose("GRID", "Starting sim status checker"); + m_log.Verbose("GRID", "Starting sim status checker"); Timer simCheckTimer = new Timer(3600000*3); // 3 Hours between updates. simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims); @@ -181,25 +179,23 @@ namespace OpenSim.Grid.GridServer */ } - public void RunCmd(string cmd, string[] cmdparams) + 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; + m_log.Notice("shutdown - shutdown the grid (USE CAUTION!)"); + break; case "shutdown": - m_console.Close(); + m_log.Close(); Environment.Exit(0); break; } } - public void Show(string ShowWhat) - { - } - /*private void ConfigDB(IGenericConfig configData) { try @@ -223,4 +219,4 @@ namespace OpenSim.Grid.GridServer } }*/ } -} \ No newline at end of file +} -- cgit v1.1