aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Base/ServicesServerBase.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Server/Base/ServicesServerBase.cs41
1 files changed, 0 insertions, 41 deletions
diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs
index 0cff6ed..b137c05 100644
--- a/OpenSim/Server/Base/ServicesServerBase.cs
+++ b/OpenSim/Server/Base/ServicesServerBase.cs
@@ -26,7 +26,6 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections.Generic;
30using System.IO; 29using System.IO;
31using System.Reflection; 30using System.Reflection;
32using System.Threading; 31using System.Threading;
@@ -72,17 +71,10 @@ namespace OpenSim.Server.Base
72 // 71 //
73 private string m_pidFile = String.Empty; 72 private string m_pidFile = String.Empty;
74 73
75 /// <summary>
76 /// Time at which this server was started
77 /// </summary>
78 protected DateTime m_startuptime;
79
80 // Handle all the automagical stuff 74 // Handle all the automagical stuff
81 // 75 //
82 public ServicesServerBase(string prompt, string[] args) 76 public ServicesServerBase(string prompt, string[] args)
83 { 77 {
84 m_startuptime = DateTime.Now;
85
86 // Save raw arguments 78 // Save raw arguments
87 // 79 //
88 m_Arguments = args; 80 m_Arguments = args;
@@ -258,10 +250,6 @@ namespace OpenSim.Server.Base
258 "command-script <script>", 250 "command-script <script>",
259 "Run a command script from file", HandleScript); 251 "Run a command script from file", HandleScript);
260 252
261 MainConsole.Instance.Commands.AddCommand("General", false, "show uptime",
262 "show uptime",
263 "Show server uptime", HandleShow);
264
265 253
266 // Allow derived classes to perform initialization that 254 // Allow derived classes to perform initialization that
267 // needs to be done after the console has opened 255 // needs to be done after the console has opened
@@ -357,34 +345,5 @@ namespace OpenSim.Server.Base
357 { 345 {
358 } 346 }
359 } 347 }
360
361 public virtual void HandleShow(string module, string[] cmd)
362 {
363 List<string> args = new List<string>(cmd);
364
365 args.RemoveAt(0);
366
367 string[] showParams = args.ToArray();
368
369 switch (showParams[0])
370 {
371 case "uptime":
372 MainConsole.Instance.Output(GetUptimeReport());
373 break;
374 }
375 }
376
377 /// <summary>
378 /// Return a report about the uptime of this server
379 /// </summary>
380 /// <returns></returns>
381 protected string GetUptimeReport()
382 {
383 StringBuilder sb = new StringBuilder(String.Format("Time now is {0}\n", DateTime.Now));
384 sb.Append(String.Format("Server has been running since {0}, {1}\n", m_startuptime.DayOfWeek, m_startuptime));
385 sb.Append(String.Format("That is an elapsed time of {0}\n", DateTime.Now - m_startuptime));
386
387 return sb.ToString();
388 }
389 } 348 }
390} 349}