From c24601bc6a9be5ab84a8c7b4600382ef9f0c895e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 25 Aug 2014 21:49:39 +0100 Subject: change enconding of attachment updates NameValue and State fields --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index e19877c..b45d561 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -5393,6 +5393,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP //update.JointType = 0; update.Material = data.Material; update.MediaURL = Utils.EmptyBytes; // FIXME: Support this in OpenSim +/* if (data.ParentGroup.IsAttachment) { update.NameValue = Util.StringToBytes256("AttachItemID STRING RW SV " + data.ParentGroup.FromItemID); @@ -5406,6 +5407,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP // case for attachments may contain conflicting values that can end up crashing the viewer. update.State = data.ParentGroup.RootPart.Shape.State; } + */ + + if (data.ParentGroup.IsAttachment) + { + if (data.UUID != data.ParentGroup.RootPart.UUID) + { + update.NameValue = Util.StringToBytes256("AttachItemID STRING RW SV " + data.ParentGroup.FromItemID); + } + else + update.NameValue = Utils.EmptyBytes; + + int st = (int)data.ParentGroup.RootPart.Shape.State; + st = (st & 0xf0) >> 4 + (st & 0x0f) << 4; + update.State = (byte)st; + } +// else +// update.State = data.Shape.State; // not sure about this + // m_log.DebugFormat( // "[LLCLIENTVIEW]: Sending state {0} for {1} {2} to {3}", -- cgit v1.1 From 75cbe620c025dba998d8291277e499ecb27a250c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 25 Aug 2014 22:45:31 +0100 Subject: *test* cleanup the bugs nest --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index b45d561..0663983 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -5411,19 +5411,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (data.ParentGroup.IsAttachment) { - if (data.UUID != data.ParentGroup.RootPart.UUID) + if (data.UUID == data.ParentGroup.RootPart.UUID) { update.NameValue = Util.StringToBytes256("AttachItemID STRING RW SV " + data.ParentGroup.FromItemID); } else update.NameValue = Utils.EmptyBytes; - int st = (int)data.ParentGroup.RootPart.Shape.State; - st = (st & 0xf0) >> 4 + (st & 0x0f) << 4; - update.State = (byte)st; + int st = (int)data.ParentGroup.AttachmentPoint; + update.State = (byte)(((st & 0xf0) >> 4) + ((st & 0x0f) << 4)); ; + } + else + { + update.NameValue = Utils.EmptyBytes; + update.State = data.Shape.State; // not sure about this } -// else -// update.State = data.Shape.State; // not sure about this // m_log.DebugFormat( -- cgit v1.1 From 6857afe2a4ca73da904b9928c282c0087ff4b3bf Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 25 Aug 2014 23:31:04 +0100 Subject: *test* back to no sog kills, little retouch on attachment updates, NameValue AttachItemID is a root part thing only --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 2 +- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 0663983..7087bb7 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -5411,7 +5411,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (data.ParentGroup.IsAttachment) { - if (data.UUID == data.ParentGroup.RootPart.UUID) + if (data.IsRoot) { update.NameValue = Util.StringToBytes256("AttachItemID STRING RW SV " + data.ParentGroup.FromItemID); } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 4fa95fd..58d3ef6 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -5982,10 +5982,10 @@ namespace OpenSim.Region.Framework.Scenes public void SendKillTo(ScenePresence p) { List ids = new List(m_attachments.Count + 1); - foreach (SceneObjectGroup sog in m_attachments) - { - ids.Add(sog.RootPart.LocalId); - } +// foreach (SceneObjectGroup sog in m_attachments) +// { +// ids.Add(sog.RootPart.LocalId); +// } ids.Add(LocalId); p.ControllingClient.SendKillObject(ids); -- cgit v1.1 From 3ee6144d0ca1d35d6660b006b89fc883e1a2bfda Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 26 Aug 2014 00:00:21 +0100 Subject: even less kills on tps --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 58d3ef6..9fe3a9e 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -5966,7 +5966,7 @@ namespace OpenSim.Region.Framework.Scenes public void HasMovedAway() { List allpresences = m_scene.GetScenePresences(); - foreach (ScenePresence p in allpresences) + /* foreach (ScenePresence p in allpresences) { if (p == this) continue; @@ -5974,6 +5974,7 @@ namespace OpenSim.Region.Framework.Scenes if (!p.IsChildAgent) p.SendKillTo(this); } + */ if (Scene.AttachmentsModule != null) Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); } -- cgit v1.1 From dde2ac254497053bb7ec8e5f1757ddf13e5ea033 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 26 Aug 2014 02:22:25 +0100 Subject: still testing --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 56 ++++++++++++------------ 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 9fe3a9e..2b1b342 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1887,29 +1887,26 @@ namespace OpenSim.Region.Framework.Scenes 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 m_attachments) + foreach(SceneObjectGroup sog in m_attachments) { - SendFullUpdateToClient(ControllingClient); - SendAttachmentFullUpdateToAgentNF(sog, this); + sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); + sog.ResumeScripts(); + } - if (!sog.HasPrivateAttachmentPoint) + foreach (ScenePresence p in allpresences) + { + if (p == this) { - // sog.ScheduleGroupForFullUpdate(); - foreach(ScenePresence p in allpresences) - { - if (p == this) - continue; + SendTerseUpdateToAgentNF(this); + SendAttachmentsToAgentNF(this); + continue; + } - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) - continue; + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) + continue; - SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path - SendAttachmentFullUpdateToAgentNF(sog, p); - }; - } - sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); - sog.ResumeScripts(); + SendTerseUpdateToAgentNF(p); + SendAttachmentsToAgentNF(p); } } } @@ -3428,7 +3425,9 @@ namespace OpenSim.Region.Framework.Scenes if (remoteClient.IsActive) { //m_log.DebugFormat("[SCENE PRESENCE]: " + Name + " sending TerseUpdate to " + remoteClient.Name + " : Pos={0} Rot={1} Vel={2}", m_pos, Rotation, m_velocity); - remoteClient.SendEntityUpdate(this, PrimUpdateFlags.FullUpdate); + remoteClient.SendEntityUpdate(this, + PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity + | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); m_scene.StatsReporter.AddAgentUpdates(1); } } @@ -4761,8 +4760,8 @@ namespace OpenSim.Region.Framework.Scenes if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) return; + SendTerseUpdateToAgentNF(p); SendAttachmentFullUpdateToAgentNF(sog, p); - SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path }); } } @@ -4772,13 +4771,13 @@ namespace OpenSim.Region.Framework.Scenes // for now they are checked in several places down the line... public void SendAttachmentsToAgentNF(ScenePresence p) { + SendTerseUpdateToAgentNF(p); lock (m_attachments) { foreach (SceneObjectGroup sog in m_attachments) { SendAttachmentFullUpdateToAgentNF(sog, p); - } - SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path + } } } @@ -5966,7 +5965,7 @@ namespace OpenSim.Region.Framework.Scenes public void HasMovedAway() { List allpresences = m_scene.GetScenePresences(); - /* foreach (ScenePresence p in allpresences) + foreach (ScenePresence p in allpresences) { if (p == this) continue; @@ -5974,19 +5973,20 @@ namespace OpenSim.Region.Framework.Scenes if (!p.IsChildAgent) p.SendKillTo(this); } - */ + if (Scene.AttachmentsModule != null) Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); } + // kill with attachs root kills public void SendKillTo(ScenePresence p) { List ids = new List(m_attachments.Count + 1); -// foreach (SceneObjectGroup sog in m_attachments) -// { -// ids.Add(sog.RootPart.LocalId); -// } + foreach (SceneObjectGroup sog in m_attachments) + { + ids.Add(sog.RootPart.LocalId); + } ids.Add(LocalId); p.ControllingClient.SendKillObject(ids); -- cgit v1.1 From 92b0b27caff9f73f619e1df32a430706b53f6782 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 26 Aug 2014 17:42:44 +0100 Subject: dont append acks to a resend packet --- OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 3b0312d..dea9d7f 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -1245,7 +1245,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP int dataLength = buffer.DataLength; // NOTE: I'm seeing problems with some viewers when ACKs are appended to zerocoded packets so I've disabled that here - if (!isZerocoded) + if (!isZerocoded && !isResend) { // Keep appending ACKs until there is no room left in the buffer or there are // no more ACKs to append -- cgit v1.1 From 620443f85840aab0f2ddc4a88656a166cc148b69 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 27 Aug 2014 00:37:05 +0100 Subject: on TPs to nearby regions, only send kills if needed by parcel privacy --- .../EntityTransfer/EntityTransferModule.cs | 12 ++++--- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 38 +++++++++++++++++----- 2 files changed, 37 insertions(+), 13 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 37aae08..b3e556f 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -986,7 +986,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // Well, this is it. The agent is over there. // KillEntity(sp.Scene, sp.LocalId); - sp.HasMovedAway(); + bool nearRegion = sp.KnownRegions.ContainsKey(destinationHandle); + sp.HasMovedAway(nearRegion); // Now let's make it officially a child agent sp.MakeChildAgent(); @@ -1141,7 +1142,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); - sp.HasMovedAway(); + bool nearRegion = sp.KnownRegions.ContainsKey(destinationHandle); + sp.HasMovedAway(nearRegion); // 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 @@ -1784,9 +1786,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp); // this may need the attachments - agent.parcelRegionCross(); - AgentHasMovedAway(agent, true); + agent.HasMovedAway(true); +// agent.parcelRegionCross(); + +// AgentHasMovedAway(agent, true); agent.MakeChildAgent(); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 2b1b342..d7656e8 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -5962,18 +5962,38 @@ namespace OpenSim.Region.Framework.Scenes } } - public void HasMovedAway() + public void HasMovedAway(bool nearRegion) { - List allpresences = m_scene.GetScenePresences(); - foreach (ScenePresence p in allpresences) + + if (nearRegion) { - if (p == this) - continue; - SendKillTo(p); - if (!p.IsChildAgent) - p.SendKillTo(this); - } + if (!ParcelHideThisAvatar || GodLevel >= 200) + return; + + List allpresences = m_scene.GetScenePresences(); + foreach (ScenePresence p in allpresences) + { + if (p.IsDeleted || p == this || p.IsChildAgent || p.ControllingClient == null || !p.ControllingClient.IsActive) + continue; + if (p.currentParcelUUID == m_currentParcelUUID) + { + p.SendKillTo(this); + } + } + } + else + { + List allpresences = m_scene.GetScenePresences(); + foreach (ScenePresence p in allpresences) + { + if (p == this) + continue; + SendKillTo(p); + if (!p.IsChildAgent) + p.SendKillTo(this); + } + } if (Scene.AttachmentsModule != null) Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); } -- cgit v1.1 From 07ee101a057c9b5dee27c4248ce15dd8bfaae380 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 27 Aug 2014 01:09:11 +0100 Subject: bug fix. Was not deleting attachments if on public parcel --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index d7656e8..5868251 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -5967,6 +5967,9 @@ namespace OpenSim.Region.Framework.Scenes if (nearRegion) { + if (Scene.AttachmentsModule != null) + Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); + if (!ParcelHideThisAvatar || GodLevel >= 200) return; @@ -5993,9 +5996,10 @@ namespace OpenSim.Region.Framework.Scenes if (!p.IsChildAgent) p.SendKillTo(this); } + + if (Scene.AttachmentsModule != null) + Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); } - if (Scene.AttachmentsModule != null) - Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); } -- cgit v1.1 From 1e888d61caf80c3ac5748fb3550dd8137818f4cd Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 27 Aug 2014 01:33:09 +0100 Subject: enqueue also if m_nextPackets[category] is not null. This is really the top element of a category queue, equivalente to using a queue.peek() if avaiable --- OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index fe31bd9..8852715 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs @@ -364,6 +364,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP int texture = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; int asset = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); + int total = resend + land + wind + cloud + task + texture + asset; + total /= 128; + // Make sure none of the throttles are set below our packet MTU, // otherwise a throttle could become permanently clogged resend = Math.Max(resend, LLUDPServer.MTU); @@ -379,8 +382,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP // the task queue (e.g. object updates) task = task + (int)(m_cannibalrate * texture); texture = (int)((1 - m_cannibalrate) * texture); - - //int total = resend + land + wind + cloud + task + texture + asset; + + total = resend + land + wind + cloud + task + texture + asset; + total /= 128; //m_log.DebugFormat("[LLUDPCLIENT]: {0} is setting throttles. Resend={1}, Land={2}, Wind={3}, Cloud={4}, Task={5}, Texture={6}, Asset={7}, Total={8}", // AgentID, resend, land, wind, cloud, task, texture, asset, total); @@ -484,7 +488,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Don't send this packet if there is already a packet waiting in the queue // even if we have the tokens to send it, tokens should go to the already // queued packets - if (queue.Count > 0) + if (queue.Count > 0 || m_nextPackets[category] != null) { queue.Enqueue(packet, highPriority); return true; @@ -528,7 +532,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// True if any packets were sent, otherwise false public bool DequeueOutgoing() { - if (m_deliverPackets == false) return false; +// if (m_deliverPackets == false) return false; OutgoingPacket packet = null; DoubleLocklessQueue queue; -- cgit v1.1