diff options
author | Teravus Ovares (Dan Olivares) | 2010-12-23 03:30:09 -0500 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2010-12-23 03:30:09 -0500 |
commit | 46db73b62baec7baf0e33d83efbaafaadcd4db0d (patch) | |
tree | 1891cc6883f09a56cd45ea54917fc6f5609efa07 /OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |
parent | Added a counter to NewFiles in Xfers to account for simultaneous object inven... (diff) | |
download | opensim-SC-46db73b62baec7baf0e33d83efbaafaadcd4db0d.zip opensim-SC-46db73b62baec7baf0e33d83efbaafaadcd4db0d.tar.gz opensim-SC-46db73b62baec7baf0e33d83efbaafaadcd4db0d.tar.bz2 opensim-SC-46db73b62baec7baf0e33d83efbaafaadcd4db0d.tar.xz |
* Re-Adding Scene TimeDilation to Object Update Packets.
* Added Calculating Time Dilation in the OdePlubin
* When multiple object updates are stuffed into one packet, average the time dilation between them as a compromise.
* Time Dilation on the update is calculated when the EntityUpdate object is created. The pre-calc-ed TD is stored in the Entity update and used when it goes out on the wire. Previously, it was 1.0 all the time. The time dilation is tied to when the update is created, not when the update is sent.
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 929f282..f27a6eb 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -3554,7 +3554,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3554 | double priority = m_prioritizer.GetUpdatePriority(this, entity); | 3554 | double priority = m_prioritizer.GetUpdatePriority(this, entity); |
3555 | 3555 | ||
3556 | lock (m_entityUpdates.SyncRoot) | 3556 | lock (m_entityUpdates.SyncRoot) |
3557 | m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags), entity.LocalId); | 3557 | m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags, m_scene.TimeDilation), entity.LocalId); |
3558 | } | 3558 | } |
3559 | 3559 | ||
3560 | private void ProcessEntityUpdates(int maxUpdates) | 3560 | private void ProcessEntityUpdates(int maxUpdates) |
@@ -3570,14 +3570,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3570 | // We must lock for both manipulating the kill record and sending the packet, in order to avoid a race | 3570 | // We must lock for both manipulating the kill record and sending the packet, in order to avoid a race |
3571 | // condition where a kill can be processed before an out-of-date update for the same object. | 3571 | // condition where a kill can be processed before an out-of-date update for the same object. |
3572 | lock (m_killRecord) | 3572 | lock (m_killRecord) |
3573 | { | 3573 | { |
3574 | float avgTimeDilation = 1.0f; | ||
3574 | EntityUpdate update; | 3575 | EntityUpdate update; |
3575 | while (updatesThisCall < maxUpdates) | 3576 | while (updatesThisCall < maxUpdates) |
3576 | { | 3577 | { |
3577 | lock (m_entityUpdates.SyncRoot) | 3578 | lock (m_entityUpdates.SyncRoot) |
3578 | if (!m_entityUpdates.TryDequeue(out update)) | 3579 | if (!m_entityUpdates.TryDequeue(out update)) |
3579 | break; | 3580 | break; |
3580 | 3581 | avgTimeDilation += update.TimeDilation; | |
3582 | avgTimeDilation *= 0.5f; | ||
3583 | |||
3581 | if (update.Entity is SceneObjectPart) | 3584 | if (update.Entity is SceneObjectPart) |
3582 | { | 3585 | { |
3583 | SceneObjectPart part = (SceneObjectPart)update.Entity; | 3586 | SceneObjectPart part = (SceneObjectPart)update.Entity; |
@@ -3725,8 +3728,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3725 | 3728 | ||
3726 | #region Packet Sending | 3729 | #region Packet Sending |
3727 | 3730 | ||
3728 | const float TIME_DILATION = 1.0f; | 3731 | //const float TIME_DILATION = 1.0f; |
3729 | ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); | 3732 | |
3733 | |||
3734 | ushort timeDilation = Utils.FloatToUInt16(avgTimeDilation, 0.0f, 1.0f); | ||
3730 | 3735 | ||
3731 | if (terseAgentUpdateBlocks.IsValueCreated) | 3736 | if (terseAgentUpdateBlocks.IsValueCreated) |
3732 | { | 3737 | { |
@@ -3739,7 +3744,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3739 | 3744 | ||
3740 | for (int i = 0; i < blocks.Count; i++) | 3745 | for (int i = 0; i < blocks.Count; i++) |
3741 | packet.ObjectData[i] = blocks[i]; | 3746 | packet.ObjectData[i] = blocks[i]; |
3742 | 3747 | ||
3748 | |||
3743 | OutPacket(packet, ThrottleOutPacketType.Unknown, true); | 3749 | OutPacket(packet, ThrottleOutPacketType.Unknown, true); |
3744 | } | 3750 | } |
3745 | 3751 | ||