From 96de2a2fd2feed899d19fabc077a1bd3f7cc3fc8 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 18 Aug 2014 04:07:40 +0100 Subject: reduce the kills sent, hide attachments kills on origin --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 89 +++++------------------- 1 file changed, 17 insertions(+), 72 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 977ff24..20d0f29 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -5503,8 +5503,8 @@ namespace OpenSim.Region.Framework.Scenes { if (p.GodLevel < 200) killsToSendto.Add(p); - if (GodLevel < 200 && p.ParcelHideThisAvatar) - killsToSendme.Add(p.LocalId); +// if (GodLevel < 200 && p.ParcelHideThisAvatar) +// killsToSendme.Add(p.LocalId); } else { @@ -5567,89 +5567,34 @@ namespace OpenSim.Region.Framework.Scenes */ } - public void parcelRegionCross(bool abort) + public void parcelRegionCross() { -// if (!ParcelHideThisAvatar) -// return; + if (!ParcelHideThisAvatar || GodLevel >= 200) + return; List allpresences = null; allpresences = m_scene.GetScenePresences(); -// abort no longer complet - if (abort) - { - List viewsToSendme = new List(); - - foreach (ScenePresence p in allpresences) - { - if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) - continue; - - if (p.currentParcelUUID == m_currentParcelUUID) - { - viewsToSendme.Add(p); - } - } + List killsToSendme = new List(); - if (viewsToSendme.Count > 0) - { - foreach (ScenePresence p in viewsToSendme) - { - if (p.IsChildAgent) - continue; - // m_log.Debug("[AVATAR]: viewMe: " + Lastname + " " + p.Lastname); - ControllingClient.SendAvatarDataImmediate(p); - p.SendAppearanceToAgent(this); - p.SendAttachmentsToClient(ControllingClient); - if (p.Animator != null) - p.Animator.SendAnimPackToClient(ControllingClient); - } - } - } - else + foreach (ScenePresence p in allpresences) { + if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) + continue; - bool inprivate = ParcelHideThisAvatar && GodLevel < 200; - List killsToSendme = new List(); - - if (inprivate) + if (p.currentParcelUUID == m_currentParcelUUID) { - foreach (ScenePresence p in allpresences) - { - if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) - continue; - - if (p.currentParcelUUID == m_currentParcelUUID) - { - m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname); - killsToSendme.Add(p.LocalId); - } - } + killsToSendme.Add(p.LocalId); } -/* - else - { - foreach (ScenePresence p in allpresences) - { - if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) - continue; + } - killsToSendme.Add(p.LocalId); - } - } -*/ - if (killsToSendme.Count > 0) + if (killsToSendme.Count > 0) + { + try { - try - { - ControllingClient.SendKillObject(killsToSendme); - } - catch (NullReferenceException) { } + ControllingClient.SendKillObject(killsToSendme); } - - if (Scene.AttachmentsModule != null) - Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); - + catch (NullReferenceException) { } } } -- cgit v1.1