aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Base
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-11-22 03:43:21 +0000
committerJustin Clark-Casey (justincc)2012-11-22 03:43:21 +0000
commit74a20a62eee8c565a9410d6896754242eb602abc (patch)
tree9cc7caa394223a8cd0e639e3a2973e4f5217e1af /OpenSim/Server/Base
parentIf an asset POST does not contain well-formed XML, return a 400 (Bad Request)... (diff)
downloadopensim-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.cs27
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;
34using System.Xml; 34using System.Xml;
35using OpenSim.Framework; 35using OpenSim.Framework;
36using OpenSim.Framework.Console; 36using OpenSim.Framework.Console;
37using OpenSim.Framework.Servers;
37using log4net; 38using log4net;
38using log4net.Config; 39using log4net.Config;
39using log4net.Appender; 40using log4net.Appender;
@@ -43,7 +44,7 @@ using Nini.Config;
43 44
44namespace OpenSim.Server.Base 45namespace 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