diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 0e22156..12058c8 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; |
@@ -177,41 +177,45 @@ namespace OpenSim.Region.Framework.Scenes | |||
177 | 177 | ||
178 | } | 178 | } |
179 | 179 | ||
180 | public delegate void SendCloseChildAgentDelegate(UUID agentID, ulong regionHandle); | ||
181 | |||
180 | /// <summary> | 182 | /// <summary> |
181 | /// Closes a child agent on a given region | 183 | /// This Closes child agents on neighboring regions |
184 | /// Calls an asynchronous method to do so.. so it doesn't lag the sim. | ||
182 | /// </summary> | 185 | /// </summary> |
183 | protected void SendCloseChildAgent(UUID agentID, ulong regionHandle) | 186 | protected void SendCloseChildAgentAsync(UUID agentID, ulong regionHandle) |
184 | { | 187 | { |
185 | m_log.Debug("[INTERGRID]: Sending close agent to " + regionHandle); | 188 | |
189 | //m_log.Debug("[INTERGRID]: Sending close agent to " + regionHandle); | ||
186 | // let's do our best, but there's not much we can do if the neighbour doesn't accept. | 190 | // let's do our best, but there's not much we can do if the neighbour doesn't accept. |
187 | 191 | ||
188 | //m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID); | 192 | //m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID); |
189 | uint x = 0, y = 0; | 193 | uint x = 0, y = 0; |
190 | Utils.LongToUInts(regionHandle, out x, out y); | 194 | Utils.LongToUInts(regionHandle, out x, out y); |
191 | GridRegion destination = m_scene.GridService.GetRegionByPosition(m_regionInfo.ScopeID, (int)x, (int)y); | 195 | GridRegion destination = m_scene.GridService.GetRegionByPosition(m_regionInfo.ScopeID, (int)x, (int)y); |
192 | m_scene.SimulationService.CloseAgent(destination, agentID); | 196 | m_scene.SimulationService.CloseChildAgent(destination, agentID); |
197 | } | ||
198 | |||
199 | private void SendCloseChildAgentCompleted(IAsyncResult iar) | ||
200 | { | ||
201 | SendCloseChildAgentDelegate icon = (SendCloseChildAgentDelegate)iar.AsyncState; | ||
202 | icon.EndInvoke(iar); | ||
193 | } | 203 | } |
194 | 204 | ||
195 | /// <summary> | ||
196 | /// Closes a child agents in a collection of regions. Does so asynchronously | ||
197 | /// so that the caller doesn't wait. | ||
198 | /// </summary> | ||
199 | /// <param name="agentID"></param> | ||
200 | /// <param name="regionslst"></param> | ||
201 | public void SendCloseChildAgentConnections(UUID agentID, List<ulong> regionslst) | 205 | public void SendCloseChildAgentConnections(UUID agentID, List<ulong> regionslst) |
202 | { | 206 | { |
203 | Util.FireAndForget(delegate | 207 | foreach (ulong handle in regionslst) |
204 | { | 208 | { |
205 | foreach (ulong handle in regionslst) | 209 | SendCloseChildAgentDelegate d = SendCloseChildAgentAsync; |
206 | { | 210 | d.BeginInvoke(agentID, handle, |
207 | SendCloseChildAgent(agentID, handle); | 211 | SendCloseChildAgentCompleted, |
208 | } | 212 | d); |
209 | }); | 213 | } |
210 | } | 214 | } |
211 | 215 | ||
212 | public List<GridRegion> RequestNamedRegions(string name, int maxNumber) | 216 | public List<GridRegion> RequestNamedRegions(string name, int maxNumber) |
213 | { | 217 | { |
214 | return m_scene.GridService.GetRegionsByName(UUID.Zero, name, maxNumber); | 218 | return m_scene.GridService.GetRegionsByName(UUID.Zero, name, maxNumber); |
215 | } | 219 | } |
216 | } | 220 | } |
217 | } \ No newline at end of file | 221 | } |