From 7d2aad38730111abfaceebfc3aa8758376918d81 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 21 Oct 2014 18:27:09 +0100 Subject: [PATCH] For now, send all non-full terse updates for ones own avatar directly to the LLUDP client stack rather than queueing internally within LLClientView. When an HG avatar enters a scene, it delays processing of entity updates. Could be crowding out by other updates or something else. This delay in ones own av mvmt updates results in mvmt lag experienced on the client. Avoiding the internal LLClientView for these packets appears to resolve this issue. Appears most noticeably for avatars with attachments, though has also been seen on those without sometimes. Hasn't been observed for non-HG avatars in general. Will be investigating exactly what the problem is, at which point there will be a more permanent solution. --- .../ClientStack/Linden/UDP/LLClientView.cs | 22 +++++++++++++++---- .../ClientStack/Linden/UDP/LLUDPServer.cs | 9 ++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index c839c05a3a..c8c00c83ee 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -3834,11 +3834,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// public void SendEntityUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags) { - //double priority = m_prioritizer.GetUpdatePriority(this, entity); - uint priority = m_prioritizer.GetUpdatePriority(this, entity); + if (entity.UUID == m_agentId && !updateFlags.HasFlag(PrimUpdateFlags.FullUpdate)) + { + ImprovedTerseObjectUpdatePacket packet + = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate); - lock (m_entityUpdates.SyncRoot) - m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags, m_scene.TimeDilation)); + packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; + packet.RegionData.TimeDilation = Utils.FloatToUInt16(1, 0.0f, 1.0f); + packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; + packet.ObjectData[0] = CreateImprovedTerseBlock(entity, false); + OutPacket(packet, ThrottleOutPacketType.Unknown, true); + } + else + { + //double priority = m_prioritizer.GetUpdatePriority(this, entity); + uint priority = m_prioritizer.GetUpdatePriority(this, entity); + + lock (m_entityUpdates.SyncRoot) + m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags, m_scene.TimeDilation)); + } } /// diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 64548f25d2..415a22efa6 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -898,6 +898,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP // packet so that it isn't sent before a queued update packet. bool forceQueue = (type == PacketType.KillObject); +// if (type == PacketType.ImprovedTerseObjectUpdate) +// { +// m_log.DebugFormat("Direct send ITOU to {0} in {1}", udpClient.AgentID, Scene.Name); +// SendPacketFinal(outgoingPacket); +// return false; +// } +// else +// { if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, forceQueue)) { SendPacketFinal(outgoingPacket); @@ -907,6 +915,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { return false; } +// } #endregion Queue or Send }