diff options
author | Justin Clark-Casey (justincc) | 2012-11-22 04:05:09 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-11-22 04:05:09 +0000 |
commit | 5c48d7a378ff066f59b9cee02f2803ebe1616481 (patch) | |
tree | 82af06819d5bb9d184890b5395e831b4e47c91d7 /OpenSim/Framework/Servers/BaseOpenSimServer.cs | |
parent | refactor: Factor out copy/pasted server uptime report code (diff) | |
download | opensim-SC-5c48d7a378ff066f59b9cee02f2803ebe1616481.zip opensim-SC-5c48d7a378ff066f59b9cee02f2803ebe1616481.tar.gz opensim-SC-5c48d7a378ff066f59b9cee02f2803ebe1616481.tar.bz2 opensim-SC-5c48d7a378ff066f59b9cee02f2803ebe1616481.tar.xz |
factor out common HandleShow code for "show uptime"
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Servers/BaseOpenSimServer.cs | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 6346279..4f9ac08 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -62,7 +62,6 @@ namespace OpenSim.Framework.Servers | |||
62 | /// </summary> | 62 | /// </summary> |
63 | private Timer m_periodicDiagnosticsTimer = new Timer(60 * 60 * 1000); | 63 | private Timer m_periodicDiagnosticsTimer = new Timer(60 * 60 * 1000); |
64 | 64 | ||
65 | protected CommandConsole m_console; | ||
66 | protected OpenSimAppender m_consoleAppender; | 65 | protected OpenSimAppender m_consoleAppender; |
67 | protected IAppender m_logFileAppender = null; | 66 | protected IAppender m_logFileAppender = null; |
68 | 67 | ||
@@ -139,7 +138,8 @@ namespace OpenSim.Framework.Servers | |||
139 | } | 138 | } |
140 | else | 139 | else |
141 | { | 140 | { |
142 | m_consoleAppender.Console = m_console; | 141 | // FIXME: This should be done through an interface rather than casting. |
142 | m_consoleAppender.Console = (ConsoleBase)m_console; | ||
143 | 143 | ||
144 | // If there is no threshold set then the threshold is effectively everything. | 144 | // If there is no threshold set then the threshold is effectively everything. |
145 | if (null == m_consoleAppender.Threshold) | 145 | if (null == m_consoleAppender.Threshold) |
@@ -367,8 +367,10 @@ namespace OpenSim.Framework.Servers | |||
367 | } | 367 | } |
368 | } | 368 | } |
369 | 369 | ||
370 | public virtual void HandleShow(string module, string[] cmd) | 370 | public override void HandleShow(string module, string[] cmd) |
371 | { | 371 | { |
372 | base.HandleShow(module, cmd); | ||
373 | |||
372 | List<string> args = new List<string>(cmd); | 374 | List<string> args = new List<string>(cmd); |
373 | 375 | ||
374 | args.RemoveAt(0); | 376 | args.RemoveAt(0); |
@@ -385,10 +387,6 @@ namespace OpenSim.Framework.Servers | |||
385 | Notice(GetThreadsReport()); | 387 | Notice(GetThreadsReport()); |
386 | break; | 388 | break; |
387 | 389 | ||
388 | case "uptime": | ||
389 | Notice(GetUptimeReport()); | ||
390 | break; | ||
391 | |||
392 | case "version": | 390 | case "version": |
393 | Notice(GetVersionText()); | 391 | Notice(GetVersionText()); |
394 | break; | 392 | break; |
@@ -430,33 +428,6 @@ namespace OpenSim.Framework.Servers | |||
430 | } | 428 | } |
431 | 429 | ||
432 | /// <summary> | 430 | /// <summary> |
433 | /// Console output is only possible if a console has been established. | ||
434 | /// That is something that cannot be determined within this class. So | ||
435 | /// all attempts to use the console MUST be verified. | ||
436 | /// </summary> | ||
437 | /// <param name="msg"></param> | ||
438 | protected void Notice(string msg) | ||
439 | { | ||
440 | if (m_console != null) | ||
441 | { | ||
442 | m_console.Output(msg); | ||
443 | } | ||
444 | } | ||
445 | |||
446 | /// <summary> | ||
447 | /// Console output is only possible if a console has been established. | ||
448 | /// That is something that cannot be determined within this class. So | ||
449 | /// all attempts to use the console MUST be verified. | ||
450 | /// </summary> | ||
451 | /// <param name="format"></param> | ||
452 | /// <param name="components"></param> | ||
453 | protected void Notice(string format, params string[] components) | ||
454 | { | ||
455 | if (m_console != null) | ||
456 | m_console.OutputFormat(format, components); | ||
457 | } | ||
458 | |||
459 | /// <summary> | ||
460 | /// Enhance the version string with extra information if it's available. | 431 | /// Enhance the version string with extra information if it's available. |
461 | /// </summary> | 432 | /// </summary> |
462 | protected void EnhanceVersionInformation() | 433 | protected void EnhanceVersionInformation() |