aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorTeravus Ovares2009-08-01 14:26:00 +0000
committerTeravus Ovares2009-08-01 14:26:00 +0000
commit4cbf0444df4b4c0eb3616e19279203e5f17a939b (patch)
tree7489d6f56865229d44ac9c689fb03a6353ffa934 /OpenSim/Region
parentAdd copyright header. Formatting cleanup. (diff)
downloadopensim-SC-4cbf0444df4b4c0eb3616e19279203e5f17a939b.zip
opensim-SC-4cbf0444df4b4c0eb3616e19279203e5f17a939b.tar.gz
opensim-SC-4cbf0444df4b4c0eb3616e19279203e5f17a939b.tar.bz2
opensim-SC-4cbf0444df4b4c0eb3616e19279203e5f17a939b.tar.xz
* Tweak the caps manager so that the NPCAvatar works again.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs40
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs13
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs3
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs4
5 files changed, 52 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index e385ae0..4deb36e 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -581,7 +581,10 @@ namespace OpenSim.Region.CoreModules.World.Land
581 } 581 }
582 lock (m_landIDList) 582 lock (m_landIDList)
583 { 583 {
584 return m_landList[m_landIDList[x / 4, y / 4]]; 584 if (m_landList.ContainsKey(m_landIDList[x / 4, y / 4]))
585 return m_landList[m_landIDList[x / 4, y / 4]];
586 else
587 return null;
585 } 588 }
586 } 589 }
587 590
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();
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 2102db9..4a8ba8c 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -1044,7 +1044,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
1044 1044
1045 public bool AddGenericPacketHandler(string MethodName, GenericMessage handler) 1045 public bool AddGenericPacketHandler(string MethodName, GenericMessage handler)
1046 { 1046 {
1047 throw new NotImplementedException(); 1047 //throw new NotImplementedException();
1048 return false;
1048 } 1049 }
1049 1050
1050 public void SendAvatarClassifiedReply(UUID targetID, UUID[] classifiedID, string[] name) 1051 public void SendAvatarClassifiedReply(UUID targetID, UUID[] classifiedID, string[] name)
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index 8b45788..8c9717c 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -42,8 +42,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
42 // { 42 // {
43 // NPCAvatar testAvatar = new NPCAvatar("Jack", "NPC", new Vector3(128, 128, 40), scene); 43 // NPCAvatar testAvatar = new NPCAvatar("Jack", "NPC", new Vector3(128, 128, 40), scene);
44 // NPCAvatar testAvatar2 = new NPCAvatar("Jill", "NPC", new Vector3(136, 128, 40), scene); 44 // NPCAvatar testAvatar2 = new NPCAvatar("Jill", "NPC", new Vector3(136, 128, 40), scene);
45 // scene.AddNewClient(testAvatar, false); 45 // scene.AddNewClient(testAvatar);
46 // scene.AddNewClient(testAvatar2, false); 46 // scene.AddNewClient(testAvatar2);
47 // } 47 // }
48 } 48 }
49 49