diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 53 |
1 files changed, 45 insertions, 8 deletions
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 98c5312..c19421a 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | |||
@@ -120,6 +120,8 @@ namespace OpenSim.Server.Handlers.Simulation | |||
120 | 120 | ||
121 | protected virtual void DoQueryAccess(Hashtable request, Hashtable responsedata, UUID agentID, UUID regionID) | 121 | protected virtual void DoQueryAccess(Hashtable request, Hashtable responsedata, UUID agentID, UUID regionID) |
122 | { | 122 | { |
123 | EntityTransferContext ctx = new EntityTransferContext(); | ||
124 | |||
123 | if (m_SimulationService == null) | 125 | if (m_SimulationService == null) |
124 | { | 126 | { |
125 | m_log.Debug("[AGENT HANDLER]: Agent QUERY called. Harmless but useless."); | 127 | m_log.Debug("[AGENT HANDLER]: Agent QUERY called. Harmless but useless."); |
@@ -155,6 +157,9 @@ namespace OpenSim.Server.Handlers.Simulation | |||
155 | theirVersion = float.Parse(parts[1]); | 157 | theirVersion = float.Parse(parts[1]); |
156 | } | 158 | } |
157 | 159 | ||
160 | if (args.ContainsKey("context")) | ||
161 | ctx.Unpack((OSDMap)args["context"]); | ||
162 | |||
158 | // Decode the new versioning data | 163 | // Decode the new versioning data |
159 | float minVersionRequired = 0f; | 164 | float minVersionRequired = 0f; |
160 | float maxVersionRequired = 0f; | 165 | float maxVersionRequired = 0f; |
@@ -245,7 +250,6 @@ namespace OpenSim.Server.Handlers.Simulation | |||
245 | 250 | ||
246 | string reason; | 251 | string reason; |
247 | // We're sending the version numbers down to the local connector to do the varregion check. | 252 | // We're sending the version numbers down to the local connector to do the varregion check. |
248 | EntityTransferContext ctx = new EntityTransferContext(); | ||
249 | ctx.InboundVersion = inboundVersion; | 253 | ctx.InboundVersion = inboundVersion; |
250 | ctx.OutboundVersion = outboundVersion; | 254 | ctx.OutboundVersion = outboundVersion; |
251 | if (minVersionProvided == 0f) | 255 | if (minVersionProvided == 0f) |
@@ -262,7 +266,6 @@ namespace OpenSim.Server.Handlers.Simulation | |||
262 | resp["version"] = OSD.FromString(legacyVersion); | 266 | resp["version"] = OSD.FromString(legacyVersion); |
263 | resp["negotiated_inbound_version"] = OSD.FromReal(inboundVersion); | 267 | resp["negotiated_inbound_version"] = OSD.FromReal(inboundVersion); |
264 | resp["negotiated_outbound_version"] = OSD.FromReal(outboundVersion); | 268 | resp["negotiated_outbound_version"] = OSD.FromReal(outboundVersion); |
265 | resp["variable_wearables_count_supported"] = OSD.FromBoolean(true); | ||
266 | 269 | ||
267 | OSDArray featuresWanted = new OSDArray(); | 270 | OSDArray featuresWanted = new OSDArray(); |
268 | foreach (UUID feature in features) | 271 | foreach (UUID feature in features) |
@@ -407,6 +410,8 @@ namespace OpenSim.Server.Handlers.Simulation | |||
407 | 410 | ||
408 | protected void DoAgentPost(Hashtable request, Hashtable responsedata, UUID id) | 411 | protected void DoAgentPost(Hashtable request, Hashtable responsedata, UUID id) |
409 | { | 412 | { |
413 | EntityTransferContext ctx = new EntityTransferContext(); | ||
414 | |||
410 | OSDMap args = Utils.GetOSDMap((string)request["body"]); | 415 | OSDMap args = Utils.GetOSDMap((string)request["body"]); |
411 | if (args == null) | 416 | if (args == null) |
412 | { | 417 | { |
@@ -415,6 +420,9 @@ namespace OpenSim.Server.Handlers.Simulation | |||
415 | return; | 420 | return; |
416 | } | 421 | } |
417 | 422 | ||
423 | if (args.ContainsKey("context")) | ||
424 | ctx.Unpack((OSDMap)args["context"]); | ||
425 | |||
418 | AgentDestinationData data = CreateAgentDestinationData(); | 426 | AgentDestinationData data = CreateAgentDestinationData(); |
419 | UnpackData(args, data, request); | 427 | UnpackData(args, data, request); |
420 | 428 | ||
@@ -461,7 +469,8 @@ namespace OpenSim.Server.Handlers.Simulation | |||
461 | // This is the meaning of POST agent | 469 | // This is the meaning of POST agent |
462 | //m_regionClient.AdjustUserInformation(aCircuit); | 470 | //m_regionClient.AdjustUserInformation(aCircuit); |
463 | //bool result = m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out reason); | 471 | //bool result = m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out reason); |
464 | bool result = CreateAgent(source, gatekeeper, destination, aCircuit, data.flags, data.fromLogin, out reason); | 472 | |
473 | bool result = CreateAgent(source, gatekeeper, destination, aCircuit, data.flags, data.fromLogin, ctx, out reason); | ||
465 | 474 | ||
466 | resp["reason"] = OSD.FromString(reason); | 475 | resp["reason"] = OSD.FromString(reason); |
467 | resp["success"] = OSD.FromBoolean(result); | 476 | resp["success"] = OSD.FromBoolean(result); |
@@ -536,9 +545,29 @@ namespace OpenSim.Server.Handlers.Simulation | |||
536 | 545 | ||
537 | // subclasses can override this | 546 | // subclasses can override this |
538 | protected virtual bool CreateAgent(GridRegion source, GridRegion gatekeeper, GridRegion destination, | 547 | protected virtual bool CreateAgent(GridRegion source, GridRegion gatekeeper, GridRegion destination, |
539 | AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason) | 548 | AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, EntityTransferContext ctx, out string reason) |
540 | { | 549 | { |
541 | return m_SimulationService.CreateAgent(source, destination, aCircuit, teleportFlags, out reason); | 550 | reason = String.Empty; |
551 | // The data and protocols are already defined so this is just a dummy to satisfy the interface | ||
552 | // TODO: make this end-to-end | ||
553 | if ((teleportFlags & (uint)TeleportFlags.ViaLogin) == 0) | ||
554 | { | ||
555 | Util.FireAndForget(x => | ||
556 | { | ||
557 | string r; | ||
558 | m_SimulationService.CreateAgent(source, destination, aCircuit, teleportFlags, ctx, out r); | ||
559 | m_log.DebugFormat("[AGENT HANDLER]: ASYNC CreateAgent {0}", r); | ||
560 | }); | ||
561 | |||
562 | return true; | ||
563 | } | ||
564 | else | ||
565 | { | ||
566 | |||
567 | bool ret = m_SimulationService.CreateAgent(source, destination, aCircuit, teleportFlags, ctx, out reason); | ||
568 | m_log.DebugFormat("[AGENT HANDLER]: SYNC CreateAgent {0} {1}", ret.ToString(), reason); | ||
569 | return ret; | ||
570 | } | ||
542 | } | 571 | } |
543 | } | 572 | } |
544 | 573 | ||
@@ -639,6 +668,9 @@ namespace OpenSim.Server.Handlers.Simulation | |||
639 | 668 | ||
640 | protected void DoAgentPut(Hashtable request, Hashtable responsedata) | 669 | protected void DoAgentPut(Hashtable request, Hashtable responsedata) |
641 | { | 670 | { |
671 | // TODO: Encode the ENtityTransferContext | ||
672 | EntityTransferContext ctx = new EntityTransferContext(); | ||
673 | |||
642 | OSDMap args = Utils.GetOSDMap((string)request["body"]); | 674 | OSDMap args = Utils.GetOSDMap((string)request["body"]); |
643 | if (args == null) | 675 | if (args == null) |
644 | { | 676 | { |
@@ -659,6 +691,8 @@ namespace OpenSim.Server.Handlers.Simulation | |||
659 | UUID.TryParse(args["destination_uuid"].AsString(), out uuid); | 691 | UUID.TryParse(args["destination_uuid"].AsString(), out uuid); |
660 | if (args.ContainsKey("destination_name") && args["destination_name"] != null) | 692 | if (args.ContainsKey("destination_name") && args["destination_name"] != null) |
661 | regionname = args["destination_name"].ToString(); | 693 | regionname = args["destination_name"].ToString(); |
694 | if (args.ContainsKey("context")) | ||
695 | ctx.Unpack((OSDMap)args["context"]); | ||
662 | 696 | ||
663 | GridRegion destination = new GridRegion(); | 697 | GridRegion destination = new GridRegion(); |
664 | destination.RegionID = uuid; | 698 | destination.RegionID = uuid; |
@@ -681,7 +715,7 @@ namespace OpenSim.Server.Handlers.Simulation | |||
681 | AgentData agent = new AgentData(); | 715 | AgentData agent = new AgentData(); |
682 | try | 716 | try |
683 | { | 717 | { |
684 | agent.Unpack(args, m_SimulationService.GetScene(destination.RegionID)); | 718 | agent.Unpack(args, m_SimulationService.GetScene(destination.RegionID), ctx); |
685 | } | 719 | } |
686 | catch (Exception ex) | 720 | catch (Exception ex) |
687 | { | 721 | { |
@@ -700,7 +734,7 @@ namespace OpenSim.Server.Handlers.Simulation | |||
700 | AgentPosition agent = new AgentPosition(); | 734 | AgentPosition agent = new AgentPosition(); |
701 | try | 735 | try |
702 | { | 736 | { |
703 | agent.Unpack(args, m_SimulationService.GetScene(destination.RegionID)); | 737 | agent.Unpack(args, m_SimulationService.GetScene(destination.RegionID), ctx); |
704 | } | 738 | } |
705 | catch (Exception ex) | 739 | catch (Exception ex) |
706 | { | 740 | { |
@@ -721,7 +755,10 @@ namespace OpenSim.Server.Handlers.Simulation | |||
721 | // subclasses can override this | 755 | // subclasses can override this |
722 | protected virtual bool UpdateAgent(GridRegion destination, AgentData agent) | 756 | protected virtual bool UpdateAgent(GridRegion destination, AgentData agent) |
723 | { | 757 | { |
724 | return m_SimulationService.UpdateAgent(destination, agent); | 758 | // The data and protocols are already defined so this is just a dummy to satisfy the interface |
759 | // TODO: make this end-to-end | ||
760 | EntityTransferContext ctx = new EntityTransferContext(); | ||
761 | return m_SimulationService.UpdateAgent(destination, agent, ctx); | ||
725 | } | 762 | } |
726 | } | 763 | } |
727 | 764 | ||