diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 50 |
1 files changed, 21 insertions, 29 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index f8ff308..c8af4c3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -44,8 +44,6 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; | |||
44 | 44 | ||
45 | namespace OpenSim.Region.Framework.Scenes | 45 | namespace OpenSim.Region.Framework.Scenes |
46 | { | 46 | { |
47 | public delegate void KiPrimitiveDelegate(uint localID); | ||
48 | |||
49 | public delegate void RemoveKnownRegionsFromAvatarList(UUID avatarID, List<ulong> regionlst); | 47 | public delegate void RemoveKnownRegionsFromAvatarList(UUID avatarID, List<ulong> regionlst); |
50 | 48 | ||
51 | /// <summary> | 49 | /// <summary> |
@@ -113,8 +111,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
113 | // private LogOffUser handlerLogOffUser = null; | 111 | // private LogOffUser handlerLogOffUser = null; |
114 | // private GetLandData handlerGetLandData = null; // OnGetLandData | 112 | // private GetLandData handlerGetLandData = null; // OnGetLandData |
115 | 113 | ||
116 | public KiPrimitiveDelegate KiPrimitive; | ||
117 | |||
118 | public SceneCommunicationService() | 114 | public SceneCommunicationService() |
119 | { | 115 | { |
120 | } | 116 | } |
@@ -168,7 +164,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
168 | 164 | ||
169 | if (neighbour != null) | 165 | if (neighbour != null) |
170 | { | 166 | { |
171 | 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); |
172 | m_scene.EventManager.TriggerOnRegionUp(neighbour); | 168 | m_scene.EventManager.TriggerOnRegionUp(neighbour); |
173 | } | 169 | } |
174 | else | 170 | else |
@@ -183,7 +179,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
183 | //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); |
184 | 180 | ||
185 | 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); |
186 | 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); |
187 | foreach (GridRegion n in neighbours) | 183 | foreach (GridRegion n in neighbours) |
188 | { | 184 | { |
189 | InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync; | 185 | InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync; |
@@ -258,46 +254,42 @@ namespace OpenSim.Region.Framework.Scenes | |||
258 | 254 | ||
259 | } | 255 | } |
260 | 256 | ||
261 | //public delegate void SendCloseChildAgentDelegate(UUID agentID, ulong regionHandle); | 257 | public delegate void SendCloseChildAgentDelegate(UUID agentID, ulong regionHandle); |
262 | //private void SendCloseChildAgentCompleted(IAsyncResult iar) | ||
263 | //{ | ||
264 | // SendCloseChildAgentDelegate icon = (SendCloseChildAgentDelegate)iar.AsyncState; | ||
265 | // icon.EndInvoke(iar); | ||
266 | //} | ||
267 | 258 | ||
268 | /// <summary> | 259 | /// <summary> |
269 | /// Closes a child agent on a given region | 260 | /// This Closes child agents on neighboring regions |
261 | /// Calls an asynchronous method to do so.. so it doesn't lag the sim. | ||
270 | /// </summary> | 262 | /// </summary> |
271 | protected void SendCloseChildAgent(UUID agentID, ulong regionHandle) | 263 | protected void SendCloseChildAgentAsync(UUID agentID, ulong regionHandle) |
272 | { | 264 | { |
273 | 265 | ||
274 | m_log.Debug("[INTERGRID]: Sending close agent to " + regionHandle); | 266 | //m_log.Debug("[INTERGRID]: Sending close agent to " + regionHandle); |
275 | // let's do our best, but there's not much we can do if the neighbour doesn't accept. | 267 | // let's do our best, but there's not much we can do if the neighbour doesn't accept. |
276 | 268 | ||
277 | //m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID); | 269 | //m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID); |
278 | uint x = 0, y = 0; | 270 | uint x = 0, y = 0; |
279 | Utils.LongToUInts(regionHandle, out x, out y); | 271 | Utils.LongToUInts(regionHandle, out x, out y); |
280 | GridRegion destination = m_scene.GridService.GetRegionByPosition(m_regionInfo.ScopeID, (int)x, (int)y); | 272 | GridRegion destination = m_scene.GridService.GetRegionByPosition(m_regionInfo.ScopeID, (int)x, (int)y); |
281 | m_scene.SimulationService.CloseAgent(destination, agentID); | 273 | m_scene.SimulationService.CloseChildAgent(destination, agentID); |
274 | } | ||
275 | |||
276 | private void SendCloseChildAgentCompleted(IAsyncResult iar) | ||
277 | { | ||
278 | SendCloseChildAgentDelegate icon = (SendCloseChildAgentDelegate)iar.AsyncState; | ||
279 | icon.EndInvoke(iar); | ||
282 | } | 280 | } |
283 | 281 | ||
284 | /// <summary> | ||
285 | /// Closes a child agents in a collection of regions. Does so asynchronously | ||
286 | /// so that the caller doesn't wait. | ||
287 | /// </summary> | ||
288 | /// <param name="agentID"></param> | ||
289 | /// <param name="regionslst"></param> | ||
290 | public void SendCloseChildAgentConnections(UUID agentID, List<ulong> regionslst) | 282 | public void SendCloseChildAgentConnections(UUID agentID, List<ulong> regionslst) |
291 | { | 283 | { |
292 | Util.FireAndForget(delegate | 284 | foreach (ulong handle in regionslst) |
293 | { | 285 | { |
294 | foreach (ulong handle in regionslst) | 286 | SendCloseChildAgentDelegate d = SendCloseChildAgentAsync; |
295 | { | 287 | d.BeginInvoke(agentID, handle, |
296 | SendCloseChildAgent(agentID, handle); | 288 | SendCloseChildAgentCompleted, |
297 | } | 289 | d); |
298 | }); | 290 | } |
299 | } | 291 | } |
300 | 292 | ||
301 | public List<GridRegion> RequestNamedRegions(string name, int maxNumber) | 293 | public List<GridRegion> RequestNamedRegions(string name, int maxNumber) |
302 | { | 294 | { |
303 | return m_scene.GridService.GetRegionsByName(UUID.Zero, name, maxNumber); | 295 | return m_scene.GridService.GetRegionsByName(UUID.Zero, name, maxNumber); |