diff options
author | Justin Clark-Casey (justincc) | 2012-11-22 03:43:21 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-11-22 03:43:21 +0000 |
commit | 74a20a62eee8c565a9410d6896754242eb602abc (patch) | |
tree | 9cc7caa394223a8cd0e639e3a2973e4f5217e1af /OpenSim/Server/Base | |
parent | If an asset POST does not contain well-formed XML, return a 400 (Bad Request)... (diff) | |
download | opensim-SC-74a20a62eee8c565a9410d6896754242eb602abc.zip opensim-SC-74a20a62eee8c565a9410d6896754242eb602abc.tar.gz opensim-SC-74a20a62eee8c565a9410d6896754242eb602abc.tar.bz2 opensim-SC-74a20a62eee8c565a9410d6896754242eb602abc.tar.xz |
refactor: Factor out copy/pasted server uptime report code
Diffstat (limited to 'OpenSim/Server/Base')
-rw-r--r-- | OpenSim/Server/Base/ServicesServerBase.cs | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs index 0cff6ed..56bb7ae 100644 --- a/OpenSim/Server/Base/ServicesServerBase.cs +++ b/OpenSim/Server/Base/ServicesServerBase.cs | |||
@@ -34,6 +34,7 @@ using System.Text; | |||
34 | using System.Xml; | 34 | using System.Xml; |
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Console; | 36 | using OpenSim.Framework.Console; |
37 | using OpenSim.Framework.Servers; | ||
37 | using log4net; | 38 | using log4net; |
38 | using log4net.Config; | 39 | using log4net.Config; |
39 | using log4net.Appender; | 40 | using log4net.Appender; |
@@ -43,7 +44,7 @@ using Nini.Config; | |||
43 | 44 | ||
44 | namespace OpenSim.Server.Base | 45 | namespace OpenSim.Server.Base |
45 | { | 46 | { |
46 | public class ServicesServerBase | 47 | public class ServicesServerBase : ServerBase |
47 | { | 48 | { |
48 | // Logger | 49 | // Logger |
49 | // | 50 | // |
@@ -72,17 +73,10 @@ namespace OpenSim.Server.Base | |||
72 | // | 73 | // |
73 | private string m_pidFile = String.Empty; | 74 | private string m_pidFile = String.Empty; |
74 | 75 | ||
75 | /// <summary> | ||
76 | /// Time at which this server was started | ||
77 | /// </summary> | ||
78 | protected DateTime m_startuptime; | ||
79 | |||
80 | // Handle all the automagical stuff | 76 | // Handle all the automagical stuff |
81 | // | 77 | // |
82 | public ServicesServerBase(string prompt, string[] args) | 78 | public ServicesServerBase(string prompt, string[] args) : base() |
83 | { | 79 | { |
84 | m_startuptime = DateTime.Now; | ||
85 | |||
86 | // Save raw arguments | 80 | // Save raw arguments |
87 | // | 81 | // |
88 | m_Arguments = args; | 82 | m_Arguments = args; |
@@ -373,18 +367,5 @@ namespace OpenSim.Server.Base | |||
373 | break; | 367 | break; |
374 | } | 368 | } |
375 | } | 369 | } |
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 | } | 370 | } |
390 | } | 371 | } \ No newline at end of file |