From f1c30784ac767bf5f62e81748984b76d85d71f6a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 15 Jan 2010 15:11:58 -0800 Subject: * General cleanup of Teleports, Crossings and Child agents. They are now in the new AgentTransferModule, in line with what MW started implementing back in May -- ITeleportModule. This has been renamed IAgentTransferModule, to be more generic. * HGSceneCommunicationService has been deleted * SceneCommunicationService will likely be deleted soon too --- OpenSim/Region/Framework/Scenes/Scene.cs | 67 ++++++++------------------------ 1 file changed, 17 insertions(+), 50 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 48f0331..dcbbe08 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -315,7 +315,7 @@ namespace OpenSim.Region.Framework.Scenes protected IConfigSource m_config; protected IRegionSerialiserModule m_serialiser; protected IDialogModule m_dialogModule; - protected ITeleportModule m_teleportModule; + protected IAgentTransferModule m_teleportModule; protected ICapabilitiesModule m_capsModule; public ICapabilitiesModule CapsModule @@ -901,7 +901,7 @@ namespace OpenSim.Region.Framework.Scenes regInfo.RegionName = otherRegion.RegionName; regInfo.ScopeID = otherRegion.ScopeID; regInfo.ExternalHostName = otherRegion.ExternalHostName; - + GridRegion r = new GridRegion(regInfo); try { ForEachScenePresence(delegate(ScenePresence agent) @@ -915,7 +915,8 @@ namespace OpenSim.Region.Framework.Scenes List old = new List(); old.Add(otherRegion.RegionHandle); agent.DropOldNeighbours(old); - InformClientOfNeighbor(agent, regInfo); + if (m_teleportModule != null) + m_teleportModule.EnableChildAgent(agent, r); } } ); @@ -1063,6 +1064,7 @@ namespace OpenSim.Region.Framework.Scenes { foreach (RegionInfo region in m_regionRestartNotifyList) { + GridRegion r = new GridRegion(region); try { ForEachScenePresence(delegate(ScenePresence agent) @@ -1070,9 +1072,8 @@ namespace OpenSim.Region.Framework.Scenes // If agent is a root agent. if (!agent.IsChildAgent) { - //agent.ControllingClient.new - //this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo()); - InformClientOfNeighbor(agent, region); + if (m_teleportModule != null) + m_teleportModule.EnableChildAgent(agent, r); } } ); @@ -1217,7 +1218,7 @@ namespace OpenSim.Region.Framework.Scenes m_serialiser = RequestModuleInterface(); m_dialogModule = RequestModuleInterface(); m_capsModule = RequestModuleInterface(); - m_teleportModule = RequestModuleInterface(); + m_teleportModule = RequestModuleInterface(); } #endregion @@ -3783,17 +3784,6 @@ namespace OpenSim.Region.Framework.Scenes return false; } - public virtual bool IncomingReleaseAgent(UUID id) - { - return m_sceneGridService.ReleaseAgent(id); - } - - public void SendReleaseAgent(UUID origin, UUID id, string uri) - { - //m_interregionCommsOut.SendReleaseAgent(regionHandle, id, uri); - SimulationService.ReleaseAgent(origin, id, uri); - } - /// /// Tell a single agent to disconnect from the region. /// @@ -3838,30 +3828,6 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Tell neighboring regions about this agent - /// When the regions respond with a true value, - /// tell the agents about the region. - /// - /// We have to tell the regions about the agents first otherwise it'll deny them access - /// - /// - /// - public void InformClientOfNeighbours(ScenePresence presence) - { - m_sceneGridService.EnableNeighbourChildAgents(presence, m_neighbours); - } - - /// - /// Tell a neighboring region about this agent - /// - /// - /// - public void InformClientOfNeighbor(ScenePresence presence, RegionInfo region) - { - m_sceneGridService.EnableNeighbourChildAgents(presence, m_neighbours); - } - - /// /// Tries to teleport agent to other region. /// /// @@ -3936,16 +3902,12 @@ namespace OpenSim.Region.Framework.Scenes } if (m_teleportModule != null) - { - m_teleportModule.RequestTeleportToLocation(sp, regionHandle, - position, lookAt, teleportFlags); - } + m_teleportModule.Teleport(sp, regionHandle, position, lookAt, teleportFlags); else { - m_sceneGridService.RequestTeleportToLocation(sp, regionHandle, - position, lookAt, teleportFlags); + m_log.DebugFormat("[SCENE]: Unable to perform teleports: no AgentTransferModule is active"); + sp.ControllingClient.SendTeleportFailed("Unable to perform teleports on this simulator."); } - } } @@ -3971,7 +3933,12 @@ namespace OpenSim.Region.Framework.Scenes public void CrossAgentToNewRegion(ScenePresence agent, bool isFlying) { - m_sceneGridService.CrossAgentToNewRegion(this, agent, isFlying); + if (m_teleportModule != null) + m_teleportModule.Cross(agent, isFlying); + else + { + m_log.DebugFormat("[SCENE]: Unable to cross agent to neighbouring region, because there is no AgentTransferModule"); + } } public void SendOutChildAgentUpdates(AgentPosition cadu, ScenePresence presence) -- cgit v1.1