From f88e4a1ec914ddaa9680a62faf96241b87fd0e06 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 2 Nov 2015 00:23:38 +0100 Subject: Plumb the rest of the context stuff. Well, what I see so far anyway --- OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs | 2 +- OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs | 2 +- OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 18 ++++++++++++++---- 3 files changed, 16 insertions(+), 6 deletions(-) (limited to 'OpenSim/Server') diff --git a/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs index 95a0510..f3d678f 100644 --- a/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs @@ -62,7 +62,7 @@ namespace OpenSim.Server.Handlers.Hypergrid } protected override bool CreateAgent(GridRegion source, GridRegion gatekeeper, GridRegion destination, - AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason) + AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, EntityTransferContext ctx, out string reason) { return m_GatekeeperService.LoginAgent(source, aCircuit, destination, out reason); } diff --git a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs index e787f7c..367c481 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs @@ -118,7 +118,7 @@ namespace OpenSim.Server.Handlers.Hypergrid protected override bool CreateAgent(GridRegion source, GridRegion gatekeeper, GridRegion destination, - AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason) + AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, EntityTransferContext ctx, out string reason) { return m_UserAgentService.LoginAgentToGrid(source, aCircuit, gatekeeper, destination, fromLogin, out reason); } diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 7ab7dea..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 protected virtual void DoQueryAccess(Hashtable request, Hashtable responsedata, UUID agentID, UUID regionID) { + EntityTransferContext ctx = new EntityTransferContext(); + if (m_SimulationService == null) { m_log.Debug("[AGENT HANDLER]: Agent QUERY called. Harmless but useless."); @@ -155,6 +157,9 @@ namespace OpenSim.Server.Handlers.Simulation theirVersion = float.Parse(parts[1]); } + if (args.ContainsKey("context")) + ctx.Unpack((OSDMap)args["context"]); + // Decode the new versioning data float minVersionRequired = 0f; float maxVersionRequired = 0f; @@ -245,7 +250,6 @@ namespace OpenSim.Server.Handlers.Simulation string 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; if (minVersionProvided == 0f) @@ -406,6 +410,8 @@ namespace OpenSim.Server.Handlers.Simulation protected void DoAgentPost(Hashtable request, Hashtable responsedata, UUID id) { + EntityTransferContext ctx = new EntityTransferContext(); + OSDMap args = Utils.GetOSDMap((string)request["body"]); if (args == null) { @@ -414,6 +420,9 @@ namespace OpenSim.Server.Handlers.Simulation return; } + if (args.ContainsKey("context")) + ctx.Unpack((OSDMap)args["context"]); + AgentDestinationData data = CreateAgentDestinationData(); UnpackData(args, data, request); @@ -461,7 +470,7 @@ namespace OpenSim.Server.Handlers.Simulation //m_regionClient.AdjustUserInformation(aCircuit); //bool result = m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out reason); - bool result = CreateAgent(source, gatekeeper, destination, aCircuit, data.flags, data.fromLogin, out reason); + bool result = CreateAgent(source, gatekeeper, destination, aCircuit, data.flags, data.fromLogin, ctx, out reason); resp["reason"] = OSD.FromString(reason); resp["success"] = OSD.FromBoolean(result); @@ -536,12 +545,11 @@ namespace OpenSim.Server.Handlers.Simulation // subclasses can override this protected virtual bool CreateAgent(GridRegion source, GridRegion gatekeeper, GridRegion destination, - AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason) + AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, EntityTransferContext ctx, out string reason) { reason = String.Empty; // The data and protocols are already defined so this is just a dummy to satisfy the interface // TODO: make this end-to-end - EntityTransferContext ctx = new EntityTransferContext(); if ((teleportFlags & (uint)TeleportFlags.ViaLogin) == 0) { Util.FireAndForget(x => @@ -683,6 +691,8 @@ namespace OpenSim.Server.Handlers.Simulation UUID.TryParse(args["destination_uuid"].AsString(), out uuid); if (args.ContainsKey("destination_name") && args["destination_name"] != null) regionname = args["destination_name"].ToString(); + if (args.ContainsKey("context")) + ctx.Unpack((OSDMap)args["context"]); GridRegion destination = new GridRegion(); destination.RegionID = uuid; -- cgit v1.1