diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index eccce89..fe9fe31 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -164,7 +164,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
164 | 164 | ||
165 | if (neighbour != null) | 165 | if (neighbour != null) |
166 | { | 166 | { |
167 | m_log.DebugFormat("[INTERGRID]: Successfully informed neighbour {0}-{1} that I'm here", x / Constants.RegionSize, y / Constants.RegionSize); | 167 | // m_log.DebugFormat("[INTERGRID]: Successfully informed neighbour {0}-{1} that I'm here", x / Constants.RegionSize, y / Constants.RegionSize); |
168 | m_scene.EventManager.TriggerOnRegionUp(neighbour); | 168 | m_scene.EventManager.TriggerOnRegionUp(neighbour); |
169 | } | 169 | } |
170 | else | 170 | else |
@@ -179,7 +179,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
179 | //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName); | 179 | //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName); |
180 | 180 | ||
181 | List<GridRegion> neighbours = m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID); | 181 | List<GridRegion> neighbours = m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID); |
182 | m_log.DebugFormat("[INTERGRID]: Informing {0} neighbours that this region is up", neighbours.Count); | 182 | //m_log.DebugFormat("[INTERGRID]: Informing {0} neighbours that this region is up", neighbours.Count); |
183 | foreach (GridRegion n in neighbours) | 183 | foreach (GridRegion n in neighbours) |
184 | { | 184 | { |
185 | InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync; | 185 | InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync; |
@@ -255,46 +255,42 @@ namespace OpenSim.Region.Framework.Scenes | |||
255 | 255 | ||
256 | } | 256 | } |
257 | 257 | ||
258 | //public delegate void SendCloseChildAgentDelegate(UUID agentID, ulong regionHandle); | 258 | public delegate void SendCloseChildAgentDelegate(UUID agentID, ulong regionHandle); |
259 | //private void SendCloseChildAgentCompleted(IAsyncResult iar) | ||
260 | //{ | ||
261 | // SendCloseChildAgentDelegate icon = (SendCloseChildAgentDelegate)iar.AsyncState; | ||
262 | // icon.EndInvoke(iar); | ||
263 | //} | ||
264 | 259 | ||
265 | /// <summary> | 260 | /// <summary> |
266 | /// Closes a child agent on a given region | 261 | /// This Closes child agents on neighboring regions |
262 | /// Calls an asynchronous method to do so.. so it doesn't lag the sim. | ||
267 | /// </summary> | 263 | /// </summary> |
268 | protected void SendCloseChildAgent(UUID agentID, ulong regionHandle) | 264 | protected void SendCloseChildAgentAsync(UUID agentID, ulong regionHandle) |
269 | { | 265 | { |
270 | 266 | ||
271 | m_log.Debug("[INTERGRID]: Sending close agent to " + regionHandle); | 267 | //m_log.Debug("[INTERGRID]: Sending close agent to " + regionHandle); |
272 | // let's do our best, but there's not much we can do if the neighbour doesn't accept. | 268 | // let's do our best, but there's not much we can do if the neighbour doesn't accept. |
273 | 269 | ||
274 | //m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID); | 270 | //m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID); |
275 | uint x = 0, y = 0; | 271 | uint x = 0, y = 0; |
276 | Utils.LongToUInts(regionHandle, out x, out y); | 272 | Utils.LongToUInts(regionHandle, out x, out y); |
277 | GridRegion destination = m_scene.GridService.GetRegionByPosition(m_regionInfo.ScopeID, (int)x, (int)y); | 273 | GridRegion destination = m_scene.GridService.GetRegionByPosition(m_regionInfo.ScopeID, (int)x, (int)y); |
278 | m_scene.SimulationService.CloseAgent(destination, agentID); | 274 | m_scene.SimulationService.CloseChildAgent(destination, agentID); |
275 | } | ||
276 | |||
277 | private void SendCloseChildAgentCompleted(IAsyncResult iar) | ||
278 | { | ||
279 | SendCloseChildAgentDelegate icon = (SendCloseChildAgentDelegate)iar.AsyncState; | ||
280 | icon.EndInvoke(iar); | ||
279 | } | 281 | } |
280 | 282 | ||
281 | /// <summary> | ||
282 | /// Closes a child agents in a collection of regions. Does so asynchronously | ||
283 | /// so that the caller doesn't wait. | ||
284 | /// </summary> | ||
285 | /// <param name="agentID"></param> | ||
286 | /// <param name="regionslst"></param> | ||
287 | public void SendCloseChildAgentConnections(UUID agentID, List<ulong> regionslst) | 283 | public void SendCloseChildAgentConnections(UUID agentID, List<ulong> regionslst) |
288 | { | 284 | { |
289 | Util.FireAndForget(delegate | 285 | foreach (ulong handle in regionslst) |
290 | { | 286 | { |
291 | foreach (ulong handle in regionslst) | 287 | SendCloseChildAgentDelegate d = SendCloseChildAgentAsync; |
292 | { | 288 | d.BeginInvoke(agentID, handle, |
293 | SendCloseChildAgent(agentID, handle); | 289 | SendCloseChildAgentCompleted, |
294 | } | 290 | d); |
295 | }); | 291 | } |
296 | } | 292 | } |
297 | 293 | ||
298 | public List<GridRegion> RequestNamedRegions(string name, int maxNumber) | 294 | public List<GridRegion> RequestNamedRegions(string name, int maxNumber) |
299 | { | 295 | { |
300 | return m_scene.GridService.GetRegionsByName(UUID.Zero, name, maxNumber); | 296 | return m_scene.GridService.GetRegionsByName(UUID.Zero, name, maxNumber); |