aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-05-31 20:35:12 +0000
committerJustin Clarke Casey2008-05-31 20:35:12 +0000
commit8cb5ec5fdd21ac3ace385d67145dad8d462ebcb6 (patch)
treec19c5ea998f73ea195542ce3650782baa226e972 /OpenSim
parent* Made UpdateUserCurrentRegion a bit more forgiving. (diff)
downloadopensim-SC-8cb5ec5fdd21ac3ace385d67145dad8d462ebcb6.zip
opensim-SC-8cb5ec5fdd21ac3ace385d67145dad8d462ebcb6.tar.gz
opensim-SC-8cb5ec5fdd21ac3ace385d67145dad8d462ebcb6.tar.bz2
opensim-SC-8cb5ec5fdd21ac3ace385d67145dad8d462ebcb6.tar.xz
* Make version information common to all servers
* Now all servers respond to the "show version" command on the console
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs82
-rw-r--r--OpenSim/Framework/Servers/VersionInfo.cs (renamed from OpenSim/Region/Application/VersionInfo.cs)4
-rw-r--r--OpenSim/Region/Application/Application.cs1
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs71
-rw-r--r--OpenSim/Region/Application/OpenSimMainConsole.cs12
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs2
6 files changed, 89 insertions, 83 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 60c6883..0205e38 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.IO;
29using OpenSim.Framework.Console; 30using OpenSim.Framework.Console;
30using OpenSim.Framework.Statistics; 31using OpenSim.Framework.Statistics;
31 32
@@ -37,7 +38,16 @@ namespace OpenSim.Framework.Servers
37 public abstract class BaseOpenSimServer 38 public abstract class BaseOpenSimServer
38 { 39 {
39 protected ConsoleBase m_console; 40 protected ConsoleBase m_console;
41
42 /// <summary>
43 /// Time at which this server was started
44 /// </summary>
40 protected DateTime m_startuptime; 45 protected DateTime m_startuptime;
46
47 /// <summary>
48 /// Server version information. Usually VersionInfo + information about svn revision, operating system, etc.
49 /// </summary>
50 protected string m_version;
41 51
42 protected BaseHttpServer m_httpServer; 52 protected BaseHttpServer m_httpServer;
43 public BaseHttpServer HttpServer 53 public BaseHttpServer HttpServer
@@ -53,6 +63,11 @@ namespace OpenSim.Framework.Servers
53 public BaseOpenSimServer() 63 public BaseOpenSimServer()
54 { 64 {
55 m_startuptime = DateTime.Now; 65 m_startuptime = DateTime.Now;
66
67 m_version = VersionInfo.Version;
68
69 // FIXME: This should probably occur in a startup method common for all the servers.
70 EnhanceVersionInformation();
56 } 71 }
57 72
58 /// <summary> 73 /// <summary>
@@ -64,6 +79,7 @@ namespace OpenSim.Framework.Servers
64 { 79 {
65 m_console.Close(); 80 m_console.Close();
66 } 81 }
82
67 Environment.Exit(0); 83 Environment.Exit(0);
68 } 84 }
69 85
@@ -120,6 +136,10 @@ namespace OpenSim.Framework.Servers
120 Notice("Server has been running since " + m_startuptime.DayOfWeek + ", " + m_startuptime.ToString()); 136 Notice("Server has been running since " + m_startuptime.DayOfWeek + ", " + m_startuptime.ToString());
121 Notice("That is an elapsed time of " + (DateTime.Now - m_startuptime).ToString()); 137 Notice("That is an elapsed time of " + (DateTime.Now - m_startuptime).ToString());
122 break; 138 break;
139
140 case "version":
141 m_console.Notice("This is " + m_version);
142 break;
123 } 143 }
124 } 144 }
125 145
@@ -136,5 +156,67 @@ namespace OpenSim.Framework.Servers
136 } 156 }
137 } 157 }
138 158
159 /// <summary>
160 /// Enhance the version string with extra information if it's available.
161 /// </summary>
162 protected void EnhanceVersionInformation()
163 {
164 string buildVersion = string.Empty;
165
166 // Add subversion revision information if available
167 // FIXME: Making an assumption about the directory we're currently in - we do this all over the place
168 // elsewhere as well
169 string svnFileName = "../.svn/entries";
170 string inputLine;
171 int strcmp;
172
173 if (File.Exists(svnFileName))
174 {
175 StreamReader EntriesFile = File.OpenText(svnFileName);
176 inputLine = EntriesFile.ReadLine();
177 while (inputLine != null)
178 {
179 // using the dir svn revision at the top of entries file
180 strcmp = String.Compare(inputLine, "dir");
181 if (strcmp == 0)
182 {
183 buildVersion = EntriesFile.ReadLine();
184 break;
185 }
186 else
187 {
188 inputLine = EntriesFile.ReadLine();
189 }
190 }
191 EntriesFile.Close();
192 }
193
194 if (!string.IsNullOrEmpty(buildVersion))
195 {
196 m_version += ", SVN build r" + buildVersion;
197 }
198 else
199 {
200 m_version += ", SVN build revision not available";
201 }
202
203 // Add operating system information if available
204 string OSString = "";
205
206 if (System.Environment.OSVersion.Platform != PlatformID.Unix)
207 {
208 OSString = System.Environment.OSVersion.ToString();
209 }
210 else
211 {
212 OSString = Util.ReadEtcIssue();
213 }
214 if (OSString.Length > 45)
215 {
216 OSString = OSString.Substring(0, 45);
217 }
218
219 m_version += ", OS " + OSString;
220 }
139 } 221 }
140} 222}
diff --git a/OpenSim/Region/Application/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs
index 5e291f1..5bd78e7 100644
--- a/OpenSim/Region/Application/VersionInfo.cs
+++ b/OpenSim/Framework/Servers/VersionInfo.cs
@@ -28,10 +28,10 @@
28namespace OpenSim 28namespace OpenSim
29{ 29{
30 /// <summary> 30 /// <summary>
31 /// Exists purely to hold version information. 31 /// This is the OpenSim version string. Change this if you are releasing a new OpenSim version.
32 /// </summary> 32 /// </summary>
33 public class VersionInfo 33 public class VersionInfo
34 { 34 {
35 public static string Version = "trunk (post 0.5.7)"; 35 public readonly static string Version = "OpenSimulator trunk (post 0.5.7)";
36 } 36 }
37} 37}
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
index b2c710a..9aa885f 100644
--- a/OpenSim/Region/Application/Application.cs
+++ b/OpenSim/Region/Application/Application.cs
@@ -98,6 +98,7 @@ namespace OpenSim
98 } 98 }
99 99
100 private static bool _IsHandlingException = false; // Make sure we don't go recursive on ourself 100 private static bool _IsHandlingException = false; // Make sure we don't go recursive on ourself
101
101 /// <summary> 102 /// <summary>
102 /// Global exception handler -- all unhandlet exceptions end up here :) 103 /// Global exception handler -- all unhandlet exceptions end up here :)
103 /// </summary> 104 /// </summary>
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index d790e41..03dbf78 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -54,11 +54,6 @@ namespace OpenSim
54 { 54 {
55 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 55 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
56 56
57 /// <summary>
58 /// Holds a human readable build version for this server.
59 /// </summary>
60 protected string buildVersion;
61
62 protected string proxyUrl; 57 protected string proxyUrl;
63 protected int proxyOffset = 0; 58 protected int proxyOffset = 0;
64 59
@@ -359,72 +354,11 @@ namespace OpenSim
359 } 354 }
360 355
361 /// <summary> 356 /// <summary>
362 /// Enhance the version string with extra information if it's available.
363 /// </summary>
364 protected void EnhanceVersionInformation()
365 {
366 // Add subversion revision information if available
367 string svnFileName = "../.svn/entries";
368 string inputLine;
369 int strcmp;
370
371 if (File.Exists(svnFileName))
372 {
373 StreamReader EntriesFile = File.OpenText(svnFileName);
374 inputLine = EntriesFile.ReadLine();
375 while (inputLine != null)
376 {
377 // using the dir svn revision at the top of entries file
378 strcmp = String.Compare(inputLine, "dir");
379 if (strcmp == 0)
380 {
381 buildVersion = EntriesFile.ReadLine();
382 break;
383 }
384 else
385 {
386 inputLine = EntriesFile.ReadLine();
387 }
388 }
389 EntriesFile.Close();
390 }
391
392 if (!string.IsNullOrEmpty(buildVersion))
393 {
394 VersionInfo.Version += ", SVN build r" + buildVersion;
395 }
396 else
397 {
398 VersionInfo.Version += ", SVN build revision not available";
399 }
400
401 // Add operating system information if available
402 string OSString = "";
403
404 if (System.Environment.OSVersion.Platform != PlatformID.Unix)
405 {
406 OSString = System.Environment.OSVersion.ToString();
407 }
408 else
409 {
410 OSString = Util.ReadEtcIssue();
411 }
412 if (OSString.Length > 45)
413 {
414 OSString = OSString.Substring(0, 45);
415 }
416
417 VersionInfo.Version += ", OS " + OSString;
418 }
419
420 /// <summary>
421 /// Performs initialisation of the scene, such as loading configuration from disk. 357 /// Performs initialisation of the scene, such as loading configuration from disk.
422 /// </summary> 358 /// </summary>
423 protected void InternalStartUp() 359 protected void InternalStartUp()
424 { 360 {
425 EnhanceVersionInformation(); 361 m_log.Info("[STARTUP]: Version " + m_version + "\n");
426
427 m_log.Info("[STARTUP]: OpenSim version: " + VersionInfo.Version + "\n");
428 362
429 m_stats = StatsManager.StartCollectingSimExtraStats(); 363 m_stats = StatsManager.StartCollectingSimExtraStats();
430 364
@@ -658,13 +592,14 @@ namespace OpenSim
658 new Scene(regionInfo, circuitManager, m_commsManager, sceneGridService, m_assetCache, 592 new Scene(regionInfo, circuitManager, m_commsManager, sceneGridService, m_assetCache,
659 storageManager, m_httpServer, 593 storageManager, m_httpServer,
660 m_moduleLoader, m_dumpAssetsToFile, m_physicalPrim, m_see_into_region_from_neighbor, m_config, 594 m_moduleLoader, m_dumpAssetsToFile, m_physicalPrim, m_see_into_region_from_neighbor, m_config,
661 VersionInfo.Version); 595 m_version);
662 596
663 } 597 }
664 598
665 public void handleRestartRegion(RegionInfo whichRegion) 599 public void handleRestartRegion(RegionInfo whichRegion)
666 { 600 {
667 m_log.Error("[OPENSIM MAIN]: Got restart signal from SceneManager"); 601 m_log.Error("[OPENSIM MAIN]: Got restart signal from SceneManager");
602
668 // Shutting down the client server 603 // Shutting down the client server
669 bool foundClientServer = false; 604 bool foundClientServer = false;
670 int clientServerElement = 0; 605 int clientServerElement = 0;
diff --git a/OpenSim/Region/Application/OpenSimMainConsole.cs b/OpenSim/Region/Application/OpenSimMainConsole.cs
index 7b1b477..467db14 100644
--- a/OpenSim/Region/Application/OpenSimMainConsole.cs
+++ b/OpenSim/Region/Application/OpenSimMainConsole.cs
@@ -253,7 +253,6 @@ namespace OpenSim
253 m_console.Notice("show assets - show state of asset cache."); 253 m_console.Notice("show assets - show state of asset cache.");
254 m_console.Notice("show users - show info about connected users."); 254 m_console.Notice("show users - show info about connected users.");
255 m_console.Notice("show modules - shows info about loaded modules."); 255 m_console.Notice("show modules - shows info about loaded modules.");
256 m_console.Notice("show version - show the running build version.");
257 m_console.Notice("show regions - show running region information."); 256 m_console.Notice("show regions - show running region information.");
258 m_console.Notice("threads - list threads"); 257 m_console.Notice("threads - list threads");
259 m_console.Notice("config set section field value - set a config value"); 258 m_console.Notice("config set section field value - set a config value");
@@ -661,17 +660,6 @@ namespace OpenSim
661 scene.RegionInfo.RegionLocY); 660 scene.RegionInfo.RegionLocY);
662 }); 661 });
663 break; 662 break;
664
665 case "version":
666 if (!string.IsNullOrEmpty(buildVersion))
667 {
668 m_console.Notice("The build version is: r" + buildVersion);
669 }
670 else
671 {
672 m_console.Notice("The build version is not available");
673 }
674 break;
675 } 663 }
676 } 664 }
677 665
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 6a912e5..8b5ecb7 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -366,7 +366,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
366 { 366 {
367 m_moneyBalance = 1000; 367 m_moneyBalance = 1000;
368 368
369 m_channelVersion = Helpers.StringToField("OpenSimulator Server " + scene.GetSimulatorVersion()); 369 m_channelVersion = Helpers.StringToField(scene.GetSimulatorVersion());
370 370
371 InitDefaultAnimations(); 371 InitDefaultAnimations();
372 372