diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 6a6bd12..56f8880 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -3591,7 +3591,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3591 | double priority = m_prioritizer.GetUpdatePriority(this, entity); | 3591 | double priority = m_prioritizer.GetUpdatePriority(this, entity); |
3592 | 3592 | ||
3593 | lock (m_entityUpdates.SyncRoot) | 3593 | lock (m_entityUpdates.SyncRoot) |
3594 | m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags), entity.LocalId); | 3594 | m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags, m_scene.TimeDilation), entity.LocalId); |
3595 | } | 3595 | } |
3596 | 3596 | ||
3597 | private void ProcessEntityUpdates(int maxUpdates) | 3597 | private void ProcessEntityUpdates(int maxUpdates) |
@@ -3604,6 +3604,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3604 | if (maxUpdates <= 0) maxUpdates = Int32.MaxValue; | 3604 | if (maxUpdates <= 0) maxUpdates = Int32.MaxValue; |
3605 | int updatesThisCall = 0; | 3605 | int updatesThisCall = 0; |
3606 | 3606 | ||
3607 | float avgTimeDilation = 0; | ||
3608 | |||
3607 | EntityUpdate update; | 3609 | EntityUpdate update; |
3608 | while (updatesThisCall < maxUpdates) | 3610 | while (updatesThisCall < maxUpdates) |
3609 | { | 3611 | { |
@@ -3611,6 +3613,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3611 | if (!m_entityUpdates.TryDequeue(out update)) | 3613 | if (!m_entityUpdates.TryDequeue(out update)) |
3612 | break; | 3614 | break; |
3613 | 3615 | ||
3616 | avgTimeDilation += update.TimeDilation; | ||
3617 | avgTimeDilation *= 0.5f; | ||
3618 | |||
3614 | if (update.Entity is SceneObjectPart) | 3619 | if (update.Entity is SceneObjectPart) |
3615 | { | 3620 | { |
3616 | SceneObjectPart part = (SceneObjectPart)update.Entity; | 3621 | SceneObjectPart part = (SceneObjectPart)update.Entity; |
@@ -3790,8 +3795,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3790 | #region Packet Sending | 3795 | #region Packet Sending |
3791 | 3796 | ||
3792 | const float TIME_DILATION = 1.0f; | 3797 | const float TIME_DILATION = 1.0f; |
3793 | ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); | 3798 | ushort timeDilation = Utils.FloatToUInt16(avgTimeDilation, 0.0f, 1.0f); |
3794 | 3799 | ||
3795 | if (terseAgentUpdateBlocks.IsValueCreated) | 3800 | if (terseAgentUpdateBlocks.IsValueCreated) |
3796 | { | 3801 | { |
3797 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value; | 3802 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value; |
@@ -3830,7 +3835,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3830 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | 3835 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; |
3831 | packet.RegionData.TimeDilation = timeDilation; | 3836 | packet.RegionData.TimeDilation = timeDilation; |
3832 | packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count]; | 3837 | packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count]; |
3833 | 3838 | ||
3834 | for (int i = 0; i < blocks.Count; i++) | 3839 | for (int i = 0; i < blocks.Count; i++) |
3835 | packet.ObjectData[i] = blocks[i]; | 3840 | packet.ObjectData[i] = blocks[i]; |
3836 | 3841 | ||