From 82105ba81d0cd6b866454402a8b064ecc7ebd514 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 14 Sep 2015 01:26:30 +0200 Subject: Change the actual versions allowed to connect, which is different from the interface major version --- OpenSim/Server/Base/ProtocolVersions.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Server') diff --git a/OpenSim/Server/Base/ProtocolVersions.cs b/OpenSim/Server/Base/ProtocolVersions.cs index 8db5bb6..5c2278c 100644 --- a/OpenSim/Server/Base/ProtocolVersions.cs +++ b/OpenSim/Server/Base/ProtocolVersions.cs @@ -46,11 +46,11 @@ namespace OpenSim.Server.Base /// // The range of acceptable servers for client-side connectors - public readonly static int ClientProtocolVersionMin = 0; - public readonly static int ClientProtocolVersionMax = 0; + public readonly static int ClientProtocolVersionMin = 1; + public readonly static int ClientProtocolVersionMax = 1; // The range of acceptable clients in server-side handlers - public readonly static int ServerProtocolVersionMin = 0; - public readonly static int ServerProtocolVersionMax = 0; + public readonly static int ServerProtocolVersionMin = 1; + public readonly static int ServerProtocolVersionMax = 1; } } -- cgit v1.1 From 339e252ccef175968f4b4b10eb70ca3da4552d55 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 17 Oct 2015 19:29:20 -0700 Subject: The protocol version checking on the grid server connector seemed to have a bug. I think I fixed it. --- OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'OpenSim/Server') diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs index 849fa94..86fda36 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs @@ -159,7 +159,24 @@ namespace OpenSim.Server.Handlers.Grid m_log.WarnFormat("[GRID HANDLER]: no maximum protocol version in request to register region"); // Check the protocol version - if ((versionNumberMin > ProtocolVersions.ServerProtocolVersionMax && versionNumberMax < ProtocolVersions.ServerProtocolVersionMax)) + // This is how it works: + // Example 1: + // Client: [0 0] + // Server: [1 1] + // ==> fail + // Example 2: + // Client: [1 1] + // Server: [0 0] + // ==> fail + // Example 3: + // Client: [0 1] + // Server: [1 1] + // ==> success + // Example 4: + // Client: [1 1] + // Server: [0 1] + // ==> success + if ((versionNumberMin > ProtocolVersions.ServerProtocolVersionMax || versionNumberMax < ProtocolVersions.ServerProtocolVersionMin)) { // Can't do, there is no overlap in the acceptable ranges return FailureResult(); -- cgit v1.1 From 06d2508b96522c906d2dba3c07048b2578779dbd Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 18 Oct 2015 21:47:10 -0700 Subject: On to 0.8.3! --- OpenSim/Server/Base/Properties/AssemblyInfo.cs | 2 +- OpenSim/Server/Handlers/Properties/AssemblyInfo.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Server') diff --git a/OpenSim/Server/Base/Properties/AssemblyInfo.cs b/OpenSim/Server/Base/Properties/AssemblyInfo.cs index e819a2b..3c634a7 100644 --- a/OpenSim/Server/Base/Properties/AssemblyInfo.cs +++ b/OpenSim/Server/Base/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("0.8.2.*")] +[assembly: AssemblyVersion("0.8.3.*")] diff --git a/OpenSim/Server/Handlers/Properties/AssemblyInfo.cs b/OpenSim/Server/Handlers/Properties/AssemblyInfo.cs index 780e454..f0b36c1 100644 --- a/OpenSim/Server/Handlers/Properties/AssemblyInfo.cs +++ b/OpenSim/Server/Handlers/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("0.8.2.*")] +[assembly: AssemblyVersion("0.8.3.*")] -- cgit v1.1 From 2b437f8d86201e26368636476f0523c0a39a990a Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 20 Oct 2015 00:58:16 +0200 Subject: Let the initiator of a teleport or crossing know that we handle extra wearables --- OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Server') diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index e7544b5..8b4518c 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -173,6 +173,7 @@ namespace OpenSim.Server.Handlers.Simulation resp["success"] = OSD.FromBoolean(result); resp["reason"] = OSD.FromString(reason); resp["version"] = OSD.FromString(version); + resp["variable_wearables_count_supported"] = OSD.FromBoolean(true); OSDArray featuresWanted = new OSDArray(); foreach (UUID feature in features) -- cgit v1.1 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. --- .../Server/Handlers/Simulation/AgentHandlers.cs | 103 +++++++++++++++++++-- 1 file changed, 94 insertions(+), 9 deletions(-) (limited to 'OpenSim/Server') diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 8b4518c..e0fa799 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -145,9 +145,96 @@ namespace OpenSim.Server.Handlers.Simulation if (args.ContainsKey("agent_home_uri")) 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")) - 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 features = new List(); @@ -163,16 +250,14 @@ namespace OpenSim.Server.Handlers.Simulation destination.RegionID = regionID; string reason; - string version; - bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, theirVersion, features, out version, out reason); - - responsedata["int_response_code"] = HttpStatusCode.OK; - - OSDMap resp = new OSDMap(3); + float dummyVersion; + bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, features, out dummyVersion, out reason); resp["success"] = OSD.FromBoolean(result); 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); OSDArray featuresWanted = new OSDArray(); -- 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 --- .../Server/Handlers/Simulation/AgentHandlers.cs | 68 +++++++++++++--------- 1 file changed, 41 insertions(+), 27 deletions(-) (limited to 'OpenSim/Server') diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index e0fa799..e8456b4 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -156,8 +156,8 @@ namespace OpenSim.Server.Handlers.Simulation } // Decode the new versioning data - float minVersionRequired = 0f; - float maxVersionRequired = 0f; +// float minVersionRequired = 0f; +// float maxVersionRequired = 0f; float minVersionProvided = 0f; float maxVersionProvided = 0f; @@ -166,50 +166,49 @@ namespace OpenSim.Server.Handlers.Simulation 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(); +// 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 (minVersionProvided == 0f) // string version or older { - if (theirVersion >= VersionInfo.SimulationServiceVersionAcceptedMin && - theirVersion <= VersionInfo.SimulationServiceVersionAcceptedMax) + // If there is no version in the packet at all we're looking at 0.6 or + // even more ancient. Refuse it. + if(theirVersion == 0f) { - version = Math.Max(theirVersion, VersionInfo.SimulationServiceVersionAcceptedMax); + resp["success"] = OSD.FromBoolean(false); + resp["reason"] = OSD.FromString("Your region is running a old version of opensim no longer supported. Consider updating it"); + responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true); + return; } - else + + version = theirVersion; + + if (version < VersionInfo.SimulationServiceVersionAcceptedMin || + version > VersionInfo.SimulationServiceVersionAcceptedMax ) { 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)); + resp["reason"] = OSD.FromString(String.Format("Your region protocol version is {0} and destiny accepts 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)); + resp["reason"] = OSD.FromString(String.Format("Your region provide protocol 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; } @@ -217,23 +216,38 @@ namespace OpenSim.Server.Handlers.Simulation 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)); + resp["reason"] = OSD.FromString(String.Format("You require region protocol 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)); + + version = Math.Max(Math.Min(maxVersionProvided, VersionInfo.SimulationServiceVersionAcceptedMax), Math.Min(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)); + resp["reason"] = OSD.FromString(String.Format("The region 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; } +*/ + // find max possible version to use + version = Math.Min(VersionInfo.SimulationServiceVersionAcceptedMax, maxVersionProvided); + // check if within lower bounds + if(version < VersionInfo.SimulationServiceVersionAcceptedMin || + version < minVersionProvided) + { + resp["success"] = OSD.FromBoolean(false); + resp["reason"] = OSD.FromString(String.Format("Region protocol versions are incompatible. Destiny accepts {0} - {1} and source provides {2} - {3}.", VersionInfo.SimulationServiceVersionAcceptedMin, VersionInfo.SimulationServiceVersionAcceptedMax, + minVersionProvided, + maxVersionProvided)); + responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true); + return; + } } List features = new List(); -- 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 --- .../Server/Handlers/Simulation/AgentHandlers.cs | 43 +++++++++------------- 1 file changed, 18 insertions(+), 25 deletions(-) (limited to 'OpenSim/Server') diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index e8456b4..6faeefd 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -156,8 +156,8 @@ namespace OpenSim.Server.Handlers.Simulation } // Decode the new versioning data -// float minVersionRequired = 0f; -// float maxVersionRequired = 0f; + float minVersionRequired = 0f; + float maxVersionRequired = 0f; float minVersionProvided = 0f; float maxVersionProvided = 0f; @@ -166,10 +166,10 @@ namespace OpenSim.Server.Handlers.Simulation 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(); + 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); @@ -195,14 +195,13 @@ namespace OpenSim.Server.Handlers.Simulation version > VersionInfo.SimulationServiceVersionAcceptedMax ) { resp["success"] = OSD.FromBoolean(false); - resp["reason"] = OSD.FromString(String.Format("Your region protocol version is {0} and destiny accepts only {1} - {2}", theirVersion, VersionInfo.SimulationServiceVersionAcceptedMin, VersionInfo.SimulationServiceVersionAcceptedMax)); + resp["reason"] = OSD.FromString(String.Format("Your region protocol version is {0} and we accept only {1} - {2}. No version overlap.", 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) @@ -221,9 +220,16 @@ namespace OpenSim.Server.Handlers.Simulation return; } - // Determine version to use + // Determine versions to use + float inboundVersion = Math.Min(maxVersionProvided, VersionInfo.SimulationServiceVersionAcceptedMax); + float outboundVersion = Math.Min(maxVersionRequired, VersionInfo.SimulationServiceVersionSupportedMax); + + // In this stage, we use only a single version number. Future regions may use asymmetrical protocols. + // Here, the two versions we determined are combined into a single version for now. + version = Math.Max(inboundVersion, outboundVersion); - version = Math.Max(Math.Min(maxVersionProvided, VersionInfo.SimulationServiceVersionAcceptedMax), Math.Min(maxVersionRequired, VersionInfo.SimulationServiceVersionSupportedMax)); + // Since only using a single version, we must do this check. Once the plumbing is in for asymmetrical + // protocols, this will go away, allowing more working combinations. if (version < VersionInfo.SimulationServiceVersionAcceptedMin || version > VersionInfo.SimulationServiceVersionAcceptedMax || version < VersionInfo.SimulationServiceVersionSupportedMin || @@ -234,20 +240,6 @@ namespace OpenSim.Server.Handlers.Simulation responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true); return; } -*/ - // find max possible version to use - version = Math.Min(VersionInfo.SimulationServiceVersionAcceptedMax, maxVersionProvided); - // check if within lower bounds - if(version < VersionInfo.SimulationServiceVersionAcceptedMin || - version < minVersionProvided) - { - resp["success"] = OSD.FromBoolean(false); - resp["reason"] = OSD.FromString(String.Format("Region protocol versions are incompatible. Destiny accepts {0} - {1} and source provides {2} - {3}.", VersionInfo.SimulationServiceVersionAcceptedMin, VersionInfo.SimulationServiceVersionAcceptedMax, - minVersionProvided, - maxVersionProvided)); - responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true); - return; - } } List features = new List(); @@ -271,7 +263,8 @@ namespace OpenSim.Server.Handlers.Simulation resp["reason"] = OSD.FromString(reason); string legacyVersion = String.Format("SIMULATION/{0}", version); resp["version"] = OSD.FromString(legacyVersion); - resp["negotiated_version"] = OSD.FromReal(version); + resp["negotiated_inbound_version"] = OSD.FromReal(version); //inboundVersion); + resp["negotiated_outbound_version"] = OSD.FromReal(version); //outboundVersion); resp["variable_wearables_count_supported"] = OSD.FromBoolean(true); OSDArray featuresWanted = new OSDArray(); -- 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! --- .../Server/Handlers/Simulation/AgentHandlers.cs | 31 ++++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'OpenSim/Server') diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 6faeefd..5142514 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -176,6 +176,8 @@ namespace OpenSim.Server.Handlers.Simulation float version; + float outboundVersion = 0f; + float inboundVersion = 0f; if (minVersionProvided == 0f) // string version or older { @@ -221,24 +223,22 @@ namespace OpenSim.Server.Handlers.Simulation } // Determine versions to use - float inboundVersion = Math.Min(maxVersionProvided, VersionInfo.SimulationServiceVersionAcceptedMax); - float outboundVersion = Math.Min(maxVersionRequired, VersionInfo.SimulationServiceVersionSupportedMax); + // This is intentionally inverted. Inbound and Outbound refer to the direction of the transfer. + // Therefore outbound means from the sender to the receier and inbound means from the receiver to the sender. + // So outbound is what we will accept and inbound is what we will send. Confused yet? + outboundVersion = Math.Min(maxVersionProvided, VersionInfo.SimulationServiceVersionAcceptedMax); + inboundVersion = Math.Min(maxVersionRequired, VersionInfo.SimulationServiceVersionSupportedMax); - // In this stage, we use only a single version number. Future regions may use asymmetrical protocols. - // Here, the two versions we determined are combined into a single version for now. + // Here, the two versions we determined are combined into a single version for legacy response. version = Math.Max(inboundVersion, outboundVersion); - // Since only using a single version, we must do this check. Once the plumbing is in for asymmetrical - // protocols, this will go away, allowing more working combinations. 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 region 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; + // If the single version can't resolve, fall back to safest. This will only affect very old regions. + version = 0.1f; } } @@ -256,15 +256,18 @@ namespace OpenSim.Server.Handlers.Simulation destination.RegionID = regionID; string reason; - float dummyVersion; - bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, features, out dummyVersion, out reason); + // We're sending the version numbers down to the local connector to do the varregion check. + EntityTransferContext ctx = new EntityTransferContext(); + ctx.InboundVersion = inboundVersion; + ctx.OutboundVersion = outboundVersion; + bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, features, ctx, out reason); resp["success"] = OSD.FromBoolean(result); resp["reason"] = OSD.FromString(reason); string legacyVersion = String.Format("SIMULATION/{0}", version); resp["version"] = OSD.FromString(legacyVersion); - resp["negotiated_inbound_version"] = OSD.FromReal(version); //inboundVersion); - resp["negotiated_outbound_version"] = OSD.FromReal(version); //outboundVersion); + resp["negotiated_inbound_version"] = OSD.FromReal(inboundVersion); + resp["negotiated_outbound_version"] = OSD.FromReal(outboundVersion); resp["variable_wearables_count_supported"] = OSD.FromBoolean(true); OSDArray featuresWanted = new OSDArray(); -- cgit v1.1 From 19e5667451dc763eb90a78533c4fe7f51c49f9a0 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 31 Oct 2015 21:50:24 +0000 Subject: fix transfer protocol version in string format. Let that case have tests identical to new format (this still isnt for your babies keep them safe...) --- .../Server/Handlers/Simulation/AgentHandlers.cs | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'OpenSim/Server') diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 5142514..a2920f9 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -190,14 +190,24 @@ namespace OpenSim.Server.Handlers.Simulation responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true); return; } - + version = theirVersion; - - if (version < VersionInfo.SimulationServiceVersionAcceptedMin || - version > VersionInfo.SimulationServiceVersionAcceptedMax ) + outboundVersion = version; + inboundVersion = version; + + if (outboundVersion < VersionInfo.SimulationServiceVersionAcceptedMin || + outboundVersion > VersionInfo.SimulationServiceVersionAcceptedMax ) + { + resp["success"] = OSD.FromBoolean(false); + resp["reason"] = OSD.FromString(String.Format("Your region provide protocol version {0} and we accept only {1} - {2}. No version overlap.", outboundVersion, VersionInfo.SimulationServiceVersionAcceptedMin, VersionInfo.SimulationServiceVersionAcceptedMax)); + responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true); + return; + } + if (inboundVersion > VersionInfo.SimulationServiceVersionSupportedMax || + inboundVersion < VersionInfo.SimulationServiceVersionSupportedMin) { resp["success"] = OSD.FromBoolean(false); - resp["reason"] = OSD.FromString(String.Format("Your region protocol version is {0} and we accept only {1} - {2}. No version overlap.", theirVersion, VersionInfo.SimulationServiceVersionAcceptedMin, VersionInfo.SimulationServiceVersionAcceptedMax)); + resp["reason"] = OSD.FromString(String.Format("You require region protocol version {0} and we provide only {2} - {3}. No version overlap.", inboundVersion, VersionInfo.SimulationServiceVersionSupportedMin, VersionInfo.SimulationServiceVersionSupportedMax)); responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true); return; } @@ -239,6 +249,8 @@ namespace OpenSim.Server.Handlers.Simulation { // If the single version can't resolve, fall back to safest. This will only affect very old regions. version = 0.1f; + outboundVersion = version; + inboundVersion = version; } } -- cgit v1.1 From 6d0b45cd4e8e8a1bb0c2eb45981bc548ae5d53ac Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 1 Nov 2015 00:35:27 +0100 Subject: Revert "fix transfer protocol version in string format. These are not fixes you are looking for..... (Jedi mind trick) This reverts commit 19e5667451dc763eb90a78533c4fe7f51c49f9a0. --- .../Server/Handlers/Simulation/AgentHandlers.cs | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'OpenSim/Server') diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index a2920f9..5142514 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -190,24 +190,14 @@ namespace OpenSim.Server.Handlers.Simulation responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true); return; } - - version = theirVersion; - outboundVersion = version; - inboundVersion = version; - if (outboundVersion < VersionInfo.SimulationServiceVersionAcceptedMin || - outboundVersion > VersionInfo.SimulationServiceVersionAcceptedMax ) - { - resp["success"] = OSD.FromBoolean(false); - resp["reason"] = OSD.FromString(String.Format("Your region provide protocol version {0} and we accept only {1} - {2}. No version overlap.", outboundVersion, VersionInfo.SimulationServiceVersionAcceptedMin, VersionInfo.SimulationServiceVersionAcceptedMax)); - responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true); - return; - } - if (inboundVersion > VersionInfo.SimulationServiceVersionSupportedMax || - inboundVersion < VersionInfo.SimulationServiceVersionSupportedMin) + version = theirVersion; + + if (version < VersionInfo.SimulationServiceVersionAcceptedMin || + version > VersionInfo.SimulationServiceVersionAcceptedMax ) { resp["success"] = OSD.FromBoolean(false); - resp["reason"] = OSD.FromString(String.Format("You require region protocol version {0} and we provide only {2} - {3}. No version overlap.", inboundVersion, VersionInfo.SimulationServiceVersionSupportedMin, VersionInfo.SimulationServiceVersionSupportedMax)); + resp["reason"] = OSD.FromString(String.Format("Your region protocol version is {0} and we accept only {1} - {2}. No version overlap.", theirVersion, VersionInfo.SimulationServiceVersionAcceptedMin, VersionInfo.SimulationServiceVersionAcceptedMax)); responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true); return; } @@ -249,8 +239,6 @@ namespace OpenSim.Server.Handlers.Simulation { // If the single version can't resolve, fall back to safest. This will only affect very old regions. version = 0.1f; - outboundVersion = version; - inboundVersion = version; } } -- cgit v1.1 From 2198330142c2176f31ba4d2198f831ef00c1dca4 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 1 Nov 2015 00:40:13 +0100 Subject: This is the replacement fix for large regions and string version. --- OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Server') diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 5142514..6e87448 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -260,6 +260,12 @@ namespace OpenSim.Server.Handlers.Simulation EntityTransferContext ctx = new EntityTransferContext(); ctx.InboundVersion = inboundVersion; ctx.OutboundVersion = outboundVersion; + if (minVersionProvided == 0f) + { + ctx.InboundVersion = version; + ctx.OutboundVersion = version; + } + bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, features, ctx, out reason); resp["success"] = OSD.FromBoolean(result); -- cgit v1.1 From 5f3b443c034d3d59ae08dce6d560fa8708cb3bd5 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 1 Nov 2015 00:57:45 +0100 Subject: Remove an unneeded code path, it could never be reached. Ubit caught it :) --- OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'OpenSim/Server') diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 6e87448..5a71951 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -228,18 +228,6 @@ namespace OpenSim.Server.Handlers.Simulation // So outbound is what we will accept and inbound is what we will send. Confused yet? outboundVersion = Math.Min(maxVersionProvided, VersionInfo.SimulationServiceVersionAcceptedMax); inboundVersion = Math.Min(maxVersionRequired, VersionInfo.SimulationServiceVersionSupportedMax); - - // Here, the two versions we determined are combined into a single version for legacy response. - version = Math.Max(inboundVersion, outboundVersion); - - if (version < VersionInfo.SimulationServiceVersionAcceptedMin || - version > VersionInfo.SimulationServiceVersionAcceptedMax || - version < VersionInfo.SimulationServiceVersionSupportedMin || - version > VersionInfo.SimulationServiceVersionSupportedMax) - { - // If the single version can't resolve, fall back to safest. This will only affect very old regions. - version = 0.1f; - } } List features = new List(); -- cgit v1.1 From efcf0e4f2e5f6e5e800917f0888475dfed725e42 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 1 Nov 2015 01:03:44 +0100 Subject: Minor: Add an initializer to show what the default value would be. --- OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Server') diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 5a71951..98c5312 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -174,7 +174,7 @@ namespace OpenSim.Server.Handlers.Simulation responsedata["int_response_code"] = HttpStatusCode.OK; OSDMap resp = new OSDMap(3); - float version; + float version = 0f; float outboundVersion = 0f; float inboundVersion = 0f; -- cgit v1.1