diff options
author | Melanie Thielker | 2009-02-07 12:25:39 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-02-07 12:25:39 +0000 |
commit | 54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a (patch) | |
tree | f606cbdbc383ec21fee28f0a1454140a1c714278 /OpenSim/Grid/MessagingServer/Main.cs | |
parent | Thank you dslake for a patch that: (diff) | |
download | opensim-SC-54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a.zip opensim-SC-54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a.tar.gz opensim-SC-54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a.tar.bz2 opensim-SC-54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a.tar.xz |
Replace the console for all OpenSim apps with a new console featuring command
line editing, context sensitive help (press ? at any time), command line
history, a new plugin command system and new appender features thet let you
type while the console is scrolling. Seamlessly integrates the ICommander
interfaces.
Diffstat (limited to 'OpenSim/Grid/MessagingServer/Main.cs')
-rw-r--r-- | OpenSim/Grid/MessagingServer/Main.cs | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/OpenSim/Grid/MessagingServer/Main.cs b/OpenSim/Grid/MessagingServer/Main.cs index e83da7a..9b7e731 100644 --- a/OpenSim/Grid/MessagingServer/Main.cs +++ b/OpenSim/Grid/MessagingServer/Main.cs | |||
@@ -41,7 +41,7 @@ namespace OpenSim.Grid.MessagingServer | |||
41 | { | 41 | { |
42 | /// <summary> | 42 | /// <summary> |
43 | /// </summary> | 43 | /// </summary> |
44 | public class OpenMessage_Main : BaseOpenSimServer, conscmd_callback | 44 | public class OpenMessage_Main : BaseOpenSimServer |
45 | { | 45 | { |
46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
@@ -64,7 +64,7 @@ namespace OpenSim.Grid.MessagingServer | |||
64 | 64 | ||
65 | public OpenMessage_Main() | 65 | public OpenMessage_Main() |
66 | { | 66 | { |
67 | m_console = new ConsoleBase("Messaging", this); | 67 | m_console = new ConsoleBase("Messaging"); |
68 | MainConsole.Instance = m_console; | 68 | MainConsole.Instance = m_console; |
69 | } | 69 | } |
70 | 70 | ||
@@ -124,6 +124,16 @@ namespace OpenSim.Grid.MessagingServer | |||
124 | registerWithUserServer(); | 124 | registerWithUserServer(); |
125 | 125 | ||
126 | m_log.Info("[SERVER]: Messageserver 0.5 - Startup complete"); | 126 | m_log.Info("[SERVER]: Messageserver 0.5 - Startup complete"); |
127 | |||
128 | base.StartupSpecific(); | ||
129 | |||
130 | m_console.Commands.AddCommand("messageserver", "clear cache", | ||
131 | "clear cache", | ||
132 | "Clear presence cache", HandleClearCache); | ||
133 | |||
134 | m_console.Commands.AddCommand("messageserver", "register", | ||
135 | "register", | ||
136 | "Re-register with user server(s)", HandleRegister); | ||
127 | } | 137 | } |
128 | 138 | ||
129 | public void do_create(string what) | 139 | public void do_create(string what) |
@@ -154,29 +164,17 @@ namespace OpenSim.Grid.MessagingServer | |||
154 | } | 164 | } |
155 | } | 165 | } |
156 | 166 | ||
157 | public override void RunCmd(string cmd, string[] cmdparams) | 167 | private void HandleClearCache(string module, string[] cmd) |
158 | { | 168 | { |
159 | base.RunCmd(cmd, cmdparams); | 169 | int entries = msgsvc.ClearRegionCache(); |
160 | 170 | m_console.Notice("Region cache cleared! Cleared " + | |
161 | switch (cmd) | 171 | entries.ToString() + " entries"); |
162 | { | ||
163 | case "clear-cache": | ||
164 | int entries = msgsvc.ClearRegionCache(); | ||
165 | m_console.Notice("Region cache cleared! Cleared " + entries.ToString() + " entries"); | ||
166 | break; | ||
167 | case "register": | ||
168 | deregisterFromUserServer(); | ||
169 | registerWithUserServer(); | ||
170 | break; | ||
171 | } | ||
172 | } | 172 | } |
173 | 173 | ||
174 | protected override void ShowHelp(string[] helpArgs) | 174 | private void HandleRegister(string module, string[] cmd) |
175 | { | 175 | { |
176 | base.ShowHelp(helpArgs); | 176 | deregisterFromUserServer(); |
177 | 177 | registerWithUserServer(); | |
178 | m_console.Notice("clear-cache - Clears region cache. Should be done when regions change position. The region cache gets stale after a while."); | ||
179 | m_console.Notice("register - (Re-)registers with user-server. This might be necessary if the userserver crashed/restarted"); | ||
180 | } | 178 | } |
181 | 179 | ||
182 | public override void ShutdownSpecific() | 180 | public override void ShutdownSpecific() |