diff options
Diffstat (limited to 'OpenSim/Framework/Servers')
-rw-r--r-- | OpenSim/Framework/Servers/BaseOpenSimServer.cs | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index af25ef4..b8ad83a 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -54,7 +54,10 @@ namespace OpenSim.Framework.Servers | |||
54 | /// </summary> | 54 | /// </summary> |
55 | public virtual void Shutdown() | 55 | public virtual void Shutdown() |
56 | { | 56 | { |
57 | m_console.Close(); | 57 | if(m_console != null) |
58 | { | ||
59 | m_console.Close(); | ||
60 | } | ||
58 | Environment.Exit(0); | 61 | Environment.Exit(0); |
59 | } | 62 | } |
60 | 63 | ||
@@ -68,9 +71,9 @@ namespace OpenSim.Framework.Servers | |||
68 | switch (command) | 71 | switch (command) |
69 | { | 72 | { |
70 | case "help": | 73 | case "help": |
71 | m_console.Notice("quit - equivalent to shutdown."); | 74 | Notice("quit - equivalent to shutdown."); |
72 | m_console.Notice("show uptime - show server startup and uptime."); | 75 | Notice("show uptime - show server startup and uptime."); |
73 | m_console.Notice("shutdown - shutdown the server.\n"); | 76 | Notice("shutdown - shutdown the server.\n"); |
74 | break; | 77 | break; |
75 | 78 | ||
76 | case "show": | 79 | case "show": |
@@ -96,10 +99,24 @@ namespace OpenSim.Framework.Servers | |||
96 | switch (ShowWhat) | 99 | switch (ShowWhat) |
97 | { | 100 | { |
98 | case "uptime": | 101 | case "uptime": |
99 | m_console.Notice("Server has been running since " + m_startuptime.ToString()); | 102 | Notice("Server has been running since " + m_startuptime.DayOfWeek + ", " + m_startuptime.ToString()); |
100 | m_console.Notice("That is " + (DateTime.Now - m_startuptime).ToString()); | 103 | Notice("That is an elapsed time of " + (DateTime.Now - m_startuptime).ToString()); |
101 | break; | 104 | break; |
102 | } | 105 | } |
103 | } | 106 | } |
107 | |||
108 | /// <summary> | ||
109 | /// Console output is only possible if a console has been established. | ||
110 | /// That is something that cannot be determined within this class. So | ||
111 | /// all attempts to use the console MUST be verified. | ||
112 | /// </summary> | ||
113 | private void Notice(string msg) | ||
114 | { | ||
115 | if(m_console != null) | ||
116 | { | ||
117 | m_console.Notice(msg); | ||
118 | } | ||
119 | } | ||
120 | |||
104 | } | 121 | } |
105 | } | 122 | } |