aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP
diff options
context:
space:
mode:
authorUbitUmarov2014-10-31 23:34:43 +0000
committerUbitUmarov2014-10-31 23:34:43 +0000
commitba8e1efb434e9584972c56b9706752bb82a80057 (patch)
treefa9f134c4fb6d80cca61ef2b47efd03f2c2ef5ae /OpenSim/Region/ClientStack/Linden/UDP
parent set udp SocketOptionName.ReuseAddress to false, to not allow two regions (diff)
downloadopensim-SC-ba8e1efb434e9584972c56b9706752bb82a80057.zip
opensim-SC-ba8e1efb434e9584972c56b9706752bb82a80057.tar.gz
opensim-SC-ba8e1efb434e9584972c56b9706752bb82a80057.tar.bz2
opensim-SC-ba8e1efb434e9584972c56b9706752bb82a80057.tar.xz
sadly revert to resend terseUpdates enqueuing them back into entityupdates
queue. Viewers fail to handle correctly out of order updates with ugly visible effects. Make sure these packets don't include acks so they aren't lost.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs49
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs2
2 files changed, 47 insertions, 4 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 6f42990..da30a04 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -3824,6 +3824,49 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3824 m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags, m_scene.TimeDilation)); 3824 m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags, m_scene.TimeDilation));
3825 } 3825 }
3826 3826
3827
3828 /// <summary>
3829 /// Requeue an EntityUpdate when it was not acknowledged by the client.
3830 /// We will update the priority and put it in the correct queue, merging update flags
3831 /// with any other updates that may be queued for the same entity.
3832 /// The original update time is used for the merged update.
3833 /// </summary>
3834 private void ResendPrimUpdate(EntityUpdate update)
3835 {
3836 // If the update exists in priority queue, it will be updated.
3837 // If it does not exist then it will be added with the current (rather than its original) priority
3838 uint priority = m_prioritizer.GetUpdatePriority(this, update.Entity);
3839
3840 lock (m_entityUpdates.SyncRoot)
3841 m_entityUpdates.Enqueue(priority, update);
3842 }
3843
3844 /// <summary>
3845 /// Requeue a list of EntityUpdates when they were not acknowledged by the client.
3846 /// We will update the priority and put it in the correct queue, merging update flags
3847 /// with any other updates that may be queued for the same entity.
3848 /// The original update time is used for the merged update.
3849 /// </summary>
3850 private void ResendPrimUpdates(List<EntityUpdate> updates, OutgoingPacket oPacket)
3851 {
3852 // m_log.WarnFormat("[CLIENT] resending prim updates {0}, packet sequence number {1}", updates[0].UpdateTime, oPacket.SequenceNumber);
3853
3854 // Remove the update packet from the list of packets waiting for acknowledgement
3855 // because we are requeuing the list of updates. They will be resent in new packets
3856 // with the most recent state and priority.
3857 m_udpClient.NeedAcks.Remove(oPacket.SequenceNumber);
3858
3859 // Count this as a resent packet since we are going to requeue all of the updates contained in it
3860 Interlocked.Increment(ref m_udpClient.PacketsResent);
3861
3862 // We're not going to worry about interlock yet since its not currently critical that this total count
3863 // is 100% correct
3864 m_udpServer.PacketsResentCount++;
3865
3866 foreach (EntityUpdate update in updates)
3867 ResendPrimUpdate(update);
3868 }
3869
3827 private void ProcessEntityUpdates(int maxUpdates) 3870 private void ProcessEntityUpdates(int maxUpdates)
3828 { 3871 {
3829 OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>(); 3872 OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>();
@@ -4044,7 +4087,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4044 for (int i = 0; i < blocks.Count; i++) 4087 for (int i = 0; i < blocks.Count; i++)
4045 packet.ObjectData[i] = blocks[i]; 4088 packet.ObjectData[i] = blocks[i];
4046 4089
4047 OutPacket(packet, ThrottleOutPacketType.Unknown, true); 4090 OutPacket(packet, ThrottleOutPacketType.Unknown, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseUpdates.Value, oPacket); });
4048 } 4091 }
4049 4092
4050 if (objectUpdateBlocks.IsValueCreated) 4093 if (objectUpdateBlocks.IsValueCreated)
@@ -4090,8 +4133,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4090 4133
4091 for (int i = 0; i < blocks.Count; i++) 4134 for (int i = 0; i < blocks.Count; i++)
4092 packet.ObjectData[i] = blocks[i]; 4135 packet.ObjectData[i] = blocks[i];
4093 4136
4094 OutPacket(packet, ThrottleOutPacketType.Task, true); 4137 OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseUpdates.Value, oPacket); });
4095 } 4138 }
4096 4139
4097 #endregion Packet Sending 4140 #endregion Packet Sending
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index 99e7aba..f66534d 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
1245 int dataLength = buffer.DataLength; 1245 int dataLength = buffer.DataLength;
1246 1246
1247 // NOTE: I'm seeing problems with some viewers when ACKs are appended to zerocoded packets so I've disabled that here 1247 // NOTE: I'm seeing problems with some viewers when ACKs are appended to zerocoded packets so I've disabled that here
1248 if (!isZerocoded && !isResend) 1248 if (!isZerocoded && !isResend && outgoingPacket.UnackedMethod == null)
1249 { 1249 {
1250 // Keep appending ACKs until there is no room left in the buffer or there are 1250 // Keep appending ACKs until there is no room left in the buffer or there are
1251 // no more ACKs to append 1251 // no more ACKs to append