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