aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs56
1 files changed, 51 insertions, 5 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
index 892bf81..aad78d5 100644
--- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
@@ -58,6 +58,7 @@ namespace OpenSim.Region.Environment.Scenes
58 //MainLog.Instance.Verbose("INTER", debugRegionName + ": SceneCommunicationService: registered with gridservice and got" + regionCommsHost.ToString()); 58 //MainLog.Instance.Verbose("INTER", debugRegionName + ": SceneCommunicationService: registered with gridservice and got" + regionCommsHost.ToString());
59 59
60 regionCommsHost.debugRegionName = _debugRegionName; 60 regionCommsHost.debugRegionName = _debugRegionName;
61
61 regionCommsHost.OnExpectUser += NewUserConnection; 62 regionCommsHost.OnExpectUser += NewUserConnection;
62 regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing; 63 regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing;
63 regionCommsHost.OnPrimCrossingIntoRegion += PrimCrossing; 64 regionCommsHost.OnPrimCrossingIntoRegion += PrimCrossing;
@@ -222,7 +223,56 @@ namespace OpenSim.Region.Environment.Scenes
222 } 223 }
223 224
224 #endregion 225 #endregion
226 public delegate void InformNeighbourThatRegionUpDelegate(RegionInfo region, ulong regionhandle);
227
228 private void InformNeighborsThatRegionisUpCompleted(IAsyncResult iar)
229 {
230 InformNeighbourThatRegionUpDelegate icon = (InformNeighbourThatRegionUpDelegate)iar.AsyncState;
231 icon.EndInvoke(iar);
232 }
233
234
235 private void InformNeighboursThatRegionIsUpAsync(RegionInfo region, ulong regionhandle)
236 {
237 MainLog.Instance.Notice("INTERGRID", "Starting to inform neighbors that I'm here");
238 bool regionAccepted = m_commsProvider.InterRegion.RegionUp((new SearializableRegionInfo(region)), regionhandle);
239
240 if (regionAccepted)
241 {
242 MainLog.Instance.Notice("INTERGRID", "Completed informing neighbors that I'm here");
243 }
244 else
245 {
246 MainLog.Instance.Notice("INTERGRID", "Failed to inform neighbors that I'm here");
247 }
248 }
225 249
250 public void InformNeighborsThatRegionisUp(RegionInfo region)
251 {
252 //MainLog.Instance.Verbose("INTER", debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName);
253 List<SimpleRegionInfo> neighbours = new List<SimpleRegionInfo>();
254
255 lock (neighbours)
256 {
257 neighbours = m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
258 if (neighbours != null)
259 {
260 for (int i = 0; i < neighbours.Count; i++)
261 {
262
263 InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync;
264 // race condition! Arg! I hate race conditions.
265 lock (d)
266 {
267 d.BeginInvoke(region, neighbours[i].RegionHandle,
268 InformNeighborsThatRegionisUpCompleted,
269 d);
270 }
271 }
272 }
273 }
274 //bool val = m_commsProvider.InterRegion.RegionUp(new SearializableRegionInfo(region));
275 }
226 /// <summary> 276 /// <summary>
227 /// 277 ///
228 /// </summary> 278 /// </summary>
@@ -320,11 +370,7 @@ namespace OpenSim.Region.Environment.Scenes
320 return m_commsProvider.InterRegion.ExpectAvatarCrossing(regionhandle, agentID, position, isFlying); 370 return m_commsProvider.InterRegion.ExpectAvatarCrossing(regionhandle, agentID, position, isFlying);
321 } 371 }
322 372
323 public void InformNeighborsThatRegionisUp(RegionInfo region) 373
324 {
325 //MainLog.Instance.Verbose("INTER", debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName);
326 bool val = m_commsProvider.InterRegion.RegionUp(new SearializableRegionInfo(region));
327 }
328 374
329 public bool PrimCrossToNeighboringRegion(ulong regionhandle, LLUUID primID, LLVector3 position, bool isPhysical) 375 public bool PrimCrossToNeighboringRegion(ulong regionhandle, LLUUID primID, LLVector3 position, bool isPhysical)
330 { 376 {