diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index d76ed3e..27833e8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -88,7 +88,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
88 | 88 | ||
89 | if (neighbour != null) | 89 | if (neighbour != null) |
90 | { | 90 | { |
91 | m_log.DebugFormat("[INTERGRID]: Successfully informed neighbour {0}-{1} that I'm here", x / Constants.RegionSize, y / Constants.RegionSize); | 91 | // m_log.DebugFormat("[INTERGRID]: Successfully informed neighbour {0}-{1} that I'm here", x / Constants.RegionSize, y / Constants.RegionSize); |
92 | m_scene.EventManager.TriggerOnRegionUp(neighbour); | 92 | m_scene.EventManager.TriggerOnRegionUp(neighbour); |
93 | } | 93 | } |
94 | else | 94 | else |
@@ -102,7 +102,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
102 | //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName); | 102 | //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName); |
103 | 103 | ||
104 | List<GridRegion> neighbours = m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID); | 104 | List<GridRegion> neighbours = m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID); |
105 | m_log.DebugFormat("[INTERGRID]: Informing {0} neighbours that this region is up", neighbours.Count); | 105 | //m_log.DebugFormat("[INTERGRID]: Informing {0} neighbours that this region is up", neighbours.Count); |
106 | foreach (GridRegion n in neighbours) | 106 | foreach (GridRegion n in neighbours) |
107 | { | 107 | { |
108 | InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync; | 108 | InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync; |
@@ -176,10 +176,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
176 | } | 176 | } |
177 | } | 177 | } |
178 | 178 | ||
179 | public delegate void SendCloseChildAgentDelegate(UUID agentID, ulong regionHandle); | ||
180 | |||
179 | /// <summary> | 181 | /// <summary> |
180 | /// Closes a child agent on a given region | 182 | /// This Closes child agents on neighboring regions |
183 | /// Calls an asynchronous method to do so.. so it doesn't lag the sim. | ||
181 | /// </summary> | 184 | /// </summary> |
182 | protected void SendCloseChildAgent(UUID agentID, ulong regionHandle) | 185 | protected void SendCloseChildAgentAsync(UUID agentID, ulong regionHandle) |
183 | { | 186 | { |
184 | // let's do our best, but there's not much we can do if the neighbour doesn't accept. | 187 | // let's do our best, but there's not much we can do if the neighbour doesn't accept. |
185 | 188 | ||
@@ -188,34 +191,29 @@ namespace OpenSim.Region.Framework.Scenes | |||
188 | Utils.LongToUInts(regionHandle, out x, out y); | 191 | Utils.LongToUInts(regionHandle, out x, out y); |
189 | 192 | ||
190 | GridRegion destination = m_scene.GridService.GetRegionByPosition(m_regionInfo.ScopeID, (int)x, (int)y); | 193 | GridRegion destination = m_scene.GridService.GetRegionByPosition(m_regionInfo.ScopeID, (int)x, (int)y); |
194 | m_scene.SimulationService.CloseChildAgent(destination, agentID); | ||
195 | } | ||
191 | 196 | ||
192 | m_log.DebugFormat( | 197 | private void SendCloseChildAgentCompleted(IAsyncResult iar) |
193 | "[INTERGRID]: Sending close agent {0} to region at {1}-{2}", | 198 | { |
194 | agentID, destination.RegionCoordX, destination.RegionCoordY); | 199 | SendCloseChildAgentDelegate icon = (SendCloseChildAgentDelegate)iar.AsyncState; |
195 | 200 | icon.EndInvoke(iar); | |
196 | m_scene.SimulationService.CloseAgent(destination, agentID); | ||
197 | } | 201 | } |
198 | 202 | ||
199 | /// <summary> | ||
200 | /// Closes a child agents in a collection of regions. Does so asynchronously | ||
201 | /// so that the caller doesn't wait. | ||
202 | /// </summary> | ||
203 | /// <param name="agentID"></param> | ||
204 | /// <param name="regionslst"></param> | ||
205 | public void SendCloseChildAgentConnections(UUID agentID, List<ulong> regionslst) | 203 | public void SendCloseChildAgentConnections(UUID agentID, List<ulong> regionslst) |
206 | { | 204 | { |
207 | Util.FireAndForget(delegate | 205 | foreach (ulong handle in regionslst) |
208 | { | 206 | { |
209 | foreach (ulong handle in regionslst) | 207 | SendCloseChildAgentDelegate d = SendCloseChildAgentAsync; |
210 | { | 208 | d.BeginInvoke(agentID, handle, |
211 | SendCloseChildAgent(agentID, handle); | 209 | SendCloseChildAgentCompleted, |
212 | } | 210 | d); |
213 | }); | 211 | } |
214 | } | 212 | } |
215 | 213 | ||
216 | public List<GridRegion> RequestNamedRegions(string name, int maxNumber) | 214 | public List<GridRegion> RequestNamedRegions(string name, int maxNumber) |
217 | { | 215 | { |
218 | return m_scene.GridService.GetRegionsByName(UUID.Zero, name, maxNumber); | 216 | return m_scene.GridService.GetRegionsByName(UUID.Zero, name, maxNumber); |
219 | } | 217 | } |
220 | } | 218 | } |
221 | } \ No newline at end of file | 219 | } |