Testing stage of the new versioning system. Use at own risk. May not

work. Will eat your babies. Yada. Yada.
avinationmerge
Melanie Thielker 2015-10-31 00:01:35 +01:00
parent 8b1ae501b5
commit dc6d9eadf3
12 changed files with 161 additions and 79 deletions

View File

@ -873,8 +873,8 @@ namespace OpenSim.Framework.Servers
protected string GetVersionText() protected string GetVersionText()
{ {
return String.Format("Version: {0} (interface version {1}, SIMULATION/{2})", return String.Format("Version: {0} (SIMULATION/{1} - SIMULATION/{2})",
m_version, VersionInfo.MajorInterfaceVersion, VersionInfo.SimulationServiceVersion); m_version, VersionInfo.SimulationServiceVersionSupportedMin, VersionInfo.SimulationServiceVersionSupportedMax);
} }
/// <summary> /// <summary>
@ -1045,4 +1045,4 @@ namespace OpenSim.Framework.Servers
/// </summary> /// </summary>
protected virtual void ShutdownSpecific() {} protected virtual void ShutdownSpecific() {}
} }
} }

View File

@ -61,7 +61,9 @@ namespace OpenSim
/// This is the external interface version. It is separate from the OpenSimulator project version. /// This is the external interface version. It is separate from the OpenSimulator project version.
/// ///
/// </value> /// </value>
public readonly static int MajorInterfaceVersion = 8; /// Commented because it's not used anymore, see below for new
/// versioning method.
//public readonly static int MajorInterfaceVersion = 8;
/// <summary> /// <summary>
/// This rules versioning regarding teleports, and compatibility between simulators in that regard. /// This rules versioning regarding teleports, and compatibility between simulators in that regard.
@ -80,6 +82,9 @@ namespace OpenSim
/// "SIMULATION/0.1" /// "SIMULATION/0.1"
/// - this is an older teleport protocol used in OpenSimulator 0.7.5 and before. /// - this is an older teleport protocol used in OpenSimulator 0.7.5 and before.
/// </remarks> /// </remarks>
public readonly static float SimulationServiceVersion = 0.3f; public readonly static float SimulationServiceVersionAcceptedMin = 0.3f;
public readonly static float SimulationServiceVersionAcceptedMax = 0.4f;
public readonly static float SimulationServiceVersionSupportedMin = 0.3f;
public readonly static float SimulationServiceVersionSupportedMax = 0.4f;
} }
} }

View File

@ -57,13 +57,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
public const int DefaultMaxTransferDistance = 4095; public const int DefaultMaxTransferDistance = 4095;
public const bool WaitForAgentArrivedAtDestinationDefault = true; public const bool WaitForAgentArrivedAtDestinationDefault = true;
public static readonly string OutgoingTransferVersionName = "SIMULATION";
/// <summary>
/// Determine the entity transfer version we will use for teleports.
/// </summary>
public static readonly float OutgoingTransferVersion = VersionInfo.SimulationServiceVersion;
/// <summary> /// <summary>
/// The maximum distance, in standard region units (256m) that an agent is allowed to transfer. /// The maximum distance, in standard region units (256m) that an agent is allowed to transfer.
/// </summary> /// </summary>
@ -726,10 +719,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
sp.Name, sp.Scene.Name, finalDestination.RegionName); sp.Name, sp.Scene.Name, finalDestination.RegionName);
string reason; string reason;
string version; float version;
string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, OutgoingTransferVersion);
if (!Scene.SimulationService.QueryAccess( if (!Scene.SimulationService.QueryAccess(
finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, myversion, sp.Scene.GetFormatsOffered(), out version, out reason)) finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, sp.Scene.GetFormatsOffered(), out version, out reason))
{ {
sp.ControllingClient.SendTeleportFailed(reason); sp.ControllingClient.SendTeleportFailed(reason);
@ -746,8 +738,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
m_interRegionTeleportAttempts.Value++; m_interRegionTeleportAttempts.Value++;
m_log.DebugFormat( m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: {0} transfer version is {1}/{2}, {3} version is {4}", "[ENTITY TRANSFER MODULE]: {0} transfer version is SIMULATION/{2}, {3} version is {4}",
sp.Scene.Name, OutgoingTransferVersionName, OutgoingTransferVersion, finalDestination.RegionName, version); sp.Scene.Name, version, finalDestination.RegionName, version);
// Fixing a bug where teleporting while sitting results in the avatar ending up removed from // Fixing a bug where teleporting while sitting results in the avatar ending up removed from
// both regions // both regions
@ -795,21 +787,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath();
} }
// We're going to fallback to V1 if the destination gives us anything smaller than 0.2 or we're forcing // We're going to fallback to V1 if the destination gives us anything smaller than 0.2
// use of the earlier protocol if (version >= 0.2f)
float versionNumber = 0.1f;
string[] versionComponents = version.Split(new char[] { '/' });
if (versionComponents.Length >= 2)
float.TryParse(versionComponents[1], out versionNumber);
if (versionNumber >= 0.2f)
TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason);
else else
TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason);
} }
private void TransferAgent_V1(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, private void TransferAgent_V1(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination,
IPEndPoint endPoint, uint teleportFlags, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, string version, out string reason) IPEndPoint endPoint, uint teleportFlags, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, float version, out string reason)
{ {
ulong destinationHandle = finalDestination.RegionHandle; ulong destinationHandle = finalDestination.RegionHandle;
AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
@ -1023,7 +1009,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp);
// For backwards compatibility // For backwards compatibility
if (version == "Unknown" || version == string.Empty) if (version == 0f)
{ {
// CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old simulator, sending attachments one by one..."); m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old simulator, sending attachments one by one...");
@ -1064,7 +1050,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
} }
private void TransferAgent_V2(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, private void TransferAgent_V2(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination,
IPEndPoint endPoint, uint teleportFlags, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, string version, out string reason) IPEndPoint endPoint, uint teleportFlags, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, float version, out string reason)
{ {
ulong destinationHandle = finalDestination.RegionHandle; ulong destinationHandle = finalDestination.RegionHandle;
AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
@ -1444,9 +1430,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// point is actually in. // point is actually in.
// Returns the coordinates and information of the new region or 'null' of it doesn't exist. // Returns the coordinates and information of the new region or 'null' of it doesn't exist.
public GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, public GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos,
out string version, out Vector3 newpos, out string failureReason) out float version, out Vector3 newpos, out string failureReason)
{ {
version = String.Empty; version = 0f;
newpos = pos; newpos = pos;
failureReason = string.Empty; failureReason = string.Empty;
string homeURI = scene.GetAgentHomeURI(agentID); string homeURI = scene.GetAgentHomeURI(agentID);
@ -1482,9 +1468,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
} }
// Check to see if we have access to the target region. // Check to see if we have access to the target region.
string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, OutgoingTransferVersion);
if (neighbourRegion != null if (neighbourRegion != null
&& !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, false, newpos, myversion, scene.GetFormatsOffered(), out version, out failureReason)) && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, false, newpos, scene.GetFormatsOffered(), out version, out failureReason))
{ {
// remember banned // remember banned
m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID); m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID);
@ -1515,7 +1500,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
public bool Cross(ScenePresence agent, bool isFlying) public bool Cross(ScenePresence agent, bool isFlying)
{ {
Vector3 newpos; Vector3 newpos;
string version; float version;
string failureReason; string failureReason;
GridRegion neighbourRegion = GetDestination(agent.Scene, agent.UUID, agent.AbsolutePosition, GridRegion neighbourRegion = GetDestination(agent.Scene, agent.UUID, agent.AbsolutePosition,
@ -1627,7 +1612,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
/// </summary> /// </summary>
public ScenePresence CrossAgentToNewRegionAsync( public ScenePresence CrossAgentToNewRegionAsync(
ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, ScenePresence agent, Vector3 pos, GridRegion neighbourRegion,
bool isFlying, string version) bool isFlying, float version)
{ {
try try
{ {
@ -1703,7 +1688,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
} }
public void CrossAgentToNewRegionPost(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, public void CrossAgentToNewRegionPost(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion,
bool isFlying, string version) bool isFlying, float version)
{ {
agent.ControllingClient.RequestClientInfo(); agent.ControllingClient.RequestClientInfo();
@ -1756,7 +1741,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
agent.SendOtherAgentsAppearanceToClient(); agent.SendOtherAgentsAppearanceToClient();
// Backwards compatibility. Best effort // Backwards compatibility. Best effort
if (version == "Unknown" || version == string.Empty) if (version == 0f)
{ {
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one..."); m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one...");
Thread.Sleep(3000); // wait a little now that we're not waiting for the callback Thread.Sleep(3000); // wait a little now that we're not waiting for the callback

View File

@ -81,8 +81,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
public void InitialiseService(IConfigSource configSource) public void InitialiseService(IConfigSource configSource)
{ {
ServiceVersion = String.Format("SIMULATION/{0}", VersionInfo.SimulationServiceVersion);
m_log.InfoFormat("[LOCAL SIMULATION CONNECTOR]: Initialized with connector protocol version {0}", ServiceVersion);
} }
public void PostInitialise() public void PostInitialise()
@ -251,10 +249,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return true; return true;
} }
public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string theirversion, List<UUID> features, out string version, out string reason) public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List<UUID> features, out float version, out string reason)
{ {
reason = "Communications failure"; reason = "Communications failure";
version = ServiceVersion; version = VersionInfo.SimulationServiceVersionAcceptedMax; // If it's within the process, use max. If it's not, the connector will overwrite this
if (destination == null) if (destination == null)
return false; return false;
@ -265,17 +263,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
// s.RegionInfo.RegionName, destination.RegionHandle); // s.RegionInfo.RegionName, destination.RegionHandle);
uint size = m_scenes[destination.RegionID].RegionInfo.RegionSizeX; uint size = m_scenes[destination.RegionID].RegionInfo.RegionSizeX;
float theirVersionNumber = 0f;
string[] versionComponents = theirversion.Split(new char[] { '/' });
if (versionComponents.Length >= 2)
float.TryParse(versionComponents[1], out theirVersionNumber);
// Var regions here, and the requesting simulator is in an older version. // Var regions here, and the requesting simulator is in an older version.
// We will forbide this, because it crashes the viewers // We will forbide this, because it crashes the viewers
if (theirVersionNumber < 0.3f && size > 256) if (version < 0.3f && size != 256)
{ {
reason = "Destination is a variable-sized region, and source is an old simulator. Consider upgrading."; reason = "Destination is a variable-sized region, and source is an old simulator. Consider upgrading.";
m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Request to access this variable-sized region from {0} simulator was denied", theirVersionNumber); m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Request to access this variable-sized region from older simulator was denied");
return false; return false;
} }

View File

@ -205,21 +205,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return m_remoteConnector.UpdateAgent(destination, cAgentData); return m_remoteConnector.UpdateAgent(destination, cAgentData);
} }
public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, List<UUID> features, out string version, out string reason) public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List<UUID> features, out float version, out string reason)
{ {
reason = "Communications failure"; reason = "Communications failure";
version = "Unknown"; version = 0f;
if (destination == null) if (destination == null)
return false; return false;
// Try local first // Try local first
if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, features, out version, out reason)) if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, features, out version, out reason))
return true; return true;
// else do the remote thing // else do the remote thing
if (!m_localBackend.IsLocalRegion(destination.RegionID)) if (!m_localBackend.IsLocalRegion(destination.RegionID))
return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, features, out version, out reason); return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, features, out version, out reason);
return false; return false;
} }

View File

@ -35,7 +35,7 @@ using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.Framework.Interfaces namespace OpenSim.Region.Framework.Interfaces
{ {
public delegate ScenePresence CrossAgentToNewRegionDelegate(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, string version); public delegate ScenePresence CrossAgentToNewRegionDelegate(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, float version);
public interface IEntityTransferModule public interface IEntityTransferModule
{ {
@ -92,12 +92,12 @@ namespace OpenSim.Region.Framework.Interfaces
void EnableChildAgent(ScenePresence agent, GridRegion region); void EnableChildAgent(ScenePresence agent, GridRegion region);
GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, out string version, GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, out float version,
out Vector3 newpos, out string reason); out Vector3 newpos, out string reason);
void Cross(SceneObjectGroup sog, Vector3 position, bool silent); void Cross(SceneObjectGroup sog, Vector3 position, bool silent);
ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, string version); ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, float version);
bool HandleIncomingSceneObject(SceneObjectGroup so, Vector3 newPosition); bool HandleIncomingSceneObject(SceneObjectGroup so, Vector3 newPosition);
} }

View File

@ -480,7 +480,7 @@ namespace OpenSim.Region.Framework.Scenes
) )
{ {
IEntityTransferModule entityTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>(); IEntityTransferModule entityTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
string version = String.Empty; float version = 0f;
Vector3 newpos = Vector3.Zero; Vector3 newpos = Vector3.Zero;
string failureReason = String.Empty; string failureReason = String.Empty;
OpenSim.Services.Interfaces.GridRegion destination = null; OpenSim.Services.Interfaces.GridRegion destination = null;

View File

@ -145,9 +145,96 @@ namespace OpenSim.Server.Handlers.Simulation
if (args.ContainsKey("agent_home_uri")) if (args.ContainsKey("agent_home_uri"))
agentHomeURI = args["agent_home_uri"].AsString(); agentHomeURI = args["agent_home_uri"].AsString();
string theirVersion = string.Empty; // Decode the legacy (string) version and extract the number
float theirVersion = 0f;
if (args.ContainsKey("my_version")) if (args.ContainsKey("my_version"))
theirVersion = args["my_version"].AsString(); {
string theirVersionStr = args["my_version"].AsString();
string[] parts = theirVersionStr.Split(new char[] {'/'});
if (parts.Length > 1)
theirVersion = float.Parse(parts[1]);
}
// Decode the new versioning data
float minVersionRequired = 0f;
float maxVersionRequired = 0f;
float minVersionProvided = 0f;
float maxVersionProvided = 0f;
if (args.ContainsKey("simulation_service_supported_min"))
minVersionProvided = (float)args["simulation_service_supported_min"].AsReal();
if (args.ContainsKey("simulation_service_supported_max"))
maxVersionProvided = (float)args["simulation_service_supported_max"].AsReal();
if (args.ContainsKey("simulation_service_accepted_min"))
minVersionRequired = (float)args["simulation_service_accepted_min"].AsReal();
if (args.ContainsKey("simulation_service_accepted_max"))
maxVersionRequired = (float)args["simulation_service_accepted_max"].AsReal();
responsedata["int_response_code"] = HttpStatusCode.OK;
OSDMap resp = new OSDMap(3);
// If there is no version in the packet at all we're looking at 0.6 or
// even more ancient. Refuse it.
if (minVersionProvided == 0f && theirVersion == 0f) // 0.6 or earlier
{
resp["success"] = OSD.FromBoolean(false);
resp["reason"] = OSD.FromString("Version not supported");
responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true);
return;
}
float version;
if (minVersionProvided == 0f) // Legacy version
{
if (theirVersion >= VersionInfo.SimulationServiceVersionAcceptedMin &&
theirVersion <= VersionInfo.SimulationServiceVersionAcceptedMax)
{
version = Math.Max(theirVersion, VersionInfo.SimulationServiceVersionAcceptedMax);
}
else
{
resp["success"] = OSD.FromBoolean(false);
resp["reason"] = OSD.FromString(String.Format("Your version is {0} and we accept only {1} - {2}", theirVersion, VersionInfo.SimulationServiceVersionAcceptedMin, VersionInfo.SimulationServiceVersionAcceptedMax));
responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true);
return;
}
}
else
{
// Test for no overlap
if (minVersionProvided > VersionInfo.SimulationServiceVersionAcceptedMax ||
maxVersionProvided < VersionInfo.SimulationServiceVersionAcceptedMin)
{
resp["success"] = OSD.FromBoolean(false);
resp["reason"] = OSD.FromString(String.Format("You provide versions {0} - {1} and we accept only {2} - {3}. No version overlap.", minVersionProvided, maxVersionProvided, VersionInfo.SimulationServiceVersionAcceptedMin, VersionInfo.SimulationServiceVersionAcceptedMax));
responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true);
return;
}
if (minVersionRequired > VersionInfo.SimulationServiceVersionSupportedMax ||
maxVersionRequired < VersionInfo.SimulationServiceVersionSupportedMin)
{
resp["success"] = OSD.FromBoolean(false);
resp["reason"] = OSD.FromString(String.Format("You require versions {0} - {1} and we provide only {2} - {3}. No version overlap.", minVersionRequired, maxVersionRequired, VersionInfo.SimulationServiceVersionSupportedMin, VersionInfo.SimulationServiceVersionSupportedMax));
responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true);
return;
}
// Determine version to use
version = Math.Max(Math.Max(maxVersionProvided, VersionInfo.SimulationServiceVersionAcceptedMax), Math.Max(maxVersionRequired, VersionInfo.SimulationServiceVersionSupportedMax));
if (version < VersionInfo.SimulationServiceVersionAcceptedMin ||
version > VersionInfo.SimulationServiceVersionAcceptedMax ||
version < VersionInfo.SimulationServiceVersionSupportedMin ||
version > VersionInfo.SimulationServiceVersionSupportedMax)
{
resp["success"] = OSD.FromBoolean(false);
resp["reason"] = OSD.FromString(String.Format("The protocol version we determined, {0}, is incompatible with the version windows, {1} - {2} and {3} - {4}. No version overlap.", version, VersionInfo.SimulationServiceVersionAcceptedMin, VersionInfo.SimulationServiceVersionAcceptedMax, VersionInfo.SimulationServiceVersionSupportedMin, VersionInfo.SimulationServiceVersionSupportedMax));
responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true);
return;
}
}
List<UUID> features = new List<UUID>(); List<UUID> features = new List<UUID>();
@ -163,16 +250,14 @@ namespace OpenSim.Server.Handlers.Simulation
destination.RegionID = regionID; destination.RegionID = regionID;
string reason; string reason;
string version; float dummyVersion;
bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, theirVersion, features, out version, out reason); bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, features, out dummyVersion, out reason);
responsedata["int_response_code"] = HttpStatusCode.OK;
OSDMap resp = new OSDMap(3);
resp["success"] = OSD.FromBoolean(result); resp["success"] = OSD.FromBoolean(result);
resp["reason"] = OSD.FromString(reason); resp["reason"] = OSD.FromString(reason);
resp["version"] = OSD.FromString(version); string legacyVersion = String.Format("SIMULATION/{0}", version);
resp["version"] = OSD.FromString(legacyVersion);
resp["negotiated_version"] = OSD.FromReal(version);
resp["variable_wearables_count_supported"] = OSD.FromBoolean(true); resp["variable_wearables_count_supported"] = OSD.FromBoolean(true);
OSDArray featuresWanted = new OSDArray(); OSDArray featuresWanted = new OSDArray();

View File

@ -282,10 +282,10 @@ namespace OpenSim.Services.Connectors.Simulation
} }
public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string myversion, List<UUID> featuresAvailable, out string version, out string reason) public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List<UUID> featuresAvailable, out float version, out string reason)
{ {
reason = "Failed to contact destination"; reason = "Failed to contact destination";
version = "Unknown"; version = 0f;
// m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess start, position={0}", position); // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess start, position={0}", position);
@ -298,7 +298,14 @@ namespace OpenSim.Services.Connectors.Simulation
OSDMap request = new OSDMap(); OSDMap request = new OSDMap();
request.Add("viaTeleport", OSD.FromBoolean(viaTeleport)); request.Add("viaTeleport", OSD.FromBoolean(viaTeleport));
request.Add("position", OSD.FromString(position.ToString())); request.Add("position", OSD.FromString(position.ToString()));
request.Add("my_version", OSD.FromString(myversion)); // To those who still understad this field, we're telling them
// the lowest version just to be safe
request.Add("my_version", OSD.FromString(String.Format("SIMULATION/{0}", VersionInfo.SimulationServiceVersionSupportedMin)));
// New simulation service negotiation
request.Add("simulation_service_supported_min", OSD.FromReal(VersionInfo.SimulationServiceVersionSupportedMin));
request.Add("simulation_service_supported_max", OSD.FromReal(VersionInfo.SimulationServiceVersionSupportedMax));
request.Add("simulation_service_accepted_min", OSD.FromReal(VersionInfo.SimulationServiceVersionAcceptedMin));
request.Add("simulation_service_accepted_max", OSD.FromReal(VersionInfo.SimulationServiceVersionAcceptedMax));
OSDArray features = new OSDArray(); OSDArray features = new OSDArray();
foreach (UUID feature in featuresAvailable) foreach (UUID feature in featuresAvailable)
@ -322,15 +329,24 @@ namespace OpenSim.Services.Connectors.Simulation
success = data["success"]; success = data["success"];
reason = data["reason"].AsString(); reason = data["reason"].AsString();
if (data["version"] != null && data["version"].AsString() != string.Empty) if (data["negotiated_version"] != null)
version = data["version"].AsString(); {
version = (float)data["negotiated_version"].AsReal();
}
else if (data["version"] != null && data["version"].AsString() != string.Empty)
{
string versionString = data["version"].AsString();
String[] parts = versionString.Split(new char[] {'/'});
if (parts.Length > 1)
version = float.Parse(parts[1]);
}
m_log.DebugFormat( m_log.DebugFormat(
"[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1}, reason {2}, version {3} ({4})", "[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1}, reason {2}, version SIMULATION/{3}",
uri, success, reason, version, data["version"].AsString()); uri, success, reason, version);
} }
if (!success) if (!success || version == 0f)
{ {
// If we don't check this then OpenSimulator 0.7.3.1 and some period before will never see the // If we don't check this then OpenSimulator 0.7.3.1 and some period before will never see the
// actual failure message // actual failure message

View File

@ -452,12 +452,11 @@ namespace OpenSim.Services.HypergridService
m_log.DebugFormat("[GATEKEEPER SERVICE]: Launching {0}, Teleport Flags: {1}", aCircuit.Name, loginFlag); m_log.DebugFormat("[GATEKEEPER SERVICE]: Launching {0}, Teleport Flags: {1}", aCircuit.Name, loginFlag);
string version; float version;
string myversion = String.Format("SIMULATION/{0}", VersionInfo.SimulationServiceVersion);
if (!m_SimulationService.QueryAccess( if (!m_SimulationService.QueryAccess(
destination, aCircuit.AgentID, aCircuit.ServiceURLs["HomeURI"].ToString(), destination, aCircuit.AgentID, aCircuit.ServiceURLs["HomeURI"].ToString(),
true, aCircuit.startpos, myversion, new List<UUID>(), out version, out reason)) true, aCircuit.startpos, new List<UUID>(), out version, out reason))
return false; return false;
return m_SimulationService.CreateAgent(source, destination, aCircuit, (uint)loginFlag, out reason); return m_SimulationService.CreateAgent(source, destination, aCircuit, (uint)loginFlag, out reason);

View File

@ -92,7 +92,7 @@ namespace OpenSim.Services.Interfaces
/// <param name="version">Version that the target simulator is running</param> /// <param name="version">Version that the target simulator is running</param>
/// <param name="reason">[out] Optional error message</param> /// <param name="reason">[out] Optional error message</param>
/// <returns>True: ok; False: not allowed</returns> /// <returns>True: ok; False: not allowed</returns>
bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, List<UUID> features, out string version, out string reason); bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List<UUID> features, out float version, out string reason);
/// <summary> /// <summary>
/// Message from receiving region to departing region, telling it got contacted by the client. /// Message from receiving region to departing region, telling it got contacted by the client.

View File

@ -983,11 +983,10 @@ namespace OpenSim.Services.LLLoginService
private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason) private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason)
{ {
string myversion = String.Format("SIMULATION/{0}", VersionInfo.SimulationServiceVersion); float version;
string version;
if (!simConnector.QueryAccess( if (!simConnector.QueryAccess(
region, aCircuit.AgentID, null, true, aCircuit.startpos, myversion, new List<UUID>(), out version, out reason)) region, aCircuit.AgentID, null, true, aCircuit.startpos, new List<UUID>(), out version, out reason))
return false; return false;
return simConnector.CreateAgent(null, region, aCircuit, (uint)flags, out reason); return simConnector.CreateAgent(null, region, aCircuit, (uint)flags, out reason);