diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 6653544..4f2b6ec 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -360,15 +360,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
360 | } | 360 | } |
361 | // we're going to be using the above code once neighbour cache is correct. Currently it doesn't appear to be | 361 | // we're going to be using the above code once neighbour cache is correct. Currently it doesn't appear to be |
362 | // So we're temporarily going back to the old method of grabbing it from the Grid Server Every time :/ | 362 | // So we're temporarily going back to the old method of grabbing it from the Grid Server Every time :/ |
363 | neighbours = | 363 | if (m_regionInfo != null) |
364 | { | ||
365 | neighbours = | ||
364 | m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY); | 366 | m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY); |
367 | } | ||
368 | else | ||
369 | { | ||
370 | m_log.Debug("[ENABLENEIGHBOURCHILDAGENTS]: m_regionInfo was null in EnableNeighbourChildAgents, is this a NPC?"); | ||
371 | } | ||
372 | |||
365 | 373 | ||
366 | /// We need to find the difference between the new regions where there are no child agents | 374 | /// We need to find the difference between the new regions where there are no child agents |
367 | /// and the regions where there are already child agents. We only send notification to the former. | 375 | /// and the regions where there are already child agents. We only send notification to the former. |
368 | List<ulong> neighbourHandles = NeighbourHandles(neighbours); // on this region | 376 | List<ulong> neighbourHandles = NeighbourHandles(neighbours); // on this region |
369 | neighbourHandles.Add(avatar.Scene.RegionInfo.RegionHandle); // add this region too | 377 | neighbourHandles.Add(avatar.Scene.RegionInfo.RegionHandle); // add this region too |
370 | List<ulong> previousRegionNeighbourHandles | 378 | List<ulong> previousRegionNeighbourHandles ; |
371 | = new List<ulong>(avatar.Scene.CapsModule.GetChildrenSeeds(avatar.UUID).Keys); | 379 | |
380 | if (avatar.Scene.CapsModule != null) | ||
381 | { | ||
382 | previousRegionNeighbourHandles = | ||
383 | new List<ulong>(avatar.Scene.CapsModule.GetChildrenSeeds(avatar.UUID).Keys); | ||
384 | } | ||
385 | else | ||
386 | { | ||
387 | previousRegionNeighbourHandles = new List<ulong>(); | ||
388 | } | ||
389 | |||
372 | List<ulong> newRegions = NewNeighbours(neighbourHandles, previousRegionNeighbourHandles); | 390 | List<ulong> newRegions = NewNeighbours(neighbourHandles, previousRegionNeighbourHandles); |
373 | List<ulong> oldRegions = OldNeighbours(neighbourHandles, previousRegionNeighbourHandles); | 391 | List<ulong> oldRegions = OldNeighbours(neighbourHandles, previousRegionNeighbourHandles); |
374 | 392 | ||
@@ -381,8 +399,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
381 | avatar.DropOldNeighbours(oldRegions); | 399 | avatar.DropOldNeighbours(oldRegions); |
382 | 400 | ||
383 | /// Collect as many seeds as possible | 401 | /// Collect as many seeds as possible |
384 | Dictionary<ulong, string> seeds | 402 | Dictionary<ulong, string> seeds; |
385 | = new Dictionary<ulong, string>(avatar.Scene.CapsModule.GetChildrenSeeds(avatar.UUID)); | 403 | if (avatar.Scene.CapsModule != null) |
404 | seeds | ||
405 | = new Dictionary<ulong, string>(avatar.Scene.CapsModule.GetChildrenSeeds(avatar.UUID)); | ||
406 | else | ||
407 | seeds = new Dictionary<ulong, string>(); | ||
386 | 408 | ||
387 | //m_log.Debug(" !!! No. of seeds: " + seeds.Count); | 409 | //m_log.Debug(" !!! No. of seeds: " + seeds.Count); |
388 | if (!seeds.ContainsKey(avatar.Scene.RegionInfo.RegionHandle)) | 410 | if (!seeds.ContainsKey(avatar.Scene.RegionInfo.RegionHandle)) |
@@ -419,8 +441,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
419 | { | 441 | { |
420 | a.ChildrenCapSeeds = new Dictionary<ulong, string>(seeds); | 442 | a.ChildrenCapSeeds = new Dictionary<ulong, string>(seeds); |
421 | } | 443 | } |
422 | // These two are the same thing! | 444 | |
423 | avatar.Scene.CapsModule.SetChildrenSeed(avatar.UUID, seeds); | 445 | if (avatar.Scene.CapsModule != null) |
446 | { | ||
447 | // These two are the same thing! | ||
448 | avatar.Scene.CapsModule.SetChildrenSeed(avatar.UUID, seeds); | ||
449 | } | ||
424 | avatar.KnownRegions = seeds; | 450 | avatar.KnownRegions = seeds; |
425 | //avatar.Scene.DumpChildrenSeeds(avatar.UUID); | 451 | //avatar.Scene.DumpChildrenSeeds(avatar.UUID); |
426 | //avatar.DumpKnownRegions(); | 452 | //avatar.DumpKnownRegions(); |