diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 40 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 13 |
2 files changed, 44 insertions, 9 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(); |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6850312..fa1fd89 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -538,7 +538,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
538 | 538 | ||
539 | public void AdjustKnownSeeds() | 539 | public void AdjustKnownSeeds() |
540 | { | 540 | { |
541 | Dictionary<ulong, string> seeds = Scene.CapsModule.GetChildrenSeeds(UUID); | 541 | Dictionary<ulong, string> seeds; |
542 | |||
543 | if (Scene.CapsModule != null) | ||
544 | seeds = Scene.CapsModule.GetChildrenSeeds(UUID); | ||
545 | else | ||
546 | seeds = new Dictionary<ulong, string>(); | ||
547 | |||
542 | List<ulong> old = new List<ulong>(); | 548 | List<ulong> old = new List<ulong>(); |
543 | foreach (ulong handle in seeds.Keys) | 549 | foreach (ulong handle in seeds.Keys) |
544 | { | 550 | { |
@@ -552,7 +558,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
552 | } | 558 | } |
553 | } | 559 | } |
554 | DropOldNeighbours(old); | 560 | DropOldNeighbours(old); |
555 | Scene.CapsModule.SetChildrenSeed(UUID, seeds); | 561 | |
562 | if (Scene.CapsModule != null) | ||
563 | Scene.CapsModule.SetChildrenSeed(UUID, seeds); | ||
564 | |||
556 | KnownRegions = seeds; | 565 | KnownRegions = seeds; |
557 | //m_log.Debug(" ++++++++++AFTER+++++++++++++ "); | 566 | //m_log.Debug(" ++++++++++AFTER+++++++++++++ "); |
558 | //DumpKnownRegions(); | 567 | //DumpKnownRegions(); |