aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-11-11 17:02:46 +0000
committerJustin Clarke Casey2008-11-11 17:02:46 +0000
commit97816f8c901bf56e3b29bdbd5f8e320de352f45f (patch)
tree30fdd6962a11fda115da1b2cb8340a4d64b763b1
parentMantis#2604. Thank you kindly, Diva for a patch that: (diff)
downloadopensim-SC-97816f8c901bf56e3b29bdbd5f8e320de352f45f.zip
opensim-SC-97816f8c901bf56e3b29bdbd5f8e320de352f45f.tar.gz
opensim-SC-97816f8c901bf56e3b29bdbd5f8e320de352f45f.tar.bz2
opensim-SC-97816f8c901bf56e3b29bdbd5f8e320de352f45f.tar.xz
* Implement basic region filtering as described in https://lists.berlios.de/pipermail/opensim-dev/2008-November/003468.html
* This is done by sending a 'major interface version' number on sim registration. Developers must increment this every time they make a change that would make the previous OpenSim revision failure incompatible with the new one (non-fatal incompatibilities are fine). * This number resides in OpenSim.Framework.Servers.VersionInfo.MajorInterfaceVersion * This allows the grid service to stop older, incompatible regions from connecting
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs19
-rw-r--r--OpenSim/Framework/Servers/VersionInfo.cs22
-rw-r--r--OpenSim/Framework/Util.cs27
-rw-r--r--OpenSim/Grid/GridServer/GridManager.cs40
-rw-r--r--OpenSim/Grid/GridServer/GridServerBase.cs2
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs1
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs1
7 files changed, 83 insertions, 29 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 36f8d2e..aa93f6e 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -428,25 +428,6 @@ namespace OpenSim.Framework.Servers
428 } 428 }
429 429
430 m_version += string.IsNullOrEmpty(buildVersion) ? " " : ("." + buildVersion + " ").Substring(0, 6); 430 m_version += string.IsNullOrEmpty(buildVersion) ? " " : ("." + buildVersion + " ").Substring(0, 6);
431
432 // Add operating system information if available
433 string OSString = "";
434
435 if (System.Environment.OSVersion.Platform != PlatformID.Unix)
436 {
437 OSString = System.Environment.OSVersion.ToString();
438 }
439 else
440 {
441 OSString = Util.ReadEtcIssue();
442 }
443
444 if (OSString.Length > 45)
445 {
446 OSString = OSString.Substring(0, 45);
447 }
448
449 m_version += " (OS " + OSString + ")";
450 } 431 }
451 } 432 }
452} 433}
diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs
index 8f84859..c6a43ec 100644
--- a/OpenSim/Framework/Servers/VersionInfo.cs
+++ b/OpenSim/Framework/Servers/VersionInfo.cs
@@ -27,11 +27,27 @@
27 27
28namespace OpenSim 28namespace OpenSim
29{ 29{
30 /// <summary>
31 /// This is the OpenSim version string. Change this if you are releasing a new OpenSim version.
32 /// </summary>
33 public class VersionInfo 30 public class VersionInfo
34 { 31 {
32 /// <value>
33 /// This is the OpenSim version string. Change this if you are releasing a new OpenSim version.
34 /// </value>
35 public readonly static string Version = "OpenSimulator Server 0.6.0"; // stay with 27 chars (used in regioninfo) 35 public readonly static string Version = "OpenSimulator Server 0.6.0"; // stay with 27 chars (used in regioninfo)
36
37 /// <value>
38 /// This is the external interface version. It is separate from the OpenSimulator project version.
39 ///
40 /// This version number should be
41 /// increased by 1 every time a code change makes the previous OpenSimulator revision incompatible
42 /// with the new revision. This will usually be due to interregion or grid facing interface changes.
43 ///
44 /// Changes which are compatible with an older revision (e.g. older revisions experience degraded functionality
45 /// but not outright failure) do not need a version number increment.
46 ///
47 /// Having this version number allows the grid service to reject connections from regions running a version
48 /// of the code that is too old.
49 ///
50 /// </value>
51 public readonly static int MajorInterfaceVersion = 0;
36 } 52 }
37} 53}
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 7caa414..f72797f 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -799,6 +799,33 @@ namespace OpenSim.Framework
799 x += rx; 799 x += rx;
800 y += ry; 800 y += ry;
801 } 801 }
802
803 /// <summary>
804 /// Get operating system information if available. Returns only the first 45 characters of information
805 /// </summary>
806 /// <returns>
807 /// Operating system information. Returns an empty string if none was available.
808 /// </returns>
809 public static string GetOperatingSystemInformation()
810 {
811 string os = String.Empty;
812
813 if (System.Environment.OSVersion.Platform != PlatformID.Unix)
814 {
815 os = System.Environment.OSVersion.ToString();
816 }
817 else
818 {
819 os = ReadEtcIssue();
820 }
821
822 if (os.Length > 45)
823 {
824 os = os.Substring(0, 45);
825 }
826
827 return os;
828 }
802 829
803 /// <summary> 830 /// <summary>
804 /// Is the given string a UUID? 831 /// Is the given string a UUID?
diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs
index 0fc2147..32b7554 100644
--- a/OpenSim/Grid/GridServer/GridManager.cs
+++ b/OpenSim/Grid/GridServer/GridManager.cs
@@ -53,6 +53,22 @@ namespace OpenSim.Grid.GridServer
53 private List<MessageServerInfo> _MessageServers = new List<MessageServerInfo>(); 53 private List<MessageServerInfo> _MessageServers = new List<MessageServerInfo>();
54 54
55 public GridConfig Config; 55 public GridConfig Config;
56
57 /// <value>
58 /// Used to notify old regions as to which OpenSim version to upgrade to
59 /// </value>
60 private string m_opensimVersion;
61
62 /// <summary>
63 /// Constructor
64 /// </summary>
65 /// <param name="opensimVersion">
66 /// Used to notify old regions as to which OpenSim version to upgrade to
67 /// </param>
68 public GridManager(string opensimVersion)
69 {
70 m_opensimVersion = opensimVersion;
71 }
56 72
57 /// <summary> 73 /// <summary>
58 /// Adds a new grid server plugin - grid servers will be requested in the order they were loaded. 74 /// Adds a new grid server plugin - grid servers will be requested in the order they were loaded.
@@ -360,7 +376,7 @@ namespace OpenSim.Grid.GridServer
360 376
361 if (!requestData.ContainsKey("UUID") || !UUID.TryParse((string)requestData["UUID"], out uuid)) 377 if (!requestData.ContainsKey("UUID") || !UUID.TryParse((string)requestData["UUID"], out uuid))
362 { 378 {
363 m_log.Warn("[LOGIN PRELUDE]: Region connected without a UUID, sending back error response."); 379 m_log.Debug("[LOGIN PRELUDE]: Region connected without a UUID, sending back error response.");
364 return ErrorResponse("No UUID passed to grid server - unable to connect you"); 380 return ErrorResponse("No UUID passed to grid server - unable to connect you");
365 } 381 }
366 382
@@ -370,21 +386,33 @@ namespace OpenSim.Grid.GridServer
370 } 386 }
371 catch (FormatException e) 387 catch (FormatException e)
372 { 388 {
373 m_log.Warn("[LOGIN PRELUDE]: Invalid login parameters, sending back error response."); 389 m_log.Debug("[LOGIN PRELUDE]: Invalid login parameters, sending back error response.");
374 return ErrorResponse("Wrong format in login parameters. Please verify parameters." + e.ToString()); 390 return ErrorResponse("Wrong format in login parameters. Please verify parameters." + e.ToString());
375 } 391 }
392
393 m_log.InfoFormat("[LOGIN BEGIN]: Received login request from simulator: {0}", sim.regionName);
376 394
377 if (!Config.AllowRegionRegistration) 395 if (!Config.AllowRegionRegistration)
378 { 396 {
379 m_log.InfoFormat( 397 m_log.DebugFormat(
380 "[LOGIN END]: Disabled region registration blocked login request from simulator: {0}", 398 "[LOGIN END]: Disabled region registration blocked login request from simulator: {0}",
381 sim.regionName); 399 sim.regionName);
382 400
383 return ErrorResponse("The grid is currently not accepting region registrations."); 401 return ErrorResponse("This grid is currently not accepting region registrations.");
402 }
403
404 int majorInterfaceVersion = 0;
405 if (requestData.ContainsKey("major_interface_version"))
406 int.TryParse((string)requestData["major_interface_version"], out majorInterfaceVersion);
407
408 if (majorInterfaceVersion != VersionInfo.MajorInterfaceVersion)
409 {
410 return ErrorResponse(
411 String.Format(
412 "Your region is the wrong version to connect to this grid. Try changing to version {0} (interface version {1})",
413 m_opensimVersion, VersionInfo.MajorInterfaceVersion));
384 } 414 }
385 415
386 m_log.InfoFormat("[LOGIN BEGIN]: Received login request from simulator: {0}", sim.regionName);
387
388 existingSim = GetRegion(sim.regionHandle); 416 existingSim = GetRegion(sim.regionHandle);
389 417
390 if (existingSim == null || existingSim.UUID == sim.UUID || sim.UUID != sim.originUUID) 418 if (existingSim == null || existingSim.UUID == sim.UUID || sim.UUID != sim.originUUID)
diff --git a/OpenSim/Grid/GridServer/GridServerBase.cs b/OpenSim/Grid/GridServer/GridServerBase.cs
index 36ea238..9652765 100644
--- a/OpenSim/Grid/GridServer/GridServerBase.cs
+++ b/OpenSim/Grid/GridServer/GridServerBase.cs
@@ -153,7 +153,7 @@ namespace OpenSim.Grid.GridServer
153 protected virtual void SetupGridManager() 153 protected virtual void SetupGridManager()
154 { 154 {
155 m_log.Info("[DATA]: Connecting to Storage Server"); 155 m_log.Info("[DATA]: Connecting to Storage Server");
156 m_gridManager = new GridManager(); 156 m_gridManager = new GridManager(m_version);
157 m_gridManager.AddPlugin(m_config.DatabaseProvider, m_config.DatabaseConnect); 157 m_gridManager.AddPlugin(m_config.DatabaseProvider, m_config.DatabaseConnect);
158 m_gridManager.Config = m_config; 158 m_gridManager.Config = m_config;
159 } 159 }
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index a4fa3bb..0c13120 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -130,6 +130,7 @@ namespace OpenSim.Region.Communications.OGS1
130 GridParams["originUUID"] = regionInfo.originRegionID.ToString(); 130 GridParams["originUUID"] = regionInfo.originRegionID.ToString();
131 GridParams["server_uri"] = regionInfo.ServerURI; 131 GridParams["server_uri"] = regionInfo.ServerURI;
132 GridParams["region_secret"] = regionInfo.regionSecret; 132 GridParams["region_secret"] = regionInfo.regionSecret;
133 GridParams["major_interface_version"] = VersionInfo.MajorInterfaceVersion.ToString();
133 134
134 if (regionInfo.MasterAvatarAssignedUUID != UUID.Zero) 135 if (regionInfo.MasterAvatarAssignedUUID != UUID.Zero)
135 GridParams["master_avatar_uuid"] = regionInfo.MasterAvatarAssignedUUID.ToString(); 136 GridParams["master_avatar_uuid"] = regionInfo.MasterAvatarAssignedUUID.ToString();
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 68fac59..fd4eb58 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -319,6 +319,7 @@ namespace OpenSim.Region.Environment.Scenes
319 m_statsReporter.SetObjectCapacity(objectCapacity); 319 m_statsReporter.SetObjectCapacity(objectCapacity);
320 320
321 m_simulatorVersion = simulatorVersion 321 m_simulatorVersion = simulatorVersion
322 + " (OS " + Util.GetOperatingSystemInformation() + ")"
322 + " ChilTasks:" + m_seeIntoRegionFromNeighbor.ToString() 323 + " ChilTasks:" + m_seeIntoRegionFromNeighbor.ToString()
323 + " PhysPrim:" + m_physicalPrim.ToString(); 324 + " PhysPrim:" + m_physicalPrim.ToString();
324 325