diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Grid/GridServer/GridServerBase.cs | 60 |
1 files changed, 32 insertions, 28 deletions
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 | |||
44 | protected GridManager m_gridManager; | 44 | protected GridManager m_gridManager; |
45 | protected List<IGridPlugin> m_plugins = new List<IGridPlugin>(); | 45 | protected List<IGridPlugin> m_plugins = new List<IGridPlugin>(); |
46 | 46 | ||
47 | public GridServerBase() | ||
48 | { | ||
49 | m_console = new ConsoleBase("OpenGrid", this); | ||
50 | MainConsole.Instance = m_console; | ||
51 | } | ||
52 | |||
53 | #region conscmd_callback Members | ||
54 | |||
55 | public override void RunCmd(string cmd, string[] cmdparams) | ||
56 | { | ||
57 | base.RunCmd(cmd, cmdparams); | ||
58 | |||
59 | switch (cmd) | ||
60 | { | ||
61 | case "help": | ||
62 | m_console.Notice("shutdown - shutdown the grid (USE CAUTION!)"); | ||
63 | break; | ||
64 | |||
65 | case "shutdown": | ||
66 | foreach (IGridPlugin plugin in m_plugins) plugin.Close(); | ||
67 | m_console.Close(); | ||
68 | Environment.Exit(0); | ||
69 | break; | ||
70 | } | ||
71 | } | ||
72 | |||
73 | #endregion | ||
74 | |||
47 | public void Work() | 75 | public void Work() |
48 | { | 76 | { |
49 | m_console.Notice("Enter help for a list of commands\n"); | 77 | m_console.Notice("Enter help for a list of commands\n"); |
@@ -54,12 +82,6 @@ namespace OpenSim.Grid.GridServer | |||
54 | } | 82 | } |
55 | } | 83 | } |
56 | 84 | ||
57 | public GridServerBase() | ||
58 | { | ||
59 | m_console = new ConsoleBase("OpenGrid", this); | ||
60 | MainConsole.Instance = m_console; | ||
61 | } | ||
62 | |||
63 | public void managercallback(string cmd) | 85 | public void managercallback(string cmd) |
64 | { | 86 | { |
65 | switch (cmd) | 87 | switch (cmd) |
@@ -83,14 +105,14 @@ namespace OpenSim.Grid.GridServer | |||
83 | 105 | ||
84 | AddHttpHandlers(); | 106 | AddHttpHandlers(); |
85 | 107 | ||
86 | LoadGridPlugins( ); | 108 | LoadGridPlugins(); |
87 | 109 | ||
88 | m_httpServer.Start(); | 110 | m_httpServer.Start(); |
89 | 111 | ||
90 | m_console.Status("[GRID]: Starting sim status checker"); | 112 | m_console.Status("[GRID]: Starting sim status checker"); |
91 | 113 | ||
92 | Timer simCheckTimer = new Timer(3600000 * 3); // 3 Hours between updates. | 114 | Timer simCheckTimer = new Timer(3600000 * 3); // 3 Hours between updates. |
93 | simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims); | 115 | simCheckTimer.Elapsed += CheckSims; |
94 | simCheckTimer.Enabled = true; | 116 | simCheckTimer.Enabled = true; |
95 | } | 117 | } |
96 | 118 | ||
@@ -122,7 +144,7 @@ namespace OpenSim.Grid.GridServer | |||
122 | foreach (TypeExtensionNode node in nodes) | 144 | foreach (TypeExtensionNode node in nodes) |
123 | { | 145 | { |
124 | m_console.Status("[GRIDPLUGINS]: Loading OpenSim plugin " + node.Path); | 146 | m_console.Status("[GRIDPLUGINS]: Loading OpenSim plugin " + node.Path); |
125 | IGridPlugin plugin = (IGridPlugin)node.CreateInstance(); | 147 | IGridPlugin plugin = (IGridPlugin) node.CreateInstance(); |
126 | plugin.Initialise(this); | 148 | plugin.Initialise(this); |
127 | m_plugins.Add(plugin); | 149 | m_plugins.Add(plugin); |
128 | } | 150 | } |
@@ -177,23 +199,5 @@ namespace OpenSim.Grid.GridServer | |||
177 | } | 199 | } |
178 | */ | 200 | */ |
179 | } | 201 | } |
180 | |||
181 | public override void RunCmd(string cmd, string[] cmdparams) | ||
182 | { | ||
183 | base.RunCmd(cmd, cmdparams); | ||
184 | |||
185 | switch (cmd) | ||
186 | { | ||
187 | case "help": | ||
188 | m_console.Notice("shutdown - shutdown the grid (USE CAUTION!)"); | ||
189 | break; | ||
190 | |||
191 | case "shutdown": | ||
192 | foreach (IGridPlugin plugin in m_plugins) plugin.Close(); | ||
193 | m_console.Close(); | ||
194 | Environment.Exit(0); | ||
195 | break; | ||
196 | } | ||
197 | } | ||
198 | } | 202 | } |
199 | } | 203 | } \ No newline at end of file |