From 81ba94fde8871df86e304a3dad7846059fd32045 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 29 Nov 2007 02:07:19 +0000 Subject: * Fixed about 7 issues with restarting sims and resolved interRegion comms issues. This includes the issue that MW described this morning. There's a lot of little nit picky changes that make a world of difference. --- .../Scenes/SceneCommunicationService.cs | 56 ++++++++++++++++++++-- 1 file changed, 51 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs') diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 892bf81..aad78d5 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs @@ -58,6 +58,7 @@ namespace OpenSim.Region.Environment.Scenes //MainLog.Instance.Verbose("INTER", debugRegionName + ": SceneCommunicationService: registered with gridservice and got" + regionCommsHost.ToString()); regionCommsHost.debugRegionName = _debugRegionName; + regionCommsHost.OnExpectUser += NewUserConnection; regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing; regionCommsHost.OnPrimCrossingIntoRegion += PrimCrossing; @@ -222,7 +223,56 @@ namespace OpenSim.Region.Environment.Scenes } #endregion + public delegate void InformNeighbourThatRegionUpDelegate(RegionInfo region, ulong regionhandle); + + private void InformNeighborsThatRegionisUpCompleted(IAsyncResult iar) + { + InformNeighbourThatRegionUpDelegate icon = (InformNeighbourThatRegionUpDelegate)iar.AsyncState; + icon.EndInvoke(iar); + } + + + private void InformNeighboursThatRegionIsUpAsync(RegionInfo region, ulong regionhandle) + { + MainLog.Instance.Notice("INTERGRID", "Starting to inform neighbors that I'm here"); + bool regionAccepted = m_commsProvider.InterRegion.RegionUp((new SearializableRegionInfo(region)), regionhandle); + + if (regionAccepted) + { + MainLog.Instance.Notice("INTERGRID", "Completed informing neighbors that I'm here"); + } + else + { + MainLog.Instance.Notice("INTERGRID", "Failed to inform neighbors that I'm here"); + } + } + public void InformNeighborsThatRegionisUp(RegionInfo region) + { + //MainLog.Instance.Verbose("INTER", debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName); + List neighbours = new List(); + + lock (neighbours) + { + neighbours = m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY); + if (neighbours != null) + { + for (int i = 0; i < neighbours.Count; i++) + { + + InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync; + // race condition! Arg! I hate race conditions. + lock (d) + { + d.BeginInvoke(region, neighbours[i].RegionHandle, + InformNeighborsThatRegionisUpCompleted, + d); + } + } + } + } + //bool val = m_commsProvider.InterRegion.RegionUp(new SearializableRegionInfo(region)); + } /// /// /// @@ -320,11 +370,7 @@ namespace OpenSim.Region.Environment.Scenes return m_commsProvider.InterRegion.ExpectAvatarCrossing(regionhandle, agentID, position, isFlying); } - public void InformNeighborsThatRegionisUp(RegionInfo region) - { - //MainLog.Instance.Verbose("INTER", debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName); - bool val = m_commsProvider.InterRegion.RegionUp(new SearializableRegionInfo(region)); - } + public bool PrimCrossToNeighboringRegion(ulong regionhandle, LLUUID primID, LLVector3 position, bool isPhysical) { -- cgit v1.1