diff options
Diffstat (limited to 'OpenSim/Services/Connectors/Simulation')
-rw-r--r-- | OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 493d7e0..ebffa28 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | |||
@@ -283,11 +283,9 @@ namespace OpenSim.Services.Connectors.Simulation | |||
283 | } | 283 | } |
284 | 284 | ||
285 | 285 | ||
286 | 286 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List<UUID> featuresAvailable, EntityTransferContext ctx, out string reason) | |
287 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string myversion, List<UUID> featuresAvailable, out string version, out string reason) | ||
288 | { | 287 | { |
289 | reason = "Failed to contact destination"; | 288 | reason = "Failed to contact destination"; |
290 | version = "Unknown"; | ||
291 | 289 | ||
292 | // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess start, position={0}", position); | 290 | // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess start, position={0}", position); |
293 | 291 | ||
@@ -300,7 +298,14 @@ namespace OpenSim.Services.Connectors.Simulation | |||
300 | OSDMap request = new OSDMap(); | 298 | OSDMap request = new OSDMap(); |
301 | request.Add("viaTeleport", OSD.FromBoolean(viaTeleport)); | 299 | request.Add("viaTeleport", OSD.FromBoolean(viaTeleport)); |
302 | request.Add("position", OSD.FromString(position.ToString())); | 300 | request.Add("position", OSD.FromString(position.ToString())); |
303 | request.Add("my_version", OSD.FromString(myversion)); | 301 | // To those who still understad this field, we're telling them |
302 | // the lowest version just to be safe | ||
303 | request.Add("my_version", OSD.FromString(String.Format("SIMULATION/{0}", VersionInfo.SimulationServiceVersionSupportedMin))); | ||
304 | // New simulation service negotiation | ||
305 | request.Add("simulation_service_supported_min", OSD.FromReal(VersionInfo.SimulationServiceVersionSupportedMin)); | ||
306 | request.Add("simulation_service_supported_max", OSD.FromReal(VersionInfo.SimulationServiceVersionSupportedMax)); | ||
307 | request.Add("simulation_service_accepted_min", OSD.FromReal(VersionInfo.SimulationServiceVersionAcceptedMin)); | ||
308 | request.Add("simulation_service_accepted_max", OSD.FromReal(VersionInfo.SimulationServiceVersionAcceptedMax)); | ||
304 | 309 | ||
305 | OSDArray features = new OSDArray(); | 310 | OSDArray features = new OSDArray(); |
306 | foreach (UUID feature in featuresAvailable) | 311 | foreach (UUID feature in featuresAvailable) |
@@ -324,15 +329,30 @@ namespace OpenSim.Services.Connectors.Simulation | |||
324 | success = data["success"]; | 329 | success = data["success"]; |
325 | 330 | ||
326 | reason = data["reason"].AsString(); | 331 | reason = data["reason"].AsString(); |
327 | if (data["version"] != null && data["version"].AsString() != string.Empty) | 332 | // We will need to plumb this and start sing the outbound version as well |
328 | version = data["version"].AsString(); | 333 | // TODO: lay the pipe for version plumbing |
334 | if (data.ContainsKey("negotiated_inbound_version") && data["negotiated_inbound_version"] != null) | ||
335 | { | ||
336 | ctx.InboundVersion = (float)data["negotiated_inbound_version"].AsReal(); | ||
337 | ctx.OutboundVersion = (float)data["negotiated_outbound_version"].AsReal(); | ||
338 | } | ||
339 | else if (data["version"] != null && data["version"].AsString() != string.Empty) | ||
340 | { | ||
341 | string versionString = data["version"].AsString(); | ||
342 | String[] parts = versionString.Split(new char[] {'/'}); | ||
343 | if (parts.Length > 1) | ||
344 | { | ||
345 | ctx.InboundVersion = float.Parse(parts[1]); | ||
346 | ctx.OutboundVersion = float.Parse(parts[1]); | ||
347 | } | ||
348 | } | ||
329 | 349 | ||
330 | m_log.DebugFormat( | 350 | m_log.DebugFormat( |
331 | "[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1}, reason {2}, version {3} ({4})", | 351 | "[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1}, reason {2}, version {3}/{4}", |
332 | uri, success, reason, version, data["version"].AsString()); | 352 | uri, success, reason, ctx.InboundVersion, ctx.OutboundVersion); |
333 | } | 353 | } |
334 | 354 | ||
335 | if (!success) | 355 | if (!success || ctx.InboundVersion == 0f || ctx.OutboundVersion == 0f) |
336 | { | 356 | { |
337 | // If we don't check this then OpenSimulator 0.7.3.1 and some period before will never see the | 357 | // If we don't check this then OpenSimulator 0.7.3.1 and some period before will never see the |
338 | // actual failure message | 358 | // actual failure message |
@@ -451,7 +471,6 @@ namespace OpenSim.Services.Connectors.Simulation | |||
451 | args["destination_name"] = OSD.FromString(destination.RegionName); | 471 | args["destination_name"] = OSD.FromString(destination.RegionName); |
452 | args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); | 472 | args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); |
453 | 473 | ||
454 | |||
455 | OSDMap result = WebUtil.PostToService(uri, args, 40000, false); | 474 | OSDMap result = WebUtil.PostToService(uri, args, 40000, false); |
456 | 475 | ||
457 | if (result == null) | 476 | if (result == null) |