aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/BaseOpenSimServer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Servers/BaseOpenSimServer.cs')
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs47
1 files changed, 45 insertions, 2 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index d04dbd7..3016715 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -28,16 +28,59 @@
28 28
29using System; 29using System;
30 30
31using OpenSim.Framework.Console;
32
31namespace OpenSim.Framework.Servers 33namespace OpenSim.Framework.Servers
32{ 34{
33 /// <summary> 35 /// <summary>
34 /// Common base for the main OpenSimServers (user, grid, inventory, region, etc) 36 /// Common base for the main OpenSimServers (user, grid, inventory, region, etc)
35 /// XXX Not yet implemented, may not grow up for some time
36 /// </summary> 37 /// </summary>
37 public class BaseOpenSimServer 38 public abstract class BaseOpenSimServer
38 { 39 {
40 protected LogBase m_log;
41
42 protected DateTime m_startuptime;
43
39 public BaseOpenSimServer() 44 public BaseOpenSimServer()
40 { 45 {
46 m_startuptime = DateTime.Now;
47 }
48
49 /// <summary>
50 /// Runs commands issued by the server console from the operator
51 /// </summary>
52 /// <param name="command">The first argument of the parameter (the command)</param>
53 /// <param name="cmdparams">Additional arguments passed to the command</param>
54 public virtual void RunCmd(string command, string[] cmdparams)
55 {
56 switch (command)
57 {
58 case "help":
59 m_log.Notice("show uptime - show server startup and uptime.");
60 break;
61
62 case "show":
63 if (cmdparams.Length > 0)
64 {
65 Show(cmdparams[0]);
66 }
67 break;
68 }
69 }
70
71 /// <summary>
72 /// Outputs to the console information about the region
73 /// </summary>
74 /// <param name="ShowWhat">What information to display (valid arguments are "uptime", "users")</param>
75 public virtual void Show(string ShowWhat)
76 {
77 switch (ShowWhat)
78 {
79 case "uptime":
80 m_log.Notice("Server has been running since " + m_startuptime.ToString());
81 m_log.Notice("That is " + (DateTime.Now - m_startuptime).ToString());
82 break;
83 }
41 } 84 }
42 } 85 }
43} 86}