aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Simulation
diff options
context:
space:
mode:
authorMelanie Thielker2015-10-31 18:13:02 +0100
committerMelanie Thielker2015-10-31 18:13:02 +0100
commitea56f4f27c6e707b54e0e29d2477ef3af2a8c732 (patch)
treecd6334f1e6b81cd502aed93abe5f1fd0ae895e6b /OpenSim/Server/Handlers/Simulation
parentRemove testing cruft that is blocking the new protocols. Unit tests no (diff)
downloadopensim-SC_OLD-ea56f4f27c6e707b54e0e29d2477ef3af2a8c732.zip
opensim-SC_OLD-ea56f4f27c6e707b54e0e29d2477ef3af2a8c732.tar.gz
opensim-SC_OLD-ea56f4f27c6e707b54e0e29d2477ef3af2a8c732.tar.bz2
opensim-SC_OLD-ea56f4f27c6e707b54e0e29d2477ef3af2a8c732.tar.xz
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!
Diffstat (limited to 'OpenSim/Server/Handlers/Simulation')
-rw-r--r--OpenSim/Server/Handlers/Simulation/AgentHandlers.cs31
1 files changed, 17 insertions, 14 deletions
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
176 176
177 float version; 177 float version;
178 178
179 float outboundVersion = 0f;
180 float inboundVersion = 0f;
179 181
180 if (minVersionProvided == 0f) // string version or older 182 if (minVersionProvided == 0f) // string version or older
181 { 183 {
@@ -221,24 +223,22 @@ namespace OpenSim.Server.Handlers.Simulation
221 } 223 }
222 224
223 // Determine versions to use 225 // Determine versions to use
224 float inboundVersion = Math.Min(maxVersionProvided, VersionInfo.SimulationServiceVersionAcceptedMax); 226 // This is intentionally inverted. Inbound and Outbound refer to the direction of the transfer.
225 float outboundVersion = Math.Min(maxVersionRequired, VersionInfo.SimulationServiceVersionSupportedMax); 227 // Therefore outbound means from the sender to the receier and inbound means from the receiver to the sender.
228 // So outbound is what we will accept and inbound is what we will send. Confused yet?
229 outboundVersion = Math.Min(maxVersionProvided, VersionInfo.SimulationServiceVersionAcceptedMax);
230 inboundVersion = Math.Min(maxVersionRequired, VersionInfo.SimulationServiceVersionSupportedMax);
226 231
227 // In this stage, we use only a single version number. Future regions may use asymmetrical protocols. 232 // Here, the two versions we determined are combined into a single version for legacy response.
228 // Here, the two versions we determined are combined into a single version for now.
229 version = Math.Max(inboundVersion, outboundVersion); 233 version = Math.Max(inboundVersion, outboundVersion);
230 234
231 // Since only using a single version, we must do this check. Once the plumbing is in for asymmetrical
232 // protocols, this will go away, allowing more working combinations.
233 if (version < VersionInfo.SimulationServiceVersionAcceptedMin || 235 if (version < VersionInfo.SimulationServiceVersionAcceptedMin ||
234 version > VersionInfo.SimulationServiceVersionAcceptedMax || 236 version > VersionInfo.SimulationServiceVersionAcceptedMax ||
235 version < VersionInfo.SimulationServiceVersionSupportedMin || 237 version < VersionInfo.SimulationServiceVersionSupportedMin ||
236 version > VersionInfo.SimulationServiceVersionSupportedMax) 238 version > VersionInfo.SimulationServiceVersionSupportedMax)
237 { 239 {
238 resp["success"] = OSD.FromBoolean(false); 240 // If the single version can't resolve, fall back to safest. This will only affect very old regions.
239 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)); 241 version = 0.1f;
240 responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true);
241 return;
242 } 242 }
243 } 243 }
244 244
@@ -256,15 +256,18 @@ namespace OpenSim.Server.Handlers.Simulation
256 destination.RegionID = regionID; 256 destination.RegionID = regionID;
257 257
258 string reason; 258 string reason;
259 float dummyVersion; 259 // We're sending the version numbers down to the local connector to do the varregion check.
260 bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, features, out dummyVersion, out reason); 260 EntityTransferContext ctx = new EntityTransferContext();
261 ctx.InboundVersion = inboundVersion;
262 ctx.OutboundVersion = outboundVersion;
263 bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, features, ctx, out reason);
261 264
262 resp["success"] = OSD.FromBoolean(result); 265 resp["success"] = OSD.FromBoolean(result);
263 resp["reason"] = OSD.FromString(reason); 266 resp["reason"] = OSD.FromString(reason);
264 string legacyVersion = String.Format("SIMULATION/{0}", version); 267 string legacyVersion = String.Format("SIMULATION/{0}", version);
265 resp["version"] = OSD.FromString(legacyVersion); 268 resp["version"] = OSD.FromString(legacyVersion);
266 resp["negotiated_inbound_version"] = OSD.FromReal(version); //inboundVersion); 269 resp["negotiated_inbound_version"] = OSD.FromReal(inboundVersion);
267 resp["negotiated_outbound_version"] = OSD.FromReal(version); //outboundVersion); 270 resp["negotiated_outbound_version"] = OSD.FromReal(outboundVersion);
268 resp["variable_wearables_count_supported"] = OSD.FromBoolean(true); 271 resp["variable_wearables_count_supported"] = OSD.FromBoolean(true);
269 272
270 OSDArray featuresWanted = new OSDArray(); 273 OSDArray featuresWanted = new OSDArray();