aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2014-08-02 23:38:18 +0100
committerUbitUmarov2014-08-02 23:38:18 +0100
commitaddca0737c10ee813f89e0417f53b22468d39cd1 (patch)
tree6d0705f198fd456bfd468bf29311c9c0cafacfb4
parenttesting (diff)
downloadopensim-SC-addca0737c10ee813f89e0417f53b22468d39cd1.zip
opensim-SC-addca0737c10ee813f89e0417f53b22468d39cd1.tar.gz
opensim-SC-addca0737c10ee813f89e0417f53b22468d39cd1.tar.bz2
opensim-SC-addca0737c10ee813f89e0417f53b22468d39cd1.tar.xz
testing...
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs87
1 files changed, 67 insertions, 20 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 2b7c702..f3b5a54 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3970,9 +3970,8 @@ namespace OpenSim.Region.Framework.Scenes
3970 3970
3971 ControllingClient.SendAdminResponse(token, (uint)GodLevel); 3971 ControllingClient.SendAdminResponse(token, (uint)GodLevel);
3972 3972
3973 if(oldgodlevel != GodLevel) // force a visibility check 3973 if(oldgodlevel != GodLevel)
3974 ParcelCrossCheck(m_currentParcelUUID, m_previusParcelUUID, 3974 parcelGodCheck(m_currentParcelUUID, GodLevel >= 200);
3975 !m_currentParcelHide, m_previusParcelHide, m_currentParcelHide, true);
3976 } 3975 }
3977 3976
3978 #region Child Agent Updates 3977 #region Child Agent Updates
@@ -5383,6 +5382,68 @@ namespace OpenSim.Region.Framework.Scenes
5383 5382
5384 } 5383 }
5385 5384
5385 private void parcelGodCheck(UUID currentParcelUUID, bool isGod)
5386 {
5387 List<ScenePresence> allpresences = null;
5388
5389
5390 allpresences = m_scene.GetScenePresences();
5391
5392 if (isGod)
5393 {
5394 List<ScenePresence> viewsToSendme = new List<ScenePresence>();
5395
5396 foreach (ScenePresence p in allpresences)
5397 {
5398 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
5399 continue;
5400
5401 if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelUUID)
5402 {
5403 viewsToSendme.Add(p); // i see them
5404 }
5405 }
5406
5407 if (viewsToSendme.Count > 0)
5408 {
5409 foreach (ScenePresence p in viewsToSendme)
5410 {
5411 ControllingClient.SendAvatarDataImmediate(p);
5412 p.SendAppearanceToAgent(this);
5413 p.SendAttachmentsToClient(ControllingClient);
5414 if (p.Animator != null)
5415 p.Animator.SendAnimPackToClient(ControllingClient);
5416 }
5417 }
5418 }
5419 else
5420 {
5421 List<ScenePresence> killsToSendme = new List<ScenePresence>();
5422
5423 foreach (ScenePresence p in allpresences)
5424 {
5425 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
5426 continue;
5427
5428 if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelUUID)
5429 {
5430 killsToSendme.Add(p);
5431 }
5432 }
5433
5434 if (killsToSendme.Count > 0 && PresenceType != PresenceType.Npc)
5435 {
5436 foreach (ScenePresence p in killsToSendme)
5437 {
5438 try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
5439 catch (NullReferenceException) { }
5440 }
5441 }
5442 }
5443
5444 }
5445
5446
5386 private void ParcelCrossCheck(UUID currentParcelUUID,UUID previusParcelUUID, 5447 private void ParcelCrossCheck(UUID currentParcelUUID,UUID previusParcelUUID,
5387 bool currentParcelHide, bool previusParcelHide, bool oldhide,bool check) 5448 bool currentParcelHide, bool previusParcelHide, bool oldhide,bool check)
5388 { 5449 {
@@ -5397,26 +5458,13 @@ namespace OpenSim.Region.Framework.Scenes
5397 5458
5398 if (check) 5459 if (check)
5399 { 5460 {
5461 // check is relative to current parcel only
5400 if (currentParcelUUID == null || oldhide == currentParcelHide) 5462 if (currentParcelUUID == null || oldhide == currentParcelHide)
5401 return; 5463 return;
5402 5464
5403 allpresences = m_scene.GetScenePresences(); 5465 allpresences = m_scene.GetScenePresences();
5404 5466
5405 if (GodLevel >= 200) 5467 if (oldhide)
5406 {
5407 foreach (ScenePresence p in allpresences)
5408 {
5409 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
5410 continue;
5411
5412 if (p.ParcelHideThisAvatar)
5413 {
5414 viewsToSendto.Add(p); // they see me
5415 }
5416 }
5417 }
5418
5419 else if (oldhide)
5420 { // where private 5468 { // where private
5421 foreach (ScenePresence p in allpresences) 5469 foreach (ScenePresence p in allpresences)
5422 { 5470 {
@@ -5424,7 +5472,7 @@ namespace OpenSim.Region.Framework.Scenes
5424 continue; 5472 continue;
5425 5473
5426 // those on not on parcel see me 5474 // those on not on parcel see me
5427 if (currentParcelUUID != p.currentParcelUUID || p.GodLevel >= 200) 5475 if (currentParcelUUID != p.currentParcelUUID)
5428 { 5476 {
5429 viewsToSendto.Add(p); // they see me 5477 viewsToSendto.Add(p); // they see me
5430 } 5478 }
@@ -5446,7 +5494,6 @@ namespace OpenSim.Region.Framework.Scenes
5446 } 5494 }
5447 } // where public end 5495 } // where public end
5448 5496
5449
5450 allpresences.Clear(); 5497 allpresences.Clear();
5451 } 5498 }
5452 else 5499 else