From 87f03c040c13c7456e228174dbc32f9425504407 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 21 Aug 2014 04:07:23 +0100 Subject: bad test --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 73283ed..6e69606 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1916,7 +1916,7 @@ namespace OpenSim.Region.Framework.Scenes if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) return; - p.ControllingClient.SendPartFullUpdate(sog.RootPart,LocalId + 1); + p.ControllingClient.SendPartFullUpdate(sog.RootPart,0); sog.SendFullUpdateToClient(p.ControllingClient); SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path }); @@ -4748,7 +4748,7 @@ namespace OpenSim.Region.Framework.Scenes { if (p == this || !sog.HasPrivateAttachmentPoint) { - p.ControllingClient.SendPartFullUpdate(sog.RootPart, LocalId + 1); + p.ControllingClient.SendPartFullUpdate(sog.RootPart, 0); sog.SendFullUpdateToClient(p.ControllingClient); } } -- cgit v1.1 From 6acfa779192d09fb144a1ae3a5002bbe547b301d Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 21 Aug 2014 04:35:04 +0100 Subject: test --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 44 ++++++++++++++++-------- 1 file changed, 29 insertions(+), 15 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6e69606..ebdf52f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1916,7 +1916,7 @@ namespace OpenSim.Region.Framework.Scenes if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) return; - p.ControllingClient.SendPartFullUpdate(sog.RootPart,0); + p.ControllingClient.SendPartFullUpdate(sog.RootPart,LocalId + 1); sog.SendFullUpdateToClient(p.ControllingClient); SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path }); @@ -4748,7 +4748,7 @@ namespace OpenSim.Region.Framework.Scenes { if (p == this || !sog.HasPrivateAttachmentPoint) { - p.ControllingClient.SendPartFullUpdate(sog.RootPart, 0); + p.ControllingClient.SendPartFullUpdate(sog.RootPart, LocalId +1 ); sog.SendFullUpdateToClient(p.ControllingClient); } } @@ -5805,7 +5805,7 @@ namespace OpenSim.Region.Framework.Scenes List allpresences = null; allpresences = m_scene.GetScenePresences(); - List killsToSendme = new List(); + List killsToSendme = new List(); foreach (ScenePresence p in allpresences) { @@ -5814,17 +5814,19 @@ namespace OpenSim.Region.Framework.Scenes if (p.currentParcelUUID == m_currentParcelUUID) { - killsToSendme.Add(p.LocalId); + killsToSendme.Add(p); } } if (killsToSendme.Count > 0) { - try - { - ControllingClient.SendKillObject(killsToSendme); - } - catch (NullReferenceException) { } + foreach (ScenePresence p in killsToSendme) + p.SendKillTo(this); +// try +// { +// ControllingClient.SendKillObject(killsToSendme); +// } +// catch (NullReferenceException) { } } } @@ -5832,7 +5834,7 @@ namespace OpenSim.Region.Framework.Scenes bool currentParcelHide, bool previusParcelHide, bool oldhide,bool check) { List killsToSendto = new List(); - List killsToSendme = new List(); + List killsToSendme = new List(); List viewsToSendto = new List(); List viewsToSendme = new List(); List allpresences = null; @@ -5903,7 +5905,7 @@ namespace OpenSim.Region.Framework.Scenes if(p.GodLevel < 200) killsToSendto.Add(p); // they dont see me if(GodLevel < 200) - killsToSendme.Add(p.LocalId); // i dont see them + killsToSendme.Add(p); // i dont see them } // only those on new parcel need see if (currentParcelID == p.currentParcelUUID) @@ -5952,7 +5954,7 @@ namespace OpenSim.Region.Framework.Scenes // only those old parcel need receive kills if (previusParcelID == p.currentParcelUUID && GodLevel < 200) { - killsToSendme.Add(p.LocalId); // i dont see them + killsToSendme.Add(p); // i dont see them } else { @@ -5971,18 +5973,23 @@ namespace OpenSim.Region.Framework.Scenes { foreach (ScenePresence p in killsToSendto) { + m_log.Debug("[AVATAR]: killTo: " + Lastname + " " + p.Lastname); - try { p.ControllingClient.SendKillObject(new List { LocalId }); } - catch (NullReferenceException) { } + + SendKillTo(p); +// try { p.ControllingClient.SendKillObject(new List { LocalId }); } +// catch (NullReferenceException) { } } } if (killsToSendme.Count > 0) { m_log.Debug("[AVATAR]: killtoMe: " + Lastname + " " + killsToSendme.Count.ToString()); + + foreach (ScenePresence p in killsToSendto) try { - ControllingClient.SendKillObject(killsToSendme); + p.SendKillTo(this); } catch (NullReferenceException) { } @@ -6016,5 +6023,12 @@ namespace OpenSim.Region.Framework.Scenes } } } + + public void SendKillTo(ScenePresence p) + { + foreach (SceneObjectGroup sog in m_attachments) + p.ControllingClient.SendPartFullUpdate(sog.RootPart, LocalId + 1); + p.ControllingClient.SendKillObject(new List { LocalId }); + } } } -- cgit v1.1 From d2f3a19838f10363c77aaa537400a64d1b39a45e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 21 Aug 2014 05:00:51 +0100 Subject: test --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index ebdf52f..ac77e2a 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -5716,7 +5716,7 @@ namespace OpenSim.Region.Framework.Scenes private void ParcelLoginCheck(UUID currentParcelID) { List killsToSendto = new List(); - List killsToSendme = new List(); + List killsToSendme = new List(); List viewsToSendto = new List(); List viewsToSendme = new List(); List allpresences = null; @@ -5750,19 +5750,19 @@ namespace OpenSim.Region.Framework.Scenes foreach (ScenePresence p in killsToSendto) { m_log.Debug("[AVATAR]: killTo: " + Lastname + " " + p.Lastname); - try { p.ControllingClient.SendKillObject(new List { LocalId }); } - catch (NullReferenceException) { } + SendKillTo(p); +// try { p.ControllingClient.SendKillObject(new List { LocalId }); } +// catch (NullReferenceException) { } } } if (killsToSendme.Count > 0) { m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + killsToSendme.Count.ToString()); - try + foreach (ScenePresence p in killsToSendme) { - ControllingClient.SendKillObject(killsToSendme); + SendKillTo(this); } - catch (NullReferenceException) { } } /* -- cgit v1.1 From d98d64a61ab465ba745dd09b6db272034b96aef6 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 21 Aug 2014 05:28:35 +0100 Subject: bug fix --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index ac77e2a..ea09379 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -5951,7 +5951,7 @@ namespace OpenSim.Region.Framework.Scenes { if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) continue; - // only those old parcel need receive kills + // only those old parcel need kills if (previusParcelID == p.currentParcelUUID && GodLevel < 200) { killsToSendme.Add(p); // i dont see them @@ -5986,7 +5986,7 @@ namespace OpenSim.Region.Framework.Scenes { m_log.Debug("[AVATAR]: killtoMe: " + Lastname + " " + killsToSendme.Count.ToString()); - foreach (ScenePresence p in killsToSendto) + foreach (ScenePresence p in killsToSendme) try { p.SendKillTo(this); -- cgit v1.1 From ad6f9422792f981cf1c4b240a2a443075624b614 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 21 Aug 2014 06:11:19 +0100 Subject: add filter sog updates --- .../Region/Framework/Scenes/SceneObjectGroup.cs | 40 ++++++++++++++++++++++ OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 -- 2 files changed, 40 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 28758a9..dd5ee65 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2636,6 +2636,16 @@ namespace OpenSim.Region.Framework.Scenes m_rootPart.UpdateFlag = UpdateRequired.TERSE; } + if (IsAttachment) + { + ScenePresence sp = m_scene.GetScenePresence(AttachedAvatar); + if (sp != null) + { + sp.SendAttachmentScheduleUpdate(this); + return; + } + } + SceneObjectPart[] parts = m_parts.GetArray(); for (int i = 0; i < parts.Length; i++) { @@ -2697,6 +2707,16 @@ namespace OpenSim.Region.Framework.Scenes return; // m_log.DebugFormat("[SOG]: Sending immediate full group update for {0} {1}", Name, UUID); + + if (IsAttachment) + { + ScenePresence sp = m_scene.GetScenePresence(AttachedAvatar); + if (sp != null) + { + sp.SendAttachmentUpdate(this,UpdateRequired.FULL); + return; + } + } RootPart.SendFullUpdateToAllClients(); @@ -2720,6 +2740,16 @@ namespace OpenSim.Region.Framework.Scenes if (IsDeleted) return; + if (IsAttachment) + { + ScenePresence sp = m_scene.GetScenePresence(AttachedAvatar); + if (sp != null) + { + sp.SendAttachmentUpdate(RootPart, UpdateRequired.TERSE); + return; + } + } + RootPart.SendTerseUpdateToAllClients(); } @@ -2739,6 +2769,16 @@ namespace OpenSim.Region.Framework.Scenes if (IsDeleted) return; + if (IsAttachment) + { + ScenePresence sp = m_scene.GetScenePresence(AttachedAvatar); + if (sp != null) + { + sp.SendAttachmentUpdate(this, UpdateRequired.TERSE); + return; + } + } + SceneObjectPart[] parts = m_parts.GetArray(); for (int i = 0; i < parts.Length; i++) parts[i].SendTerseUpdateToAllClients(); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index ea09379..34d0eaa 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1916,7 +1916,6 @@ namespace OpenSim.Region.Framework.Scenes if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) return; - p.ControllingClient.SendPartFullUpdate(sog.RootPart,LocalId + 1); sog.SendFullUpdateToClient(p.ControllingClient); SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path }); @@ -4748,7 +4747,6 @@ namespace OpenSim.Region.Framework.Scenes { if (p == this || !sog.HasPrivateAttachmentPoint) { - p.ControllingClient.SendPartFullUpdate(sog.RootPart, LocalId +1 ); sog.SendFullUpdateToClient(p.ControllingClient); } } -- cgit v1.1 From 5f1cb6542d8b99674bd74147b2f43ef5432b0d15 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 21 Aug 2014 06:35:11 +0100 Subject: test --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 37 ++++++++++++++---------- 1 file changed, 22 insertions(+), 15 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 34d0eaa..9e9a83f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -4787,10 +4787,12 @@ namespace OpenSim.Region.Framework.Scenes m_scene.ForEachScenePresence(delegate(ScenePresence p) { - if (p != this && sog.HasPrivateAttachmentPoint) - return; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) + if (p != this) + { + if (sog.HasPrivateAttachmentPoint || + (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)) return; + } SceneObjectPart[] parts = sog.Parts; @@ -4820,11 +4822,13 @@ namespace OpenSim.Region.Framework.Scenes m_scene.ForEachScenePresence(delegate(ScenePresence p) { - if (p != this && part.ParentGroup.HasPrivateAttachmentPoint) - return; + if (p != this) + { - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) - return; + if (part.ParentGroup.HasPrivateAttachmentPoint || + (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)) + return; + } if (part.UpdateFlag == UpdateRequired.TERSE) { @@ -4848,11 +4852,12 @@ namespace OpenSim.Region.Framework.Scenes m_scene.ForEachScenePresence(delegate(ScenePresence p) { - if (p != this && sog.HasPrivateAttachmentPoint) - return; - - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) + if (p != this) + { + if (sog.HasPrivateAttachmentPoint || + (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)) return; + } SceneObjectPart[] parts = sog.Parts; @@ -4882,11 +4887,13 @@ namespace OpenSim.Region.Framework.Scenes m_scene.ForEachScenePresence(delegate(ScenePresence p) { - if (p != this && part.ParentGroup.HasPrivateAttachmentPoint) - return; + if (p != this) + { - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) - return; + if (part.ParentGroup.HasPrivateAttachmentPoint || + (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)) + return; + } if (UpdateFlag == UpdateRequired.TERSE) { -- cgit v1.1 From 114144407bd72cb9ccbdf6981d8fec86cbba6a24 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 21 Aug 2014 09:32:36 +0100 Subject: variations.. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 243 +++++------------------ 1 file changed, 48 insertions(+), 195 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 9e9a83f..333eb9b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1920,7 +1920,6 @@ namespace OpenSim.Region.Framework.Scenes SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path }); } - sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); sog.ResumeScripts(); } @@ -3542,14 +3541,12 @@ namespace OpenSim.Region.Framework.Scenes } SendOtherAgentsAvatarFullToMe(); - EntityBase[] entities = Scene.Entities.GetEntities(); foreach (EntityBase e in entities) { if (e != null && e is SceneObjectGroup) ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient); } - }); } @@ -4754,32 +4751,6 @@ namespace OpenSim.Region.Framework.Scenes } } - // send attachments to a client without filters except for huds - // for now they are checked in several places down the line... - // kills all parts before sending - public void SendAttachmentsToAgentNFPK(ScenePresence p) - { - lock (m_attachments) - { - List pk = new List(); - foreach (SceneObjectGroup sog in m_attachments) - { - foreach (SceneObjectPart part in sog.Parts) - pk.Add(part.LocalId); - } - - p.ControllingClient.SendKillObject(pk); - - foreach (SceneObjectGroup sog in m_attachments) - { - if (p == this || !sog.HasPrivateAttachmentPoint) - sog.SendFullUpdateToClient(p.ControllingClient); - } - SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path - } - } - - public void SendAttachmentScheduleUpdate(SceneObjectGroup sog) { if (IsChildAgent) @@ -4796,9 +4767,27 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart[] parts = sog.Parts; + SendFullUpdateToClient(p.ControllingClient); + + SceneObjectPart rootpart = sog.RootPart; + if (rootpart.UpdateFlag == UpdateRequired.TERSE) + { + p.ControllingClient.SendEntityUpdate(rootpart, + PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity + | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); + rootpart.UpdateFlag = 0; + } + else if (rootpart.UpdateFlag == UpdateRequired.FULL) + { + p.ControllingClient.SendEntityUpdate(rootpart, PrimUpdateFlags.FullUpdate); + rootpart.UpdateFlag = 0; + } + for (int i = 0; i < parts.Length; i++) { SceneObjectPart part = parts[i]; + if (part == rootpart) + continue; if (part.UpdateFlag == UpdateRequired.TERSE) { p.ControllingClient.SendEntityUpdate(part, @@ -5655,183 +5644,56 @@ namespace OpenSim.Region.Framework.Scenes private void parcelGodCheck(UUID currentParcelID, bool isGod) { - List allpresences = null; - + List allpresences = m_scene.GetScenePresences(); - allpresences = m_scene.GetScenePresences(); - - if (isGod) - { - List viewsToSendme = new List(); - - foreach (ScenePresence p in allpresences) - { - if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) - continue; - - if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelID) - { - viewsToSendme.Add(p); // i see them - } - } - - if (viewsToSendme.Count > 0) - { - foreach (ScenePresence p in viewsToSendme) - { - if (p.IsChildAgent) - continue; - - p.SendAvatarDataToAgentNF(this); - p.SendAppearanceToAgent(this); - if (p.Animator != null) - p.Animator.SendAnimPackToClient(ControllingClient); - p.SendAttachmentsToAgentNF(this); - } - } - } - else + foreach (ScenePresence p in allpresences) { - List killsToSendme = new List(); - - foreach (ScenePresence p in allpresences) - { - if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) - continue; - - if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelID) - { - killsToSendme.Add(p); - } - } + if (p.IsDeleted || p.IsChildAgent || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) + continue; - if (killsToSendme.Count > 0) + if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelID) { - foreach (ScenePresence p in killsToSendme) - { - m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname); - try { ControllingClient.SendKillObject(new List { p.LocalId }); } - catch (NullReferenceException) { } - } + if (isGod) + p.SendViewTo(this); + else + p.SendKillTo(this); } } - } private void ParcelLoginCheck(UUID currentParcelID) { - List killsToSendto = new List(); - List killsToSendme = new List(); - List viewsToSendto = new List(); - List viewsToSendme = new List(); - List allpresences = null; - - allpresences = m_scene.GetScenePresences(); + List allpresences = m_scene.GetScenePresences(); foreach (ScenePresence p in allpresences) { if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) continue; - if (currentParcelID != p.currentParcelUUID) - { - if (p.GodLevel < 200) - killsToSendto.Add(p); -// if (GodLevel < 200 && p.ParcelHideThisAvatar) -// killsToSendme.Add(p.LocalId); - } - else + if (currentParcelID != p.currentParcelUUID && p.GodLevel < 200) { - viewsToSendto.Add(p); - viewsToSendme.Add(p); - } - } - allpresences.Clear(); - - // send the things - // kill main avatar object - if (killsToSendto.Count > 0 && PresenceType != PresenceType.Npc) - { - foreach (ScenePresence p in killsToSendto) - { - m_log.Debug("[AVATAR]: killTo: " + Lastname + " " + p.Lastname); SendKillTo(p); -// try { p.ControllingClient.SendKillObject(new List { LocalId }); } -// catch (NullReferenceException) { } - } - } - - if (killsToSendme.Count > 0) - { - m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + killsToSendme.Count.ToString()); - foreach (ScenePresence p in killsToSendme) - { - SendKillTo(this); - } - - } -/* - if (viewsToSendto.Count > 0 && PresenceType != PresenceType.Npc) - { - foreach (ScenePresence p in viewsToSendto) - { - m_log.Debug("[AVATAR]: viewTo: " + Lastname + " " + p.Lastname); - p.ControllingClient.SendAvatarDataImmediate(this); - SendAppearanceToAgent(p); - SendAttachmentsToClient(p.ControllingClient); - if (Animator != null) - Animator.SendAnimPackToClient(p.ControllingClient); - } - } - - if (viewsToSendme.Count > 0) - { - foreach (ScenePresence p in viewsToSendme) - { - m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname); - if (p.IsChildAgent) - continue; - ControllingClient.SendAvatarDataImmediate(p); - p.SendAppearanceToAgent(this); - p.SendAttachmentsToClient(ControllingClient); - if (p.Animator != null) - p.Animator.SendAnimPackToClient(ControllingClient); } } -*/ } - public void parcelRegionCross() { - if (!ParcelHideThisAvatar || GodLevel >= 200) + if (!ParcelHideThisAvatar || IsChildAgent || GodLevel >= 200) return; List allpresences = null; allpresences = m_scene.GetScenePresences(); - List killsToSendme = new List(); - foreach (ScenePresence p in allpresences) { - if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) + if (p.IsDeleted || p == this || p.IsChildAgent || p.ControllingClient == null || !p.ControllingClient.IsActive) continue; if (p.currentParcelUUID == m_currentParcelUUID) { - killsToSendme.Add(p); - } - } - - if (killsToSendme.Count > 0) - { - foreach (ScenePresence p in killsToSendme) p.SendKillTo(this); -// try -// { -// ControllingClient.SendKillObject(killsToSendme); -// } -// catch (NullReferenceException) { } + } } } @@ -5844,10 +5706,7 @@ namespace OpenSim.Region.Framework.Scenes List viewsToSendme = new List(); List allpresences = null; - if (IsInTransit) - return; - - if (IsChildAgent) + if (IsInTransit || IsChildAgent) return; if (check) @@ -5973,17 +5832,13 @@ namespace OpenSim.Region.Framework.Scenes } // send the things - // kill main avatar object - if (killsToSendto.Count > 0 && PresenceType != PresenceType.Npc) + + if (killsToSendto.Count > 0) { foreach (ScenePresence p in killsToSendto) { - m_log.Debug("[AVATAR]: killTo: " + Lastname + " " + p.Lastname); - SendKillTo(p); -// try { p.ControllingClient.SendKillObject(new List { LocalId }); } -// catch (NullReferenceException) { } } } @@ -5992,23 +5847,17 @@ namespace OpenSim.Region.Framework.Scenes m_log.Debug("[AVATAR]: killtoMe: " + Lastname + " " + killsToSendme.Count.ToString()); foreach (ScenePresence p in killsToSendme) - try { + m_log.Debug("[AVATAR]: killToMe: " + Lastname + " " + p.Lastname); p.SendKillTo(this); } - catch (NullReferenceException) { } - } - if (viewsToSendto.Count > 0 && PresenceType != PresenceType.Npc) + if (viewsToSendto.Count > 0) { foreach (ScenePresence p in viewsToSendto) { - SendAvatarDataToAgentNF(p); - SendAppearanceToAgent(p); - if (Animator != null) - Animator.SendAnimPackToClient(p.ControllingClient); - SendAttachmentsToAgentNF(p); + SendViewTo(p); } } @@ -6019,12 +5868,7 @@ namespace OpenSim.Region.Framework.Scenes if (p.IsChildAgent) continue; // m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname); - - p.SendAvatarDataToAgentNF(this); - p.SendAppearanceToAgent(this); - if (p.Animator != null) - p.Animator.SendAnimPackToClient(ControllingClient); - p.SendAttachmentsToAgentNF(this); + p.SendViewTo(this); } } } @@ -6035,5 +5879,14 @@ namespace OpenSim.Region.Framework.Scenes p.ControllingClient.SendPartFullUpdate(sog.RootPart, LocalId + 1); p.ControllingClient.SendKillObject(new List { LocalId }); } + + public void SendViewTo(ScenePresence p) + { + SendAvatarDataToAgentNF(p); + SendAppearanceToAgent(p); + if (Animator != null) + Animator.SendAnimPackToClient(p.ControllingClient); + SendAttachmentsToAgentNF(p); + } } } -- cgit v1.1 From b68c814bc6e8f538c02bcf674a51810fc03287d6 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 21 Aug 2014 10:53:59 +0100 Subject: ... --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 333eb9b..7eda10e 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -4756,7 +4756,8 @@ namespace OpenSim.Region.Framework.Scenes if (IsChildAgent) return; - m_scene.ForEachScenePresence(delegate(ScenePresence p) + List allPresences = m_scene.GetScenePresences(); + foreach(ScenePresence p in allPresences) { if (p != this) { @@ -4801,7 +4802,7 @@ namespace OpenSim.Region.Framework.Scenes part.UpdateFlag = 0; } } - }); + } } public void SendAttachmentScheduleUpdate(SceneObjectPart part) -- cgit v1.1 From ad83b18634f368a493432888d93af6c2715a2472 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 21 Aug 2014 14:07:55 +0100 Subject: some cleanup.. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 320 +++++++++++------------ 1 file changed, 146 insertions(+), 174 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 7eda10e..c46a5ad 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1268,79 +1268,6 @@ namespace OpenSim.Region.Framework.Scenes m_scene.SwapRootAgentCount(false); - // The initial login scene presence is already root when it gets here - // and it has already rezzed the attachments and started their scripts. - // We do the following only for non-login agents, because their scripts - // haven't started yet. -/* moved down - if (PresenceType == PresenceType.Npc || (TeleportFlags & TeleportFlags.ViaLogin) != 0) - { - // Viewers which have a current outfit folder will actually rez their own attachments. However, - // viewers without (e.g. v1 viewers) will not, so we still need to make this call. - if (Scene.AttachmentsModule != null) - Util.FireAndForget( - o => - { -// if (PresenceType != PresenceType.Npc && Util.FireAndForgetMethod != FireAndForgetMethod.None) -// System.Threading.Thread.Sleep(7000); - - Scene.AttachmentsModule.RezAttachments(this); - }); - } - else - - { - // We need to restart scripts here so that they receive the correct changed events (CHANGED_TELEPORT - // and CHANGED_REGION) when the attachments have been rezzed in the new region. This cannot currently - // be done in AttachmentsModule.CopyAttachments(AgentData ad, IScenePresence sp) itself since we are - // not transporting the required data. - // - // We need to restart scripts here so that they receive the correct changed events (CHANGED_TELEPORT - // and CHANGED_REGION) when the attachments have been rezzed in the new region. This cannot currently - // be done in AttachmentsModule.CopyAttachments(AgentData ad, IScenePresence sp) itself since we are - // not transporting the required data. - // - // We must take a copy of the attachments list here (rather than locking) to avoid a deadlock where a script in one of - // the attachments may start processing an event (which locks ScriptInstance.m_Script) that then calls a method here - // which needs to lock m_attachments. ResumeScripts() needs to take a ScriptInstance.m_Script lock to try to unset the Suspend status. - // - // FIXME: In theory, this deadlock should not arise since scripts should not be processing events until ResumeScripts(). - // But XEngine starts all scripts unsuspended. Starting them suspended will not currently work because script rezzing - // is placed in an asynchronous queue in XEngine and so the ResumeScripts() call will almost certainly execute before the - // script is rezzed. This means the ResumeScripts() does absolutely nothing when using XEngine. - // - // One cannot simply iterate over attachments in a fire and forget thread because this would no longer - // be locked, allowing race conditions if other code changes the attachments list. - - List attachments = GetAttachments(); - - if (attachments.Count > 0) - { - m_log.DebugFormat( - "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name); - - // Resume scripts this possible should also be moved down after sending the avatar to viewer ? - foreach (SceneObjectGroup sog in attachments) - { -// sending attachments before the avatar ? -// moved to completemovement where it already was -// sog.ScheduleGroupForFullUpdate(); - sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); - sog.ResumeScripts(); - } - } - } -*/ -/* - SendAvatarDataToAllAgents(); - - // send the animations of the other presences to me - m_scene.ForEachRootScenePresence(delegate(ScenePresence presence) - { - if (presence != this) - presence.Animator.SendAnimPackToClient(ControllingClient); - }); -*/ // If we don't reset the movement flag here, an avatar that crosses to a neighbouring sim and returns will // stall on the border crossing since the existing child agent will still have the last movement @@ -4132,19 +4059,7 @@ namespace OpenSim.Region.Framework.Scenes cAgent.Far = DrawDistance; // Throttles - float multiplier = 1; - -/* this is also used to send to new main regions not children - - int childRegions = KnownRegionCount; - if (childRegions != 0) - multiplier = 1f / childRegions; - - // Minimum throttle for a child region is 1/4 of the root region throttle - if (multiplier <= 0.25f) - multiplier = 0.25f; -*/ - cAgent.Throttles = ControllingClient.GetThrottlesPacked(multiplier); + cAgent.Throttles = ControllingClient.GetThrottlesPacked(1); cAgent.HeadRotation = m_headrotation; cAgent.BodyRotation = Rotation; @@ -4756,118 +4671,167 @@ namespace OpenSim.Region.Framework.Scenes if (IsChildAgent) return; - List allPresences = m_scene.GetScenePresences(); - foreach(ScenePresence p in allPresences) + SceneObjectPart[] origparts = sog.Parts; + SceneObjectPart[] parts = new SceneObjectPart[origparts.Length]; + PrimUpdateFlags[] flags = new PrimUpdateFlags[origparts.Length]; + + SceneObjectPart rootpart = sog.RootPart; + UpdateRequired rootreq = sog.RootPart.UpdateFlag; + + int j = 0; + bool allterse = true; + + for (int i = 0; i < origparts.Length; i++) { - if (p != this) + switch (origparts[i].UpdateFlag) { - if (sog.HasPrivateAttachmentPoint || - (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)) - return; + case UpdateRequired.TERSE: + flags[j] = PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity + | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity; + parts[j] = origparts[i]; + j++; + break; + + case UpdateRequired.FULL: + flags[j] = PrimUpdateFlags.FullUpdate; + parts[j] = origparts[i]; + j++; + allterse = false; + break; } + origparts[i].UpdateFlag = 0; + } + + if (j == 0) + return; - SceneObjectPart[] parts = sog.Parts; + if (rootreq == UpdateRequired.NONE) + { + if (allterse) + rootreq = UpdateRequired.TERSE; + else + rootreq = UpdateRequired.FULL; + } - SendFullUpdateToClient(p.ControllingClient); + PrimUpdateFlags rootflag = PrimUpdateFlags.FullUpdate; + if (rootreq == UpdateRequired.TERSE) + rootflag = PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity + | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity; - SceneObjectPart rootpart = sog.RootPart; - if (rootpart.UpdateFlag == UpdateRequired.TERSE) - { - p.ControllingClient.SendEntityUpdate(rootpart, - PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity - | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); - rootpart.UpdateFlag = 0; - } - else if (rootpart.UpdateFlag == UpdateRequired.FULL) + int nparts = j; + + bool priv = sog.HasPrivateAttachmentPoint; + + List allPresences = m_scene.GetScenePresences(); + foreach (ScenePresence p in allPresences) + { + if (p != this) { - p.ControllingClient.SendEntityUpdate(rootpart, PrimUpdateFlags.FullUpdate); - rootpart.UpdateFlag = 0; + if (priv || + (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)) + continue; } - for (int i = 0; i < parts.Length; i++) + p.ControllingClient.SendEntityUpdate(rootpart, rootflag); + + for (int i = 0; i < nparts; i++) { SceneObjectPart part = parts[i]; if (part == rootpart) continue; - if (part.UpdateFlag == UpdateRequired.TERSE) - { - p.ControllingClient.SendEntityUpdate(part, - PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity - | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); - part.UpdateFlag = 0; - } - else if (part.UpdateFlag == UpdateRequired.FULL) - { - p.ControllingClient.SendEntityUpdate(part, PrimUpdateFlags.FullUpdate); - part.UpdateFlag = 0; - } + p.ControllingClient.SendEntityUpdate(part, flags[i]); } - } + } } - public void SendAttachmentScheduleUpdate(SceneObjectPart part) + public void SendAttachmentUpdate(SceneObjectGroup sog, UpdateRequired UpdateFlag) { if (IsChildAgent) return; - m_scene.ForEachScenePresence(delegate(ScenePresence p) + PrimUpdateFlags flag; + switch (UpdateFlag) + { + case UpdateRequired.TERSE: + flag = PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity + | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity; + break; + + case UpdateRequired.FULL: + flag = PrimUpdateFlags.FullUpdate; + break; + + default: + return; + } + + SceneObjectPart[] parts = sog.Parts; + SceneObjectPart rootpart = sog.RootPart; + + bool priv = sog.HasPrivateAttachmentPoint; + + List allPresences = m_scene.GetScenePresences(); + foreach (ScenePresence p in allPresences) { if (p != this) { - - if (part.ParentGroup.HasPrivateAttachmentPoint || + if (priv || (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)) - return; + continue; } - if (part.UpdateFlag == UpdateRequired.TERSE) - { - p.ControllingClient.SendEntityUpdate(part, - PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity - | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); - part.UpdateFlag = 0; - } - else if (part.UpdateFlag == UpdateRequired.FULL) + p.ControllingClient.SendEntityUpdate(rootpart, flag); + rootpart.UpdateFlag = 0; + + for (int i = 0; i < parts.Length; i++) { - p.ControllingClient.SendEntityUpdate(part, PrimUpdateFlags.FullUpdate); + SceneObjectPart part = parts[i]; + if (part == rootpart) + continue; + p.ControllingClient.SendEntityUpdate(part, flag); part.UpdateFlag = 0; } - }); + } } - public void SendAttachmentUpdate(SceneObjectGroup sog, UpdateRequired UpdateFlag) + public void SendAttachmentScheduleUpdate(SceneObjectPart part) { if (IsChildAgent) return; - m_scene.ForEachScenePresence(delegate(ScenePresence p) + + PrimUpdateFlags flag; + switch (part.UpdateFlag) { - if (p != this) - { - if (sog.HasPrivateAttachmentPoint || - (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)) + case UpdateRequired.TERSE: + flag = PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity + | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity; + break; + + case UpdateRequired.FULL: + flag = PrimUpdateFlags.FullUpdate; + break; + + default: return; - } + } - SceneObjectPart[] parts = sog.Parts; + bool priv = part.ParentGroup.HasPrivateAttachmentPoint; - for (int i = 0; i < parts.Length; i++) + List allPresences = m_scene.GetScenePresences(); + foreach (ScenePresence p in allPresences) + { + if (p != this) { - SceneObjectPart part = parts[i]; - if (UpdateFlag == UpdateRequired.TERSE) - { - p.ControllingClient.SendEntityUpdate(part, - PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity - | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); - part.UpdateFlag = 0; - } - else if (UpdateFlag == UpdateRequired.FULL) - { - p.ControllingClient.SendEntityUpdate(part, PrimUpdateFlags.FullUpdate); - part.UpdateFlag = 0; - } + + if (priv || + (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)) + continue; } - }); + + p.ControllingClient.SendEntityUpdate(part, flag); + part.UpdateFlag = 0; + } } public void SendAttachmentUpdate(SceneObjectPart part, UpdateRequired UpdateFlag) @@ -4875,29 +4839,37 @@ namespace OpenSim.Region.Framework.Scenes if (IsChildAgent) return; - m_scene.ForEachScenePresence(delegate(ScenePresence p) + PrimUpdateFlags flag; + switch (UpdateFlag) + { + case UpdateRequired.TERSE: + flag = PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity + | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity; + break; + + case UpdateRequired.FULL: + flag = PrimUpdateFlags.FullUpdate; + break; + + default: + return; + } + + bool priv = part.ParentGroup.HasPrivateAttachmentPoint; + + List allPresences = m_scene.GetScenePresences(); + foreach (ScenePresence p in allPresences) { if (p != this) { - - if (part.ParentGroup.HasPrivateAttachmentPoint || + if ( priv || (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)) - return; + continue; } - if (UpdateFlag == UpdateRequired.TERSE) - { - p.ControllingClient.SendEntityUpdate(part, - PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity - | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); - part.UpdateFlag = 0; - } - else if (UpdateFlag == UpdateRequired.FULL) - { - p.ControllingClient.SendEntityUpdate(part, PrimUpdateFlags.FullUpdate); - part.UpdateFlag = 0; - } - }); + p.ControllingClient.SendEntityUpdate(part, flag); + part.UpdateFlag = 0; + } } /// -- cgit v1.1 From 6674548af006484da0d213f2775b9406a163f31f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 21 Aug 2014 22:42:45 +0100 Subject: replace AgentHasMovedAway + KillEntity by a hacked version on teleports --- .../Framework/EntityTransfer/EntityTransferModule.cs | 11 +++++++---- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 11 ++++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index d5eca03..781fc40 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -981,10 +981,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // May need to logout or other cleanup // AgentHasMovedAway(sp, logout); - AgentHasMovedAway(sp, true); // until logout use is checked +// AgentHasMovedAway(sp, true); // until logout use is checked // Well, this is it. The agent is over there. - KillEntity(sp.Scene, sp.LocalId); +// KillEntity(sp.Scene, sp.LocalId); + + sp.HasMovedAway(); // Now let's make it officially a child agent sp.MakeChildAgent(); @@ -1147,12 +1149,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // abandoned without proper close by viewer but then re-used by an incoming connection. sp.CloseChildAgents(newRegionX, newRegionY); + sp.HasMovedAway(); // May need to logout or other cleanup // AgentHasMovedAway(sp, logout); - AgentHasMovedAway(sp, true); +// AgentHasMovedAway(sp, true); // Well, this is it. The agent is over there. - KillEntity(sp.Scene, sp.LocalId); +// KillEntity(sp.Scene, sp.LocalId); // Now let's make it officially a child agent sp.MakeChildAgent(); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index c46a5ad..f9266b4 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -5652,7 +5652,7 @@ namespace OpenSim.Region.Framework.Scenes public void parcelRegionCross() { - if (!ParcelHideThisAvatar || IsChildAgent || GodLevel >= 200) + if (!ParcelHideThisAvatar || GodLevel >= 200) return; List allpresences = null; @@ -5846,6 +5846,15 @@ namespace OpenSim.Region.Framework.Scenes } } + public void HasMovedAway() + { + List allpresences = m_scene.GetScenePresences(); + foreach (ScenePresence p in allpresences) + SendKillTo(p); + if (Scene.AttachmentsModule != null) + Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); + } + public void SendKillTo(ScenePresence p) { foreach (SceneObjectGroup sog in m_attachments) -- cgit v1.1 From d5bb80798d106f0460ea57b0a0cf22e1829cd96d Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 21 Aug 2014 23:18:51 +0100 Subject: make the hack more extensive. Forbid sog/sop updates if Intransit but release it sooner --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f9266b4..fd1ec82 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3515,10 +3515,10 @@ namespace OpenSim.Region.Framework.Scenes SendAppearanceToAgent(this); -// if (cachedappearance) -// { + m_inTransit = false; + SendAppearanceToAllOtherAgents(); -// } + if(Animator!= null) Animator.SendAnimPack(); } @@ -4668,7 +4668,7 @@ namespace OpenSim.Region.Framework.Scenes public void SendAttachmentScheduleUpdate(SceneObjectGroup sog) { - if (IsChildAgent) + if (IsChildAgent || IsInTransit) return; SceneObjectPart[] origparts = sog.Parts; @@ -4746,7 +4746,7 @@ namespace OpenSim.Region.Framework.Scenes public void SendAttachmentUpdate(SceneObjectGroup sog, UpdateRequired UpdateFlag) { - if (IsChildAgent) + if (IsChildAgent || IsInTransit) return; PrimUpdateFlags flag; @@ -4796,7 +4796,7 @@ namespace OpenSim.Region.Framework.Scenes public void SendAttachmentScheduleUpdate(SceneObjectPart part) { - if (IsChildAgent) + if (IsChildAgent || IsInTransit) return; @@ -4836,7 +4836,7 @@ namespace OpenSim.Region.Framework.Scenes public void SendAttachmentUpdate(SceneObjectPart part, UpdateRequired UpdateFlag) { - if (IsChildAgent) + if (IsChildAgent || IsInTransit) return; PrimUpdateFlags flag; @@ -5850,7 +5850,12 @@ namespace OpenSim.Region.Framework.Scenes { List allpresences = m_scene.GetScenePresences(); foreach (ScenePresence p in allpresences) - SendKillTo(p); + { + if (p == this) + continue; + SendKillTo(p); + p.SendKillTo(this); + } if (Scene.AttachmentsModule != null) Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); } -- cgit v1.1 From be02fb3904dbe8f7071ad393229c3e04b08bb697 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 21 Aug 2014 23:43:06 +0100 Subject: replace hack by sog kills on tp out --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index fd1ec82..260dfc8 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -5848,18 +5848,32 @@ namespace OpenSim.Region.Framework.Scenes public void HasMovedAway() { + List myids = new List(); + foreach (SceneObjectGroup sog in m_attachments) + myids.Add(sog.RootPart.LocalId); + myids.Add(LocalId); + List allpresences = m_scene.GetScenePresences(); foreach (ScenePresence p in allpresences) { if (p == this) continue; - SendKillTo(p); + p.ControllingClient.SendKillObject(myids); p.SendKillTo(this); } if (Scene.AttachmentsModule != null) Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); } + public void SendFullKillsTo(ScenePresence p) + { + List ids = new List(); + foreach (SceneObjectGroup sog in m_attachments) + ids.Add(sog.RootPart.LocalId); + ids.Add(LocalId); + p.ControllingClient.SendKillObject(ids); + } + public void SendKillTo(ScenePresence p) { foreach (SceneObjectGroup sog in m_attachments) -- cgit v1.1 From 0da7f8e863ae185c38cbcee0d0fe0f11e09647b9 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 22 Aug 2014 00:01:50 +0100 Subject: silly... --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 260dfc8..d3ed228 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -5858,8 +5858,8 @@ namespace OpenSim.Region.Framework.Scenes { if (p == this) continue; - p.ControllingClient.SendKillObject(myids); - p.SendKillTo(this); + p.ControllingClient.SendKillObject(myids); + p.SendFullKillsTo(this); } if (Scene.AttachmentsModule != null) Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); -- cgit v1.1 From c95fd60806d28c7e68b8a03d9a0e2d41604ac92c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 22 Aug 2014 00:28:05 +0100 Subject: revert the kills, they seem even worse --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index d3ed228..5bfc640 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -5848,18 +5848,13 @@ namespace OpenSim.Region.Framework.Scenes public void HasMovedAway() { - List myids = new List(); - foreach (SceneObjectGroup sog in m_attachments) - myids.Add(sog.RootPart.LocalId); - myids.Add(LocalId); - List allpresences = m_scene.GetScenePresences(); foreach (ScenePresence p in allpresences) { if (p == this) continue; - p.ControllingClient.SendKillObject(myids); - p.SendFullKillsTo(this); + SendKillTo(p); + p.SendKillTo(this); } if (Scene.AttachmentsModule != null) Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); @@ -5869,7 +5864,7 @@ namespace OpenSim.Region.Framework.Scenes { List ids = new List(); foreach (SceneObjectGroup sog in m_attachments) - ids.Add(sog.RootPart.LocalId); + p.ControllingClient.SendPartFullUpdate(sog.RootPart, LocalId + 1); ids.Add(LocalId); p.ControllingClient.SendKillObject(ids); } -- cgit v1.1 From 0295e6822dd6408b6dc6580b4a7a92b0f057d4b8 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 22 Aug 2014 20:01:07 +0100 Subject: some cleanup ( well or not ) --- .../Scenes/Animation/ScenePresenceAnimator.cs | 10 + OpenSim/Region/Framework/Scenes/Scene.cs | 11 +- .../Region/Framework/Scenes/SceneObjectGroup.cs | 18 +- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 73 +++++++- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 203 +++++++++++++++------ 5 files changed, 234 insertions(+), 81 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 668087f..fdadd32 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -576,6 +576,16 @@ namespace OpenSim.Region.Framework.Scenes.Animation m_scenePresence.SendAnimPack(animations, seqs, objectIDs); } + public void GetArrays(out UUID[] animIDs, out int[] sequenceNums, out UUID[] objectIDs) + { + animIDs = null; + sequenceNums = null; + objectIDs = null; + + if(m_animations != null) + m_animations.GetArrays(out animIDs, out sequenceNums, out objectIDs); + } + public void SendAnimPackToClient(IClientAPI client) { if (m_scenePresence.IsChildAgent) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 0266faf..aa81000 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3000,13 +3000,18 @@ namespace OpenSim.Region.Framework.Scenes if (sp == null) { m_log.DebugFormat( - "[SCENE]: Adding new child scene presence {0} {1} to scene {2} at pos {3}", - client.Name, client.AgentId, RegionInfo.RegionName, client.StartPos); + "[SCENE]: Adding new child scene presence {0} {1} to scene {2} at pos {3}, tpflags: {4}", + client.Name, client.AgentId, RegionInfo.RegionName, client.StartPos, + ((TPFlags)aCircuit.teleportFlags).ToString()); m_clientManager.Add(client); SubscribeToClientEvents(client); sp = m_sceneGraph.CreateAndAddChildScenePresence(client, aCircuit.Appearance, type); + + sp.TeleportFlags = (TPFlags)aCircuit.teleportFlags; + +/* done in completMovement InventoryFolderBase cof = InventoryService.GetFolderForType(client.AgentId, (AssetType)46); if (cof == null) sp.COF = UUID.Zero; @@ -3014,9 +3019,9 @@ namespace OpenSim.Region.Framework.Scenes sp.COF = cof.ID; m_log.DebugFormat("[SCENE]: COF for {0} is {1}", client.AgentId, sp.COF); + */ m_eventManager.TriggerOnNewPresence(sp); - sp.TeleportFlags = (TPFlags)aCircuit.teleportFlags; } else { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index dd5ee65..d3dd5d7 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2717,15 +2717,15 @@ namespace OpenSim.Region.Framework.Scenes return; } } - - RootPart.SendFullUpdateToAllClients(); + + RootPart.SendFullUpdateToAllClientsInternal(); SceneObjectPart[] parts = m_parts.GetArray(); for (int i = 0; i < parts.Length; i++) { SceneObjectPart part = parts[i]; if (part != RootPart) - part.SendFullUpdateToAllClients(); + part.SendFullUpdateToAllClientsInternal(); } } @@ -2740,16 +2740,6 @@ namespace OpenSim.Region.Framework.Scenes if (IsDeleted) return; - if (IsAttachment) - { - ScenePresence sp = m_scene.GetScenePresence(AttachedAvatar); - if (sp != null) - { - sp.SendAttachmentUpdate(RootPart, UpdateRequired.TERSE); - return; - } - } - RootPart.SendTerseUpdateToAllClients(); } @@ -2781,7 +2771,7 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart[] parts = m_parts.GetArray(); for (int i = 0; i < parts.Length; i++) - parts[i].SendTerseUpdateToAllClients(); + parts[i].SendTerseUpdateToAllClientsInternal(); } /// diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 98ea880..0930820 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -862,7 +862,8 @@ namespace OpenSim.Region.Framework.Scenes { Vector3 offset = (m_offsetPosition - oldpos); av.AbsolutePosition += offset; - av.SendAvatarDataToAllAgents(); +// av.SendAvatarDataToAllAgents(); + av.SendTerseUpdateToAllClients(); } } } @@ -3257,7 +3258,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// Send a full update for this part to all clients. /// - public void SendFullUpdateToAllClients() + public void SendFullUpdateToAllClientsInternal() { if (ParentGroup == null) return; @@ -3276,6 +3277,36 @@ namespace OpenSim.Region.Framework.Scenes }); } + public void SendFullUpdateToAllClients() + { + if (ParentGroup == null) + return; + + // Update the "last" values + m_lastPosition = OffsetPosition; + m_lastRotation = RotationOffset; + m_lastVelocity = Velocity; + m_lastAcceleration = Acceleration; + m_lastAngularVelocity = AngularVelocity; + m_lastUpdateSentTime = Environment.TickCount; + + if (ParentGroup.IsAttachment) + { + ScenePresence sp = ParentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar); + if (sp != null) + { + sp.SendAttachmentUpdate(this, UpdateRequired.FULL); + } + } + else + { + ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) + { + SendFullUpdate(avatar.ControllingClient); + }); + } + } + /// /// Sends a full update to the client /// @@ -3345,24 +3376,24 @@ namespace OpenSim.Region.Framework.Scenes !OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || Environment.TickCount - m_lastUpdateSentTime > TIME_MS_TOLERANCE) { - SendTerseUpdateToAllClients(); - + SendTerseUpdateToAllClientsInternal(); } break; } case UpdateRequired.FULL: { ClearUpdateSchedule(); - SendFullUpdateToAllClients(); + SendFullUpdateToAllClientsInternal(); break; } } } + /// /// Send a terse update to all clients /// - public void SendTerseUpdateToAllClients() + public void SendTerseUpdateToAllClientsInternal() { if (ParentGroup == null || ParentGroup.Scene == null) return; @@ -3381,6 +3412,36 @@ namespace OpenSim.Region.Framework.Scenes }); } + public void SendTerseUpdateToAllClients() + { + if (ParentGroup == null || ParentGroup.Scene == null) + return; + + // Update the "last" values + m_lastPosition = OffsetPosition; + m_lastRotation = RotationOffset; + m_lastVelocity = Velocity; + m_lastAcceleration = Acceleration; + m_lastAngularVelocity = AngularVelocity; + m_lastUpdateSentTime = Environment.TickCount; + + if (ParentGroup.IsAttachment) + { + ScenePresence sp = ParentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar); + if (sp != null) + { + sp.SendAttachmentUpdate(this, UpdateRequired.TERSE); + } + } + else + { + ParentGroup.Scene.ForEachClient(delegate(IClientAPI client) + { + SendTerseUpdateToClient(client); + }); + } + } + public void SetAxisRotation(int axis, int rotate) { ParentGroup.SetAxisRotation(axis, rotate); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 5bfc640..faa07d4 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1341,6 +1341,11 @@ namespace OpenSim.Region.Framework.Scenes RemoveFromPhysicalScene(); ParentID = 0; // Child agents can't be sitting +// we dont have land information for child + m_previusParcelHide = false; + m_previusParcelUUID = UUID.Zero; + m_currentParcelHide = false; + m_currentParcelUUID = UUID.Zero; // FIXME: Set RegionHandle to the region handle of the scene this agent is moving into m_scene.EventManager.TriggerOnMakeChildAgent(this); @@ -1753,13 +1758,6 @@ namespace OpenSim.Region.Framework.Scenes // Tell the client that we're totally ready ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); - // Remember in HandleUseCircuitCode, we delayed this to here -// this prims etc, moved down -// if (m_teleportFlags > 0) -// SendInitialDataToMe(); - - // m_log.DebugFormat("[SCENE PRESENCE] Completed movement"); - m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); if (!string.IsNullOrEmpty(m_callbackURI)) @@ -1805,19 +1803,82 @@ namespace OpenSim.Region.Framework.Scenes if (!IsChildAgent) { - ValidateAndSendAppearanceAndAgentData(); + // ValidateAndSendAppearanceAndAgentData(); + + // do it here in line + // so sequence is clear + + // verify baked textures and cache + + bool cachedbaked = false; + + if (m_scene.AvatarFactory != null) + cachedbaked = m_scene.AvatarFactory.ValidateBakedTextureCache(this); + + // not sure we need this + if (!cachedbaked) + { + if (m_scene.AvatarFactory != null) + m_scene.AvatarFactory.QueueAppearanceSave(UUID); + } + + List allpresences = m_scene.GetScenePresences(); + + // send avatar object to all presences including us, so they cross it into region + // then hide if necessary + SendInitialAvatarDataToAllAgents(allpresences); + + // send this look + SendAppearanceToAgent(this); + + // send this animations + UUID[] animIDs = null; + int[] animseqs = null; + UUID[] animsobjs = null; + + if (Animator != null) + Animator.GetArrays(out animIDs, out animseqs, out animsobjs); + + bool haveAnims = (animIDs != null && animseqs != null && animsobjs != null); + + if(haveAnims) + SendAnimPackToAgent(this, animIDs, animseqs, animsobjs); + + // we should be able to receive updates, etc + // so release them + m_inTransit = false; + + // send look and animations to others + // if not cached we send greys + // uncomented if will wait till avatar does baking + //if (cachedbaked) + { + foreach (ScenePresence p in allpresences) + { + if (p == this) + continue; + + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) + continue; + + SendAppearanceToAgentNF(p); + if (haveAnims) + SendAnimPackToAgentNF(p, animIDs, animseqs, animsobjs); + } + } // greys if m_log.DebugFormat("[CompleteMovement] ValidateAndSendAppearanceAndAgentData: {0}ms", Util.EnvironmentTickCountSubtract(ts)); // attachments + if (isNPC || (TeleportFlags & TeleportFlags.ViaLogin) != 0) { if (Scene.AttachmentsModule != null) -// Util.FireAndForget( -// o => -// { + // Util.FireAndForget( + // o => + // { Scene.AttachmentsModule.RezAttachments(this); - // }); + // }); } else { @@ -1829,23 +1890,23 @@ namespace OpenSim.Region.Framework.Scenes // Resume scripts this possible should also be moved down after sending the avatar to viewer ? foreach (SceneObjectGroup sog in m_attachments) { - sog.SendFullUpdateToClient(ControllingClient); SendFullUpdateToClient(ControllingClient); + sog.SendFullUpdateToClient(ControllingClient); if (!sog.HasPrivateAttachmentPoint) { // sog.ScheduleGroupForFullUpdate(); - m_scene.ForEachScenePresence(delegate(ScenePresence p) + foreach(ScenePresence p in allpresences) { if (p == this) - return; + continue; if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) - return; + continue; - sog.SendFullUpdateToClient(p.ControllingClient); SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path - }); + sog.SendFullUpdateToClient(p.ControllingClient); + }; } sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); sog.ResumeScripts(); @@ -1872,25 +1933,14 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat("[CompleteMovement] SendInitialDataToMe: {0}ms", Util.EnvironmentTickCountSubtract(ts)); - if (!IsChildAgent) + if (!IsChildAgent && openChildAgents) { -// moved from makeroot missing in sendInitialDataToMe -// its already there -/* - m_scene.ForEachRootScenePresence(delegate(ScenePresence presence) - { - if (presence != this) - presence.Animator.SendAnimPackToClient(ControllingClient); - }); -*/ - if (openChildAgents) - { IFriendsModule friendsModule = m_scene.RequestModuleInterface(); if (friendsModule != null) friendsModule.SendFriendsOnlineIfNeeded(ControllingClient); m_log.DebugFormat("[CompleteMovement] friendsModule: {0}ms", Util.EnvironmentTickCountSubtract(ts)); - } + } } finally @@ -3481,6 +3531,8 @@ namespace OpenSim.Region.Framework.Scenes /// Do everything required once a client completes its movement into a region and becomes /// a root agent. /// + /// +/* only called from on place, do done inline there private void ValidateAndSendAppearanceAndAgentData() { //m_log.DebugFormat("[SCENE PRESENCE] SendInitialData: {0} ({1})", Name, UUID); @@ -3502,11 +3554,13 @@ namespace OpenSim.Region.Framework.Scenes m_scene.AvatarFactory.QueueAppearanceSave(UUID); } + // send avatar object to all viewers so they cross it into region bool newhide = m_currentParcelHide; m_currentParcelHide = false; SendAvatarDataToAllAgents(); + // now hide if (newhide) { ParcelLoginCheck(m_currentParcelUUID); @@ -3522,7 +3576,7 @@ namespace OpenSim.Region.Framework.Scenes if(Animator!= null) Animator.SendAnimPack(); } - +*/ /// /// Send avatar full data appearance and animations for all other root agents to this agent, this agent /// can be either a child or root @@ -3530,15 +3584,18 @@ namespace OpenSim.Region.Framework.Scenes public void SendOtherAgentsAvatarFullToMe() { int count = 0; - m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence) + m_scene.ForEachRootScenePresence(delegate(ScenePresence p) { // only send information about other root agents - if (scenePresence.UUID == UUID) + if (p.UUID == UUID) return; - scenePresence.SendAvatarDataToAgent(this); - scenePresence.SendAppearanceToAgent(this); - scenePresence.SendAnimPackToAgent(this); + if (p.ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && GodLevel < 200) + return; + + p.SendAvatarDataToAgentNF(this); + p.SendAppearanceToAgentNF(this); + p.SendAnimPackToAgentNF(this); // for now attachments are sent with all SOG count++; }); @@ -3559,7 +3616,6 @@ namespace OpenSim.Region.Framework.Scenes m_log.WarnFormat( "[SCENE PRESENCE]: Attempt to send avatar data from a child agent for {0} in {1}", Name, Scene.RegionInfo.RegionName); - return; } @@ -3575,6 +3631,26 @@ namespace OpenSim.Region.Framework.Scenes m_scene.StatsReporter.AddAgentUpdates(count); } + // sends avatar object to all clients so they cross it into region + // then sends kills to hide + public void SendInitialAvatarDataToAllAgents(List presences) + { + m_lastSize = Appearance.AvatarSize; + int count = 0; + + foreach (ScenePresence p in presences) + { + p.ControllingClient.SendAvatarDataImmediate(this); + if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) + // either just kill the object + // p.ControllingClient.SendKillObject(new List {LocalId}); + // or also attachments viewer may still know about + SendKillTo(p); + count++; + } + m_scene.StatsReporter.AddAgentUpdates(count); + } + /// /// Send avatar data to an agent. /// @@ -3589,9 +3665,9 @@ namespace OpenSim.Region.Framework.Scenes public void SendAvatarDataToAgentNF(ScenePresence avatar) { - avatar.ControllingClient.SendAvatarDataImmediate(this); + avatar.ControllingClient.SendAvatarDataImmediate(this); } - + /// /// Send this agent's appearance to all other root and child agents in the scene /// This agent must be root. @@ -3637,6 +3713,12 @@ namespace OpenSim.Region.Framework.Scenes UUID, Appearance.VisualParams, Appearance.Texture.GetBytes()); } + public void SendAppearanceToAgentNF(ScenePresence avatar) + { + avatar.ControllingClient.SendAppearance( + UUID, Appearance.VisualParams, Appearance.Texture.GetBytes()); + } + public void SendAnimPackToAgent(ScenePresence p) { if (IsChildAgent || Animator == null) @@ -3648,6 +3730,29 @@ namespace OpenSim.Region.Framework.Scenes Animator.SendAnimPackToClient(p.ControllingClient); } + public void SendAnimPackToAgent(ScenePresence p, UUID[] animations, int[] seqs, UUID[] objectIDs) + { + if (IsChildAgent) + return; + + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) + return; + + p.ControllingClient.SendAnimations(animations, seqs, ControllingClient.AgentId, objectIDs); + } + + public void SendAnimPackToAgentNF(ScenePresence p) + { + if (IsChildAgent || Animator == null) + return; + Animator.SendAnimPackToClient(p.ControllingClient); + } + + public void SendAnimPackToAgentNF(ScenePresence p, UUID[] animations, int[] seqs, UUID[] objectIDs) + { + p.ControllingClient.SendAnimations(animations, seqs, ControllingClient.AgentId, objectIDs); + } + public void SendAnimPack(UUID[] animations, int[] seqs, UUID[] objectIDs) { if (IsChildAgent) @@ -5634,22 +5739,6 @@ namespace OpenSim.Region.Framework.Scenes } } - private void ParcelLoginCheck(UUID currentParcelID) - { - List allpresences = m_scene.GetScenePresences(); - - foreach (ScenePresence p in allpresences) - { - if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) - continue; - - if (currentParcelID != p.currentParcelUUID && p.GodLevel < 200) - { - SendKillTo(p); - } - } - } - public void parcelRegionCross() { if (!ParcelHideThisAvatar || GodLevel >= 200) @@ -5817,8 +5906,6 @@ namespace OpenSim.Region.Framework.Scenes if (killsToSendme.Count > 0) { - m_log.Debug("[AVATAR]: killtoMe: " + Lastname + " " + killsToSendme.Count.ToString()); - foreach (ScenePresence p in killsToSendme) { m_log.Debug("[AVATAR]: killToMe: " + Lastname + " " + p.Lastname); -- cgit v1.1 From 1aa335078a15b176215df963980fdb1141494324 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 22 Aug 2014 21:54:00 +0100 Subject: sop SendFullUpdate() goes by presence if it is a attachment --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 15 +++++++++- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 32 +++++++++++++++++----- 2 files changed, 39 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 0930820..6fbe732 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3237,7 +3237,19 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat( // "[SOG]: Sendinging part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId); - + + + if (ParentGroup.IsAttachment) + { + ScenePresence sp = ParentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar); + if (sp != null) + { + sp.SendAttachmentUpdate(this, UpdateRequired.FULL); + } + } + +/* this does nothing +SendFullUpdateToClient(remoteClient, Position) ignores position parameter if (IsRoot) { if (ParentGroup.IsAttachment) @@ -3249,6 +3261,7 @@ namespace OpenSim.Region.Framework.Scenes SendFullUpdateToClient(remoteClient, AbsolutePosition); } } +*/ else { SendFullUpdateToClient(remoteClient); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index faa07d4..d471930 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1891,7 +1891,7 @@ namespace OpenSim.Region.Framework.Scenes foreach (SceneObjectGroup sog in m_attachments) { SendFullUpdateToClient(ControllingClient); - sog.SendFullUpdateToClient(ControllingClient); + SendAttachmentFullUpdateToAgentNF(sog, this); if (!sog.HasPrivateAttachmentPoint) { @@ -1905,7 +1905,7 @@ namespace OpenSim.Region.Framework.Scenes continue; SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path - sog.SendFullUpdateToClient(p.ControllingClient); + SendAttachmentFullUpdateToAgentNF(sog, p); }; } sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); @@ -4745,9 +4745,11 @@ namespace OpenSim.Region.Framework.Scenes { if (p != this && sog.HasPrivateAttachmentPoint) return; + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) return; - sog.SendFullUpdateToClient(p.ControllingClient); + + SendAttachmentFullUpdateToAgentNF(sog, p); SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path }); } @@ -4762,15 +4764,31 @@ namespace OpenSim.Region.Framework.Scenes { foreach (SceneObjectGroup sog in m_attachments) { - if (p == this || !sog.HasPrivateAttachmentPoint) - { - sog.SendFullUpdateToClient(p.ControllingClient); - } + SendAttachmentFullUpdateToAgentNF(sog, p); } SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path } } + public void SendAttachmentFullUpdateToAgentNF(SceneObjectGroup sog, ScenePresence p) + { + if (p != this && sog.HasPrivateAttachmentPoint) + return; + + SceneObjectPart[] parts = sog.Parts; + SceneObjectPart rootpart = sog.RootPart; + + p.ControllingClient.SendEntityUpdate(rootpart, PrimUpdateFlags.FullUpdate); + + for (int i = 0; i < parts.Length; i++) + { + SceneObjectPart part = parts[i]; + if (part == rootpart) + continue; + p.ControllingClient.SendEntityUpdate(part, PrimUpdateFlags.FullUpdate); + } + } + public void SendAttachmentScheduleUpdate(SceneObjectGroup sog) { if (IsChildAgent || IsInTransit) -- cgit v1.1 From 8fd836c29921fdf7c52d7ca99b9c88dd87f8a3c7 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 23 Aug 2014 12:03:55 +0100 Subject: back to sending attachment sog kills in place of the hack. This is the official way of doing it --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index d471930..4632402 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -5965,22 +5965,25 @@ namespace OpenSim.Region.Framework.Scenes Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); } - public void SendFullKillsTo(ScenePresence p) +// kill with attachs root kills + public void SendKillTo(ScenePresence p) { - List ids = new List(); - foreach (SceneObjectGroup sog in m_attachments) - p.ControllingClient.SendPartFullUpdate(sog.RootPart, LocalId + 1); + List ids = new List(m_attachments.Count + 1); ids.Add(LocalId); + foreach (SceneObjectGroup sog in m_attachments) + ids.Add(sog.RootPart.LocalId); p.ControllingClient.SendKillObject(ids); } +/* +// kill with hack public void SendKillTo(ScenePresence p) { foreach (SceneObjectGroup sog in m_attachments) p.ControllingClient.SendPartFullUpdate(sog.RootPart, LocalId + 1); p.ControllingClient.SendKillObject(new List { LocalId }); } - +*/ public void SendViewTo(ScenePresence p) { SendAvatarDataToAgentNF(p); -- cgit v1.1 From 63d1916f511fdbbec8bc111f4bf80b3e4e0bc267 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 23 Aug 2014 20:59:11 +0100 Subject: Remove entities from updates queues on kill. Do it sync so enqueues after the kill work --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 06f1301..3d02f36 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -1660,6 +1660,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP // foreach (uint id in localIDs) // m_log.DebugFormat("[CLIENT]: Sending KillObjectPacket to {0} for {1} in {2}", Name, id, regionHandle); + // remove pending entities + lock (m_entityProps.SyncRoot) + m_entityProps.Remove(localIDs); + lock (m_entityUpdates.SyncRoot) + m_entityUpdates.Remove(localIDs); + KillObjectPacket kill = (KillObjectPacket)PacketPool.Instance.GetPacket(PacketType.KillObject); // TODO: don't create new blocks if recycling an old packet kill.ObjectData = new KillObjectPacket.ObjectDataBlock[localIDs.Count]; -- cgit v1.1 From d55041d9349c6d846fc32c01ea28083f40fd4263 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 23 Aug 2014 21:13:30 +0100 Subject: on updates, send rotations using livomv Quaternion.toBytes() again --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 3d02f36..e62bea6 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -5334,13 +5334,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP Vector3 velocity = new Vector3(0, 0, 0); Vector3 acceleration = new Vector3(0, 0, 0); rotation.Normalize(); - Vector3 vrot = new Vector3(rotation.X, rotation.Y, rotation.Z); data.CollisionPlane.ToBytes(objectData, 0); offsetPosition.ToBytes(objectData, 16); velocity.ToBytes(objectData, 28); acceleration.ToBytes(objectData, 40); - vrot.ToBytes(objectData, 52); + rotation.ToBytes(objectData, 52); data.AngularVelocity.ToBytes(objectData, 64); ObjectUpdatePacket.ObjectDataBlock update = new ObjectUpdatePacket.ObjectDataBlock(); @@ -5400,8 +5399,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP Quaternion rotation = data.RotationOffset; rotation.Normalize(); - Vector3 vrot = new Vector3(rotation.X, rotation.Y, rotation.Z); - vrot.ToBytes(objectData, 36); + rotation.ToBytes(objectData, 36); data.AngularVelocity.ToBytes(objectData, 48); ObjectUpdatePacket.ObjectDataBlock update = new ObjectUpdatePacket.ObjectDataBlock(); -- cgit v1.1 From 06b6238d007123d23f394f38b44f0aced997269e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 23 Aug 2014 22:24:28 +0100 Subject: send avatar kills after attachments, send otherattachments before rest of sog ( updates will mess this again but well... ) --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 4632402..f0ea0ba 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3521,7 +3521,7 @@ namespace OpenSim.Region.Framework.Scenes EntityBase[] entities = Scene.Entities.GetEntities(); foreach (EntityBase e in entities) { - if (e != null && e is SceneObjectGroup) + if (e != null && e is SceneObjectGroup && !((SceneObjectGroup)e).IsAttachment) ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient); } }); @@ -3596,7 +3596,7 @@ namespace OpenSim.Region.Framework.Scenes p.SendAvatarDataToAgentNF(this); p.SendAppearanceToAgentNF(this); p.SendAnimPackToAgentNF(this); - // for now attachments are sent with all SOG + p.SendAttachmentsToAgentNF(this); count++; }); @@ -5969,9 +5969,10 @@ namespace OpenSim.Region.Framework.Scenes public void SendKillTo(ScenePresence p) { List ids = new List(m_attachments.Count + 1); - ids.Add(LocalId); foreach (SceneObjectGroup sog in m_attachments) ids.Add(sog.RootPart.LocalId); + + ids.Add(LocalId); p.ControllingClient.SendKillObject(ids); } -- cgit v1.1 From f4a6be86546b3bfeefbdbade33f2faabdd080c1f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 24 Aug 2014 00:44:14 +0100 Subject: clean sendKill a bit, remove a IsChild that is set too early in a calling path --- .../Region/ClientStack/Linden/UDP/LLClientView.cs | 24 ++-------------------- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 17 +++++++++++++-- 2 files changed, 17 insertions(+), 24 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index e62bea6..e19877c 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -1677,28 +1677,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP kill.Header.Reliable = true; kill.Header.Zerocoded = true; - if (localIDs.Count == 1 && m_scene.GetScenePresence(localIDs[0]) != null) - { - OutPacket(kill, ThrottleOutPacketType.Task); - } - else - { - // We MUST lock for both manipulating the kill record and sending the packet, in order to avoid a race - // condition where a kill can be processed before an out-of-date update for the same object. - // ProcessEntityUpdates() also takes the m_killRecord lock. -// lock (m_killRecord) -// { -// foreach (uint localID in localIDs) -// m_killRecord.Add(localID); - - // The throttle queue used here must match that being used for updates. Otherwise, there is a - // chance that a kill packet put on a separate queue will be sent to the client before an existing - // update packet on another queue. Receiving updates after kills results in unowned and undeletable - // scene objects in a viewer until that viewer is relogged in. - OutPacket(kill, ThrottleOutPacketType.Task); -// } - } - } + OutPacket(kill, ThrottleOutPacketType.Task); + } /// /// Send information about the items contained in a folder to the client. diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f0ea0ba..e61e856 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3590,10 +3590,12 @@ namespace OpenSim.Region.Framework.Scenes if (p.UUID == UUID) return; + // get the avatar, then a kill if can't see it + p.SendInitialAvatarDataToAgent(this); + if (p.ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && GodLevel < 200) return; - p.SendAvatarDataToAgentNF(this); p.SendAppearanceToAgentNF(this); p.SendAnimPackToAgentNF(this); p.SendAttachmentsToAgentNF(this); @@ -3651,6 +3653,16 @@ namespace OpenSim.Region.Framework.Scenes m_scene.StatsReporter.AddAgentUpdates(count); } + public void SendInitialAvatarDataToAgent(ScenePresence p) + { + p.ControllingClient.SendAvatarDataImmediate(this); + if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) + // either just kill the object + // p.ControllingClient.SendKillObject(new List {LocalId}); + // or also attachments viewer may still know about + SendKillTo(p); + } + /// /// Send avatar data to an agent. /// @@ -5959,7 +5971,8 @@ namespace OpenSim.Region.Framework.Scenes if (p == this) continue; SendKillTo(p); - p.SendKillTo(this); + if (!p.IsChildAgent) + p.SendKillTo(this); } if (Scene.AttachmentsModule != null) Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); -- cgit v1.1 From d5814ccf650d4873d66e3978bf2bf70d9fbfbfaf Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 24 Aug 2014 01:04:32 +0100 Subject: *test* move sending kills to before sending the update, this breaks tp abort --- .../CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 781fc40..d8fab4b 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -1115,6 +1115,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // in no close. sp.DoNotCloseAfterTeleport = false; + sp.HasMovedAway(); + // Send the Update. If this returns true, we know the client has contacted the destination // via CompleteMovementIntoRegion, so we can let go. // If it returns false, something went wrong, and we need to abort. @@ -1141,6 +1143,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); +// sp.HasMovedAway(); + // Need to signal neighbours whether child agents may need closing irrespective of whether this // one needed closing. We also need to close child agents as quickly as possible to avoid complicated // race conditions with rapid agent releporting (e.g. from A1 to a non-neighbour B, back @@ -1149,7 +1153,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // abandoned without proper close by viewer but then re-used by an incoming connection. sp.CloseChildAgents(newRegionX, newRegionY); - sp.HasMovedAway(); // May need to logout or other cleanup // AgentHasMovedAway(sp, logout); // AgentHasMovedAway(sp, true); -- cgit v1.1 From 094d8686e597e573dd799e319f1bb3d3397bf38a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 24 Aug 2014 02:23:00 +0100 Subject: put back the kills on tp where they belong --- .../CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index d8fab4b..37aae08 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -1115,8 +1115,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // in no close. sp.DoNotCloseAfterTeleport = false; - sp.HasMovedAway(); - // Send the Update. If this returns true, we know the client has contacted the destination // via CompleteMovementIntoRegion, so we can let go. // If it returns false, something went wrong, and we need to abort. @@ -1143,7 +1141,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); -// sp.HasMovedAway(); + sp.HasMovedAway(); // Need to signal neighbours whether child agents may need closing irrespective of whether this // one needed closing. We also need to close child agents as quickly as possible to avoid complicated @@ -1153,10 +1151,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // abandoned without proper close by viewer but then re-used by an incoming connection. sp.CloseChildAgents(newRegionX, newRegionY); - // May need to logout or other cleanup -// AgentHasMovedAway(sp, logout); // AgentHasMovedAway(sp, true); - // Well, this is it. The agent is over there. // KillEntity(sp.Scene, sp.LocalId); -- cgit v1.1 From 385fcbb75ea9456997194c8fbe155cff41e95605 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 25 Aug 2014 13:58:50 +0100 Subject: *test* send kills and hack --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index e61e856..fb2d29b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -5983,7 +5983,10 @@ namespace OpenSim.Region.Framework.Scenes { List ids = new List(m_attachments.Count + 1); foreach (SceneObjectGroup sog in m_attachments) + { + p.ControllingClient.SendPartFullUpdate(sog.RootPart, LocalId + 1); ids.Add(sog.RootPart.LocalId); + } ids.Add(LocalId); p.ControllingClient.SendKillObject(ids); -- cgit v1.1 From b1f14ad62f23d4cdb44ec529704d53e6eef7eb55 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 25 Aug 2014 14:15:53 +0100 Subject: back to just kills --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index fb2d29b..4fa95fd 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -5984,7 +5984,6 @@ namespace OpenSim.Region.Framework.Scenes List ids = new List(m_attachments.Count + 1); foreach (SceneObjectGroup sog in m_attachments) { - p.ControllingClient.SendPartFullUpdate(sog.RootPart, LocalId + 1); ids.Add(sog.RootPart.LocalId); } -- cgit v1.1