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