* 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
0.6.1-post-fixes
Justin Clarke Casey 2008-11-11 17:02:46 +00:00
parent 851b72570a
commit 97816f8c90
7 changed files with 83 additions and 29 deletions

View File

@ -428,25 +428,6 @@ namespace OpenSim.Framework.Servers
}
m_version += string.IsNullOrEmpty(buildVersion) ? " " : ("." + buildVersion + " ").Substring(0, 6);
// Add operating system information if available
string OSString = "";
if (System.Environment.OSVersion.Platform != PlatformID.Unix)
{
OSString = System.Environment.OSVersion.ToString();
}
else
{
OSString = Util.ReadEtcIssue();
}
if (OSString.Length > 45)
{
OSString = OSString.Substring(0, 45);
}
m_version += " (OS " + OSString + ")";
}
}
}

View File

@ -27,11 +27,27 @@
namespace OpenSim
{
/// <summary>
/// This is the OpenSim version string. Change this if you are releasing a new OpenSim version.
/// </summary>
public class VersionInfo
{
/// <value>
/// This is the OpenSim version string. Change this if you are releasing a new OpenSim version.
/// </value>
public readonly static string Version = "OpenSimulator Server 0.6.0"; // stay with 27 chars (used in regioninfo)
/// <value>
/// This is the external interface version. It is separate from the OpenSimulator project version.
///
/// This version number should be
/// increased by 1 every time a code change makes the previous OpenSimulator revision incompatible
/// with the new revision. This will usually be due to interregion or grid facing interface changes.
///
/// Changes which are compatible with an older revision (e.g. older revisions experience degraded functionality
/// but not outright failure) do not need a version number increment.
///
/// Having this version number allows the grid service to reject connections from regions running a version
/// of the code that is too old.
///
/// </value>
public readonly static int MajorInterfaceVersion = 0;
}
}

View File

@ -800,6 +800,33 @@ namespace OpenSim.Framework
y += ry;
}
/// <summary>
/// Get operating system information if available. Returns only the first 45 characters of information
/// </summary>
/// <returns>
/// Operating system information. Returns an empty string if none was available.
/// </returns>
public static string GetOperatingSystemInformation()
{
string os = String.Empty;
if (System.Environment.OSVersion.Platform != PlatformID.Unix)
{
os = System.Environment.OSVersion.ToString();
}
else
{
os = ReadEtcIssue();
}
if (os.Length > 45)
{
os = os.Substring(0, 45);
}
return os;
}
/// <summary>
/// Is the given string a UUID?
/// </summary>

View File

@ -54,6 +54,22 @@ namespace OpenSim.Grid.GridServer
public GridConfig Config;
/// <value>
/// Used to notify old regions as to which OpenSim version to upgrade to
/// </value>
private string m_opensimVersion;
/// <summary>
/// Constructor
/// </summary>
/// <param name="opensimVersion">
/// Used to notify old regions as to which OpenSim version to upgrade to
/// </param>
public GridManager(string opensimVersion)
{
m_opensimVersion = opensimVersion;
}
/// <summary>
/// Adds a new grid server plugin - grid servers will be requested in the order they were loaded.
/// </summary>
@ -360,7 +376,7 @@ namespace OpenSim.Grid.GridServer
if (!requestData.ContainsKey("UUID") || !UUID.TryParse((string)requestData["UUID"], out uuid))
{
m_log.Warn("[LOGIN PRELUDE]: Region connected without a UUID, sending back error response.");
m_log.Debug("[LOGIN PRELUDE]: Region connected without a UUID, sending back error response.");
return ErrorResponse("No UUID passed to grid server - unable to connect you");
}
@ -370,20 +386,32 @@ namespace OpenSim.Grid.GridServer
}
catch (FormatException e)
{
m_log.Warn("[LOGIN PRELUDE]: Invalid login parameters, sending back error response.");
m_log.Debug("[LOGIN PRELUDE]: Invalid login parameters, sending back error response.");
return ErrorResponse("Wrong format in login parameters. Please verify parameters." + e.ToString());
}
m_log.InfoFormat("[LOGIN BEGIN]: Received login request from simulator: {0}", sim.regionName);
if (!Config.AllowRegionRegistration)
{
m_log.InfoFormat(
m_log.DebugFormat(
"[LOGIN END]: Disabled region registration blocked login request from simulator: {0}",
sim.regionName);
return ErrorResponse("The grid is currently not accepting region registrations.");
return ErrorResponse("This grid is currently not accepting region registrations.");
}
m_log.InfoFormat("[LOGIN BEGIN]: Received login request from simulator: {0}", sim.regionName);
int majorInterfaceVersion = 0;
if (requestData.ContainsKey("major_interface_version"))
int.TryParse((string)requestData["major_interface_version"], out majorInterfaceVersion);
if (majorInterfaceVersion != VersionInfo.MajorInterfaceVersion)
{
return ErrorResponse(
String.Format(
"Your region is the wrong version to connect to this grid. Try changing to version {0} (interface version {1})",
m_opensimVersion, VersionInfo.MajorInterfaceVersion));
}
existingSim = GetRegion(sim.regionHandle);

View File

@ -153,7 +153,7 @@ namespace OpenSim.Grid.GridServer
protected virtual void SetupGridManager()
{
m_log.Info("[DATA]: Connecting to Storage Server");
m_gridManager = new GridManager();
m_gridManager = new GridManager(m_version);
m_gridManager.AddPlugin(m_config.DatabaseProvider, m_config.DatabaseConnect);
m_gridManager.Config = m_config;
}

View File

@ -130,6 +130,7 @@ namespace OpenSim.Region.Communications.OGS1
GridParams["originUUID"] = regionInfo.originRegionID.ToString();
GridParams["server_uri"] = regionInfo.ServerURI;
GridParams["region_secret"] = regionInfo.regionSecret;
GridParams["major_interface_version"] = VersionInfo.MajorInterfaceVersion.ToString();
if (regionInfo.MasterAvatarAssignedUUID != UUID.Zero)
GridParams["master_avatar_uuid"] = regionInfo.MasterAvatarAssignedUUID.ToString();

View File

@ -319,6 +319,7 @@ namespace OpenSim.Region.Environment.Scenes
m_statsReporter.SetObjectCapacity(objectCapacity);
m_simulatorVersion = simulatorVersion
+ " (OS " + Util.GetOperatingSystemInformation() + ")"
+ " ChilTasks:" + m_seeIntoRegionFromNeighbor.ToString()
+ " PhysPrim:" + m_physicalPrim.ToString();