aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/ServerBase.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Servers/ServerBase.cs50
1 files changed, 50 insertions, 0 deletions
diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs
index d19234b..afe1f73 100644
--- a/OpenSim/Framework/Servers/ServerBase.cs
+++ b/OpenSim/Framework/Servers/ServerBase.cs
@@ -26,13 +26,20 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections.Generic;
29using System.Text; 30using System.Text;
31using OpenSim.Framework.Console;
30 32
31namespace OpenSim.Framework.Servers 33namespace OpenSim.Framework.Servers
32{ 34{
33 public class ServerBase 35 public class ServerBase
34 { 36 {
35 /// <summary> 37 /// <summary>
38 /// Console to be used for any command line output. Can be null, in which case there should be no output.
39 /// </summary>
40 protected ICommandConsole m_console;
41
42 /// <summary>
36 /// Time at which this server was started 43 /// Time at which this server was started
37 /// </summary> 44 /// </summary>
38 protected DateTime m_startuptime; 45 protected DateTime m_startuptime;
@@ -42,6 +49,22 @@ namespace OpenSim.Framework.Servers
42 m_startuptime = DateTime.Now; 49 m_startuptime = DateTime.Now;
43 } 50 }
44 51
52 public virtual void HandleShow(string module, string[] cmd)
53 {
54 List<string> args = new List<string>(cmd);
55
56 args.RemoveAt(0);
57
58 string[] showParams = args.ToArray();
59
60 switch (showParams[0])
61 {
62 case "uptime":
63 Notice(GetUptimeReport());
64 break;
65 }
66 }
67
45 /// <summary> 68 /// <summary>
46 /// Return a report about the uptime of this server 69 /// Return a report about the uptime of this server
47 /// </summary> 70 /// </summary>
@@ -54,5 +77,32 @@ namespace OpenSim.Framework.Servers
54 77
55 return sb.ToString(); 78 return sb.ToString();
56 } 79 }
80
81 /// <summary>
82 /// Console output is only possible if a console has been established.
83 /// That is something that cannot be determined within this class. So
84 /// all attempts to use the console MUST be verified.
85 /// </summary>
86 /// <param name="msg"></param>
87 protected void Notice(string msg)
88 {
89 if (m_console != null)
90 {
91 m_console.Output(msg);
92 }
93 }
94
95 /// <summary>
96 /// Console output is only possible if a console has been established.
97 /// That is something that cannot be determined within this class. So
98 /// all attempts to use the console MUST be verified.
99 /// </summary>
100 /// <param name="format"></param>
101 /// <param name="components"></param>
102 protected void Notice(string format, params string[] components)
103 {
104 if (m_console != null)
105 m_console.OutputFormat(format, components);
106 }
57 } 107 }
58} \ No newline at end of file 108} \ No newline at end of file