aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs76
1 files changed, 74 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index e1d0fb4..eec1b21 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1924,8 +1924,7 @@ namespace OpenSim.Region.Framework.Scenes
1924 // if hide force a check 1924 // if hide force a check
1925 if (!IsChildAgent && newhide) 1925 if (!IsChildAgent && newhide)
1926 { 1926 {
1927 ParcelCrossCheck(m_currentParcelUUID, m_previusParcelUUID, 1927 ParcelLoginCheck(m_currentParcelUUID);
1928 true, m_previusParcelHide, false, true);
1929 m_currentParcelHide = newhide; 1928 m_currentParcelHide = newhide;
1930 } 1929 }
1931 } 1930 }
@@ -5446,6 +5445,79 @@ namespace OpenSim.Region.Framework.Scenes
5446 5445
5447 } 5446 }
5448 5447
5448 private void ParcelLoginCheck(UUID currentParcelUUID)
5449 {
5450 List<ScenePresence> killsToSendto = new List<ScenePresence>();
5451 List<ScenePresence> killsToSendme = new List<ScenePresence>();
5452 List<ScenePresence> viewsToSendto = new List<ScenePresence>();
5453 List<ScenePresence> viewsToSendme = new List<ScenePresence>();
5454 List<ScenePresence> allpresences = null;
5455
5456 allpresences = m_scene.GetScenePresences();
5457
5458 foreach (ScenePresence p in allpresences)
5459 {
5460 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
5461 continue;
5462
5463 // those not on parcel dont see me
5464 if (currentParcelUUID != p.currentParcelUUID)
5465 {
5466 if (p.GodLevel < 200)
5467 killsToSendto.Add(p); // they dont see me
5468 }
5469 else
5470 {
5471 viewsToSendto.Add(p);
5472 viewsToSendme.Add(p);
5473 }
5474 }
5475 allpresences.Clear();
5476
5477 // send the things
5478 // kill main avatar object
5479 if (killsToSendto.Count > 0)
5480 {
5481 foreach (ScenePresence p in killsToSendto)
5482 {
5483 try { p.ControllingClient.SendKillObject(new List<uint> { LocalId }); }
5484 catch (NullReferenceException) { }
5485 }
5486 }
5487
5488 if (killsToSendme.Count > 0 && PresenceType != PresenceType.Npc)
5489 {
5490 foreach (ScenePresence p in killsToSendme)
5491 {
5492 try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
5493 catch (NullReferenceException) { }
5494 }
5495 }
5496
5497 if (viewsToSendto.Count > 0)
5498 {
5499 foreach (ScenePresence p in viewsToSendto)
5500 {
5501 p.ControllingClient.SendAvatarDataImmediate(this);
5502 SendAppearanceToAgent(p);
5503 SendAttachmentsToClient(p.ControllingClient);
5504 if (Animator != null)
5505 Animator.SendAnimPackToClient(p.ControllingClient);
5506 }
5507 }
5508
5509 if (viewsToSendme.Count > 0 && PresenceType != PresenceType.Npc)
5510 {
5511 foreach (ScenePresence p in viewsToSendme)
5512 {
5513 ControllingClient.SendAvatarDataImmediate(p);
5514 p.SendAppearanceToAgent(this);
5515 p.SendAttachmentsToClient(ControllingClient);
5516 if (p.Animator != null)
5517 p.Animator.SendAnimPackToClient(ControllingClient);
5518 }
5519 }
5520 }
5449 5521
5450 private void ParcelCrossCheck(UUID currentParcelUUID,UUID previusParcelUUID, 5522 private void ParcelCrossCheck(UUID currentParcelUUID,UUID previusParcelUUID,
5451 bool currentParcelHide, bool previusParcelHide, bool oldhide,bool check) 5523 bool currentParcelHide, bool previusParcelHide, bool oldhide,bool check)