From b2e6ec9e12ad07eb08496ebe8ca0476b793017d5 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 17 Jan 2010 18:04:55 -0800 Subject: Agent gets there through the Gatekeeper, but still a few quirks to fix. --- .../EntityTransfer/EntityTransferModule.cs | 23 +++++++++++++----- .../EntityTransfer/HGEntityTransferModule.cs | 27 ++++++++++++++++++++++ 2 files changed, 44 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/CoreModules/Framework') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index d0171fe..8268bfa 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -239,12 +239,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer //avatar.Scene.RemoveCapsHandler(avatar.UUID); string capsPath = String.Empty; + + AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); AgentCircuitData agentCircuit = sp.ControllingClient.RequestClientInfo(); - agentCircuit.BaseFolder = UUID.Zero; - agentCircuit.InventoryFolder = UUID.Zero; agentCircuit.startpos = position; agentCircuit.child = true; agentCircuit.Appearance = sp.Appearance; + if (currentAgentCircuit != null) + agentCircuit.ServiceURLs = currentAgentCircuit.ServiceURLs; if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) { @@ -255,9 +257,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer string reason = String.Empty; // Let's create an agent there if one doesn't exist yet. - if (!m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason)) + if (!CreateAgent(reg, finalDestination, agentCircuit, teleportFlags, out reason)) { - sp.ControllingClient.SendTeleportFailed(String.Format("Destination is not accepting teleports: {0}", + sp.ControllingClient.SendTeleportFailed(String.Format("Destination refused: {0}", reason)); return; } @@ -345,8 +347,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer agent.CallbackURI = "http://" + sp.Scene.RegionInfo.ExternalHostName + ":" + sp.Scene.RegionInfo.HttpPort + "/agent/" + sp.UUID.ToString() + "/" + sp.Scene.RegionInfo.RegionID.ToString() + "/release/"; - // Straight to the region. Safe. - m_aScene.SimulationService.UpdateAgent(reg, agent); + UpdateAgent(reg, finalDestination, agent); m_log.DebugFormat( "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, sp.UUID); @@ -444,6 +445,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer } } + protected virtual bool CreateAgent(GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason) + { + return m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason); + } + + protected virtual bool UpdateAgent(GridRegion reg, GridRegion finalDestination, AgentData agent) + { + return m_aScene.SimulationService.UpdateAgent(reg, agent); + } + protected void KillEntity(Scene scene, uint localID) { scene.SendKillObject(localID); diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 5d88311..e5a862d 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Reflection; +using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Connectors.Hypergrid; @@ -58,6 +59,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer } } + private GatekeeperServiceConnector m_GatekeeperConnector; + #region ISharedRegionModule public override string Name @@ -74,6 +77,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (name == Name) { m_agentsInTransit = new List(); + m_GatekeeperConnector = new GatekeeperServiceConnector(); m_Enabled = true; m_log.InfoFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name); } @@ -131,6 +135,29 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer return true; } + protected override bool CreateAgent(GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason) + { + reason = string.Empty; + if (reg.RegionLocX != finalDestination.RegionLocX && reg.RegionLocY != finalDestination.RegionLocY) + { + // this user is going to another grid + reg.RegionName = finalDestination.RegionName; + return m_GatekeeperConnector.CreateAgent(reg, agentCircuit, teleportFlags, out reason); + } + + return m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason); + } + + protected override bool UpdateAgent(GridRegion reg, GridRegion finalDestination, AgentData agent) + { + if (reg.RegionLocX != finalDestination.RegionLocX && reg.RegionLocY != finalDestination.RegionLocY) + { + // this user is going to another grid + return m_GatekeeperConnector.UpdateAgent(reg, agent); + } + + return m_aScene.SimulationService.UpdateAgent(reg, agent); + } #endregion } -- cgit v1.1