From dc6d9eadf33b9a0321664d676030b07b2bd04bed Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 31 Oct 2015 00:01:35 +0100 Subject: Testing stage of the new versioning system. Use at own risk. May not work. Will eat your babies. Yada. Yada. --- .../Simulation/SimulationServiceConnector.cs | 32 ++++++++++++++++------ 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 1eedbef..5ee2c9c 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -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 featuresAvailable, out string version, out string reason) + public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List featuresAvailable, out float version, out string reason) { reason = "Failed to contact destination"; - version = "Unknown"; + version = 0f; // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess start, position={0}", position); @@ -298,7 +298,14 @@ namespace OpenSim.Services.Connectors.Simulation OSDMap request = new OSDMap(); request.Add("viaTeleport", OSD.FromBoolean(viaTeleport)); 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(); foreach (UUID feature in featuresAvailable) @@ -322,15 +329,24 @@ namespace OpenSim.Services.Connectors.Simulation success = data["success"]; reason = data["reason"].AsString(); - if (data["version"] != null && data["version"].AsString() != string.Empty) - version = data["version"].AsString(); + if (data["negotiated_version"] != null) + { + 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( - "[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1}, reason {2}, version {3} ({4})", - uri, success, reason, version, data["version"].AsString()); + "[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1}, reason {2}, version SIMULATION/{3}", + 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 // actual failure message -- cgit v1.1 From 400c61cd6017fec154d03f940aad054e48ecf2d9 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 31 Oct 2015 00:06:30 +0000 Subject: fix teleport to to string version regions --- OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 5ee2c9c..4dad517 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -329,7 +329,7 @@ namespace OpenSim.Services.Connectors.Simulation success = data["success"]; reason = data["reason"].AsString(); - if (data["negotiated_version"] != null) + if (data.ContainsKey("negotiated_version") && data["negotiated_version"] != null) { version = (float)data["negotiated_version"].AsReal(); } -- cgit v1.1 From 1030d07f31516b303ddbb0c428f8f28419f3fa82 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 31 Oct 2015 12:57:14 +0000 Subject: simplify new regions protocol version control. (May not work, and babies safety warnings still valid --- OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 4dad517..9e800af 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -304,8 +304,8 @@ namespace OpenSim.Services.Connectors.Simulation // 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)); +// request.Add("simulation_service_accepted_min", OSD.FromReal(VersionInfo.SimulationServiceVersionAcceptedMin)); +// request.Add("simulation_service_accepted_max", OSD.FromReal(VersionInfo.SimulationServiceVersionAcceptedMax)); OSDArray features = new OSDArray(); foreach (UUID feature in featuresAvailable) -- cgit v1.1 From dc6bdbf740d4c903b06fef386c4b80df783a7b2e Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 31 Oct 2015 16:57:24 +0100 Subject: Put back the option of having asymmetrical protocol versions in transfers --- .../Services/Connectors/Simulation/SimulationServiceConnector.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 9e800af..9f0cc8e 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -304,8 +304,8 @@ namespace OpenSim.Services.Connectors.Simulation // 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)); + request.Add("simulation_service_accepted_min", OSD.FromReal(VersionInfo.SimulationServiceVersionAcceptedMin)); + request.Add("simulation_service_accepted_max", OSD.FromReal(VersionInfo.SimulationServiceVersionAcceptedMax)); OSDArray features = new OSDArray(); foreach (UUID feature in featuresAvailable) @@ -329,7 +329,9 @@ namespace OpenSim.Services.Connectors.Simulation success = data["success"]; reason = data["reason"].AsString(); - if (data.ContainsKey("negotiated_version") && data["negotiated_version"] != null) + // We will need to plumb this and start sing the outbound version as well + // TODO: lay the pipe for version plumbing + if (data.ContainsKey("negotiated_inbound_version") && data["negotiated_inbound_version"] != null) { version = (float)data["negotiated_version"].AsReal(); } -- cgit v1.1 From ea56f4f27c6e707b54e0e29d2477ef3af2a8c732 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 31 Oct 2015 18:13:02 +0100 Subject: Introduce an EntityTransferContext carrying the version numbers to pass to all interested functions. Should fix the varregion conditional. Still a testing version, do NOT use in production! --- .../Connectors/Simulation/SimulationServiceConnector.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 9f0cc8e..b93088a 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -282,10 +282,9 @@ namespace OpenSim.Services.Connectors.Simulation } - public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List featuresAvailable, out float version, out string reason) + public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List featuresAvailable, EntityTransferContext ctx, out string reason) { reason = "Failed to contact destination"; - version = 0f; // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess start, position={0}", position); @@ -333,22 +332,26 @@ namespace OpenSim.Services.Connectors.Simulation // TODO: lay the pipe for version plumbing if (data.ContainsKey("negotiated_inbound_version") && data["negotiated_inbound_version"] != null) { - version = (float)data["negotiated_version"].AsReal(); + ctx.InboundVersion = (float)data["negotiated_inbound_version"].AsReal(); + ctx.OutboundVersion = (float)data["negotiated_outbound_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]); + { + ctx.InboundVersion = float.Parse(parts[1]); + ctx.OutboundVersion = float.Parse(parts[1]); + } } m_log.DebugFormat( - "[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1}, reason {2}, version SIMULATION/{3}", - uri, success, reason, version); + "[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1}, reason {2}, version {3}/{4}", + uri, success, reason, ctx.InboundVersion, ctx.OutboundVersion); } - if (!success || version == 0f) + if (!success || ctx.InboundVersion == 0f || ctx.OutboundVersion == 0f) { // If we don't check this then OpenSimulator 0.7.3.1 and some period before will never see the // actual failure message -- cgit v1.1