From 217ffee8cb50e0a7ddfc0d4c4e4bb6a68de909d8 Mon Sep 17 00:00:00 2001 From: diva Date: Sat, 14 Feb 2009 16:37:55 +0000 Subject: Moved RegionUp to REST/LocalComms. The original functionality has been entirely maintained, although it will have to be revisited soon, because it's buggy. --- .../Framework/Interfaces/IInterregionComms.cs | 23 +++++++++++++++++++++- OpenSim/Region/Framework/Scenes/Scene.cs | 11 ++++++++++- .../Framework/Scenes/SceneCommunicationService.cs | 10 ++++++---- 3 files changed, 38 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IInterregionComms.cs b/OpenSim/Region/Framework/Interfaces/IInterregionComms.cs index d3f44bb..0b62df2 100644 --- a/OpenSim/Region/Framework/Interfaces/IInterregionComms.cs +++ b/OpenSim/Region/Framework/Interfaces/IInterregionComms.cs @@ -32,8 +32,11 @@ namespace OpenSim.Region.Framework.Interfaces { public delegate bool ChildAgentUpdateReceived(AgentData data); - public interface IInterregionCommsOut + public interface IInterregionCommsOut { + + #region Agents + bool SendCreateChildAgent(ulong regionHandle, AgentCircuitData aCircuit); /// @@ -70,8 +73,26 @@ namespace OpenSim.Region.Framework.Interfaces /// bool SendCloseAgent(ulong regionHandle, UUID id); + #endregion Agents + + #region Objects + + /// + /// Create an object in the destination region. This message is used primarily for prim crossing. + /// + /// + /// + /// + /// bool SendCreateObject(ulong regionHandle, ISceneObject sog, bool isLocalCall); + #endregion Objects + + #region Regions + + bool SendHelloNeighbour(ulong regionHandle, RegionInfo thisRegion); + + #endregion Regions } // This may not be needed, but having it here for now. diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index c31e6f7..b42c46e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -422,6 +422,8 @@ namespace OpenSim.Region.Framework.Scenes /// True after all operations complete, throws exceptions otherwise. public override bool OtherRegionUp(RegionInfo otherRegion) { + m_log.InfoFormat("[SCENE]: Region {0} up in coords {1}-{2}", otherRegion.RegionName, otherRegion.RegionLocX, otherRegion.RegionLocY); + if (RegionInfo.RegionHandle != otherRegion.RegionHandle) { for (int i = 0; i < m_neighbours.Count; i++) @@ -517,6 +519,13 @@ namespace OpenSim.Region.Framework.Scenes return found; } + + // Alias IncomingHelloNeighbour OtherRegionUp, for now + public bool IncomingHelloNeighbour(RegionInfo neighbour) + { + return OtherRegionUp(neighbour); + } + /// /// Given float seconds, this will restart the region. /// @@ -2569,7 +2578,7 @@ namespace OpenSim.Region.Framework.Scenes /// public void InformClientOfNeighbor(ScenePresence presence, RegionInfo region) { - m_sceneGridService.InformNeighborChildAgent(presence, region, m_neighbours); + m_sceneGridService.InformNeighborChildAgent(presence, region); } /// diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 2f0bbb2..4c10e2c 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -459,7 +459,7 @@ namespace OpenSim.Region.Framework.Scenes /// This informs a single neighboring region about agent "avatar". /// Calls an asynchronous method to do so.. so it doesn't lag the sim. /// - public void InformNeighborChildAgent(ScenePresence avatar, SimpleRegionInfo region, List neighbours) + public void InformNeighborChildAgent(ScenePresence avatar, SimpleRegionInfo region) { AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo(); agent.BaseFolder = UUID.Zero; @@ -493,8 +493,10 @@ namespace OpenSim.Region.Framework.Scenes m_log.Info("[INTERGRID]: Starting to inform neighbors that I'm here"); //RegionUpData regiondata = new RegionUpData(region.RegionLocX, region.RegionLocY, region.ExternalHostName, region.InternalEndPoint.Port); - bool regionAccepted = - m_commsProvider.InterRegion.RegionUp(new SerializableRegionInfo(region), regionhandle); + //bool regionAccepted = + // m_commsProvider.InterRegion.RegionUp(new SerializableRegionInfo(region), regionhandle); + + bool regionAccepted = m_interregionCommsOut.SendHelloNeighbour(regionhandle, region); if (regionAccepted) { @@ -519,7 +521,7 @@ namespace OpenSim.Region.Framework.Scenes { //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName); - + List neighbours = new List(); // This stays uncached because we don't already know about our neighbors at this point. neighbours = m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY); -- cgit v1.1