From 04235e58e87ae42617111cad2884e42785914d4e Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 12 Feb 2013 01:02:16 +0100 Subject: Push updates from keyframe directly to the front of the output queue rather than through the update system. --- .../Region/ClientStack/Linden/UDP/LLClientView.cs | 20 ++++++++++++++++++++ OpenSim/Region/Framework/Scenes/KeyframeMotion.cs | 12 ++++++------ OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 7 ++++++- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 14 ++++++++++++-- 4 files changed, 44 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index ca15e3e..8d46415 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -3721,6 +3721,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// public void SendEntityUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags) { + if ((updateFlags & PrimUpdateFlags.Immediate) != 0) + { + SendUnqueuedTerseUpdate((SceneObjectPart)entity); + return; + } + if (entity is SceneObjectPart) { SceneObjectPart e = (SceneObjectPart)entity; @@ -4075,6 +4081,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP ProcessEntityUpdates(-1); } + public void SendUnqueuedTerseUpdate(SceneObjectPart part) + { + ImprovedTerseObjectUpdatePacket packet + = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket( + PacketType.ImprovedTerseObjectUpdate); + packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; + packet.RegionData.TimeDilation = Utils.FloatToUInt16(1.0f, 0.0f, 1.0f); + packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; + + packet.ObjectData[0] = CreateImprovedTerseBlock(part, false); + + OutPacket(packet, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority); + } + #endregion Primitive Packet/Data Sending Methods // These are used to implement an adaptive backoff in the number diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs index 75b16dc..722c031 100644 --- a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs +++ b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs @@ -417,7 +417,7 @@ namespace OpenSim.Region.Framework.Scenes m_group.RootPart.Velocity = Vector3.Zero; m_group.RootPart.AngularVelocity = Vector3.Zero; - m_group.SendGroupRootTerseUpdate(); + m_group.SendGroupRootTerseUpdate(PrimUpdateFlags.Immediate); // m_group.RootPart.ScheduleTerseUpdate(); m_frames.Clear(); } @@ -429,7 +429,7 @@ namespace OpenSim.Region.Framework.Scenes m_group.RootPart.Velocity = Vector3.Zero; m_group.RootPart.AngularVelocity = Vector3.Zero; - m_group.SendGroupRootTerseUpdate(); + m_group.SendGroupRootTerseUpdate(PrimUpdateFlags.Immediate); // m_group.RootPart.ScheduleTerseUpdate(); } @@ -551,7 +551,7 @@ namespace OpenSim.Region.Framework.Scenes if (m_group.RootPart.Velocity != Vector3.Zero) { m_group.RootPart.Velocity = Vector3.Zero; - m_group.SendGroupRootTerseUpdate(); + m_group.SendGroupRootTerseUpdate(PrimUpdateFlags.Immediate); } return; @@ -695,7 +695,7 @@ namespace OpenSim.Region.Framework.Scenes if (update) { - m_group.SendGroupRootTerseUpdate(); + m_group.SendGroupRootTerseUpdate(PrimUpdateFlags.Immediate); } } @@ -731,7 +731,7 @@ namespace OpenSim.Region.Framework.Scenes if (m_group.RootPart.Velocity != Vector3.Zero) { m_group.RootPart.Velocity = Vector3.Zero; - m_group.SendGroupRootTerseUpdate(); + m_group.SendGroupRootTerseUpdate(PrimUpdateFlags.Immediate); // m_group.RootPart.ScheduleTerseUpdate(); } } @@ -743,7 +743,7 @@ namespace OpenSim.Region.Framework.Scenes if (m_group != null) { m_group.RootPart.Velocity = Vector3.Zero; - m_group.SendGroupRootTerseUpdate(); + m_group.SendGroupRootTerseUpdate(PrimUpdateFlags.Immediate); // m_group.RootPart.ScheduleTerseUpdate(); if (m_running) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index ed1bbd8..910f42e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2638,10 +2638,15 @@ namespace OpenSim.Region.Framework.Scenes /// public void SendGroupRootTerseUpdate() { + SendGroupRootTerseUpdate(0); + } + + public void SendGroupRootTerseUpdate(PrimUpdateFlags flags) + { if (IsDeleted) return; - RootPart.SendTerseUpdateToAllClients(); + RootPart.SendTerseUpdateToAllClients(flags); } public void QueueForUpdateCheck() diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 20a6626..7e94eda 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3315,6 +3315,11 @@ namespace OpenSim.Region.Framework.Scenes /// public void SendTerseUpdateToAllClients() { + SendTerseUpdateToAllClients(0); + } + + public void SendTerseUpdateToAllClients(PrimUpdateFlags flags) + { if (ParentGroup == null || ParentGroup.Scene == null) return; @@ -3328,7 +3333,7 @@ namespace OpenSim.Region.Framework.Scenes ParentGroup.Scene.ForEachClient(delegate(IClientAPI client) { - SendTerseUpdateToClient(client); + SendTerseUpdateToClient(client, flags); }); } @@ -5133,6 +5138,11 @@ namespace OpenSim.Region.Framework.Scenes public void SendTerseUpdateToClient(IClientAPI remoteClient) { + SendTerseUpdateToClient(remoteClient, 0); + } + + public void SendTerseUpdateToClient(IClientAPI remoteClient, PrimUpdateFlags flags) + { if (ParentGroup.IsDeleted) return; @@ -5146,7 +5156,7 @@ namespace OpenSim.Region.Framework.Scenes remoteClient.SendEntityUpdate( this, PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity - | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); + | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity | flags); ParentGroup.Scene.StatsReporter.AddObjectUpdates(1); } -- cgit v1.1