aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden
diff options
context:
space:
mode:
authorUbitUmarov2014-08-28 10:38:31 +0100
committerUbitUmarov2014-08-28 10:38:31 +0100
commitade4bf69b173958fb8b8309760cee9b87cfe2927 (patch)
treef9ed5de349675d90ad5a2261686c178a4e33b05a /OpenSim/Region/ClientStack/Linden
parent try to make child presence know its root region. Incomplete, some paths dont... (diff)
downloadopensim-SC-ade4bf69b173958fb8b8309760cee9b87cfe2927.zip
opensim-SC-ade4bf69b173958fb8b8309760cee9b87cfe2927.tar.gz
opensim-SC-ade4bf69b173958fb8b8309760cee9b87cfe2927.tar.bz2
opensim-SC-ade4bf69b173958fb8b8309760cee9b87cfe2927.tar.xz
if we send wearables with ThrottleOutPacketType.HighPriority, then we
should send other avatarinformation with same priority on same Task category ( plus cleanup )
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs111
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs32
2 files changed, 18 insertions, 125 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 7087bb7..e82f1d7 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -3694,7 +3694,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3694 // avp.AppearanceData[0].CofVersion = 0; 3694 // avp.AppearanceData[0].CofVersion = 0;
3695 3695
3696 //m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString()); 3696 //m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString());
3697 OutPacket(avp, ThrottleOutPacketType.Task); 3697 OutPacket(avp, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority);
3698 } 3698 }
3699 3699
3700 public void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs) 3700 public void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs)
@@ -3722,7 +3722,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3722 ani.AnimationSourceList[i].ObjectID = objectIDs[i]; 3722 ani.AnimationSourceList[i].ObjectID = objectIDs[i];
3723 } 3723 }
3724 ani.Header.Reliable = false; 3724 ani.Header.Reliable = false;
3725 OutPacket(ani, ThrottleOutPacketType.Task); 3725 OutPacket(ani, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority);
3726 } 3726 }
3727 3727
3728 #endregion 3728 #endregion
@@ -3751,7 +3751,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3751 objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; 3751 objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
3752 objupdate.ObjectData[0] = CreateAvatarUpdateBlock(presence); 3752 objupdate.ObjectData[0] = CreateAvatarUpdateBlock(presence);
3753 3753
3754 OutPacket(objupdate, ThrottleOutPacketType.Task); 3754 OutPacket(objupdate, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority);
3755 3755
3756 // We need to record the avatar local id since the root prim of an attachment points to this. 3756 // We need to record the avatar local id since the root prim of an attachment points to this.
3757// m_attachmentsSent.Add(avatar.LocalId); 3757// m_attachmentsSent.Add(avatar.LocalId);
@@ -3824,65 +3824,6 @@ 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 /* dont use this
3828 udp packet resent must be done at udp level only
3829 re map from a packet to original updates just doesnt work
3830
3831 /// <summary>
3832 /// Requeue an EntityUpdate when it was not acknowledged by the client.
3833 /// We will update the priority and put it in the correct queue, merging update flags
3834 /// with any other updates that may be queued for the same entity.
3835 /// The original update time is used for the merged update.
3836 /// </summary>
3837 private void ResendPrimUpdate(EntityUpdate update)
3838 {
3839 // If the update exists in priority queue, it will be updated.
3840 // If it does not exist then it will be added with the current (rather than its original) priority
3841 uint priority = m_prioritizer.GetUpdatePriority(this, update.Entity);
3842
3843 lock (m_entityUpdates.SyncRoot)
3844 m_entityUpdates.Enqueue(priority, update);
3845 }
3846
3847
3848 /// <summary>
3849 /// Requeue a list of EntityUpdates when they were not acknowledged by the client.
3850 /// We will update the priority and put it in the correct queue, merging update flags
3851 /// with any other updates that may be queued for the same entity.
3852 /// The original update time is used for the merged update.
3853 /// </summary>
3854 private void ResendPrimUpdates(List<EntityUpdate> updates, OutgoingPacket oPacket)
3855 {
3856 // m_log.WarnFormat("[CLIENT] resending prim updates {0}, packet sequence number {1}", updates[0].UpdateTime, oPacket.SequenceNumber);
3857
3858 // Remove the update packet from the list of packets waiting for acknowledgement
3859 // because we are requeuing the list of updates. They will be resent in new packets
3860 // with the most recent state and priority.
3861 m_udpClient.NeedAcks.Remove(oPacket.SequenceNumber);
3862
3863 // Count this as a resent packet since we are going to requeue all of the updates contained in it
3864 Interlocked.Increment(ref m_udpClient.PacketsResent);
3865
3866 // We're not going to worry about interlock yet since its not currently critical that this total count
3867 // is 100% correct
3868 m_udpServer.PacketsResentCount++;
3869
3870 foreach (EntityUpdate update in updates)
3871 ResendPrimUpdate(update);
3872 }
3873 */
3874
3875// OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>();
3876// OpenSim.Framework.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>> compressedUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>>();
3877// OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseUpdateBlocks = new OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>();
3878// OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseAgentUpdateBlocks = new OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>();
3879//
3880// OpenSim.Framework.Lazy<List<EntityUpdate>> objectUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>();
3881// OpenSim.Framework.Lazy<List<EntityUpdate>> compressedUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>();
3882// OpenSim.Framework.Lazy<List<EntityUpdate>> terseUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>();
3883// OpenSim.Framework.Lazy<List<EntityUpdate>> terseAgentUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>();
3884
3885
3886 private void ProcessEntityUpdates(int maxUpdates) 3827 private void ProcessEntityUpdates(int maxUpdates)
3887 { 3828 {
3888 OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>(); 3829 OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>();
@@ -3895,15 +3836,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3895 OpenSim.Framework.Lazy<List<EntityUpdate>> terseUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); 3836 OpenSim.Framework.Lazy<List<EntityUpdate>> terseUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>();
3896 OpenSim.Framework.Lazy<List<EntityUpdate>> terseAgentUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); 3837 OpenSim.Framework.Lazy<List<EntityUpdate>> terseAgentUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>();
3897 3838
3898// objectUpdateBlocks.Value.Clear();
3899// compressedUpdateBlocks.Value.Clear();
3900// terseUpdateBlocks.Value.Clear();
3901// terseAgentUpdateBlocks.Value.Clear();
3902// objectUpdates.Value.Clear();
3903// compressedUpdates.Value.Clear();
3904// terseUpdates.Value.Clear();
3905// terseAgentUpdates.Value.Clear();
3906
3907 // Check to see if this is a flush 3839 // Check to see if this is a flush
3908 if (maxUpdates <= 0) 3840 if (maxUpdates <= 0)
3909 { 3841 {
@@ -3970,36 +3902,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3970 if (sp.IsChildAgent) 3902 if (sp.IsChildAgent)
3971 continue; 3903 continue;
3972 3904
3973 // If the object is an attachment we don't want it to be in the kill
3974 // record. Else attaching from inworld and subsequently dropping
3975 // it will no longer work.
3976// lock (m_killRecord)
3977// {
3978// m_killRecord.Remove(part.LocalId);
3979// m_killRecord.Remove(part.ParentGroup.RootPart.LocalId);
3980// }
3981 }
3982 else
3983 {
3984 // Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client
3985 // will never receive an update after a prim kill. Even then, keeping the kill record may be a good
3986 // safety measure.
3987 //
3988 // If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update
3989 // after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs
3990 // updates and kills on different threads with different scheduling strategies, hence this protection.
3991 //
3992 // This doesn't appear to apply to child prims - a client will happily ignore these updates
3993 // after the root prim has been deleted.
3994 //
3995 // We ignore this for attachments because attaching something from inworld breaks unless we do.
3996// lock (m_killRecord)
3997// {
3998// if (m_killRecord.Contains(part.LocalId))
3999// continue;
4000// if (m_killRecord.Contains(part.ParentGroup.RootPart.LocalId))
4001// continue;
4002// }
4003 } 3905 }
4004 3906
4005 if (part.ParentGroup.IsAttachment && m_disableFacelights) 3907 if (part.ParentGroup.IsAttachment && m_disableFacelights)
@@ -4188,16 +4090,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4188 4090
4189 for (int i = 0; i < blocks.Count; i++) 4091 for (int i = 0; i < blocks.Count; i++)
4190 packet.ObjectData[i] = blocks[i]; 4092 packet.ObjectData[i] = blocks[i];
4191 4093
4192// OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseUpdates.Value, oPacket); });
4193 // use default udp retry
4194 OutPacket(packet, ThrottleOutPacketType.Task, true); 4094 OutPacket(packet, ThrottleOutPacketType.Task, true);
4195 } 4095 }
4196 4096
4197
4198
4199 #endregion Packet Sending 4097 #endregion Packet Sending
4200
4201 } 4098 }
4202 4099
4203 // hack.. dont use 4100 // hack.. dont use
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
index 8852715..bb68921 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
@@ -364,9 +364,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
364 int texture = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; 364 int texture = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4;
365 int asset = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); 365 int asset = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f);
366 366
367 int total = resend + land + wind + cloud + task + texture + asset;
368 total /= 128;
369
370 // Make sure none of the throttles are set below our packet MTU, 367 // Make sure none of the throttles are set below our packet MTU,
371 // otherwise a throttle could become permanently clogged 368 // otherwise a throttle could become permanently clogged
372 resend = Math.Max(resend, LLUDPServer.MTU); 369 resend = Math.Max(resend, LLUDPServer.MTU);
@@ -383,8 +380,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
383 task = task + (int)(m_cannibalrate * texture); 380 task = task + (int)(m_cannibalrate * texture);
384 texture = (int)((1 - m_cannibalrate) * texture); 381 texture = (int)((1 - m_cannibalrate) * texture);
385 382
386 total = resend + land + wind + cloud + task + texture + asset; 383 // int total = resend + land + wind + cloud + task + texture + asset;
387 total /= 128; 384
388 //m_log.DebugFormat("[LLUDPCLIENT]: {0} is setting throttles. Resend={1}, Land={2}, Wind={3}, Cloud={4}, Task={5}, Texture={6}, Asset={7}, Total={8}", 385 //m_log.DebugFormat("[LLUDPCLIENT]: {0} is setting throttles. Resend={1}, Land={2}, Wind={3}, Cloud={4}, Task={5}, Texture={6}, Asset={7}, Total={8}",
389 // AgentID, resend, land, wind, cloud, task, texture, asset, total); 386 // AgentID, resend, land, wind, cloud, task, texture, asset, total);
390 387
@@ -428,25 +425,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP
428 int i = 0; 425 int i = 0;
429 426
430 // multiply by 8 to convert bytes back to bits 427 // multiply by 8 to convert bytes back to bits
431 rate = (float)m_throttleCategories[(int)ThrottleOutPacketType.Resend].RequestedDripRate * 8 * multiplier; 428 multiplier *= 8;
429
430 rate = (float)m_throttleCategories[(int)ThrottleOutPacketType.Resend].RequestedDripRate * multiplier;
432 Buffer.BlockCopy(Utils.FloatToBytes(rate), 0, data, i, 4); i += 4; 431 Buffer.BlockCopy(Utils.FloatToBytes(rate), 0, data, i, 4); i += 4;
433 432
434 rate = (float)m_throttleCategories[(int)ThrottleOutPacketType.Land].RequestedDripRate * 8 * multiplier; 433 rate = (float)m_throttleCategories[(int)ThrottleOutPacketType.Land].RequestedDripRate * multiplier;
435 Buffer.BlockCopy(Utils.FloatToBytes(rate), 0, data, i, 4); i += 4; 434 Buffer.BlockCopy(Utils.FloatToBytes(rate), 0, data, i, 4); i += 4;
436 435
437 rate = (float)m_throttleCategories[(int)ThrottleOutPacketType.Wind].RequestedDripRate * 8 * multiplier; 436 rate = (float)m_throttleCategories[(int)ThrottleOutPacketType.Wind].RequestedDripRate * multiplier;
438 Buffer.BlockCopy(Utils.FloatToBytes(rate), 0, data, i, 4); i += 4; 437 Buffer.BlockCopy(Utils.FloatToBytes(rate), 0, data, i, 4); i += 4;
439 438
440 rate = (float)m_throttleCategories[(int)ThrottleOutPacketType.Cloud].RequestedDripRate * 8 * multiplier; 439 rate = (float)m_throttleCategories[(int)ThrottleOutPacketType.Cloud].RequestedDripRate * multiplier;
441 Buffer.BlockCopy(Utils.FloatToBytes(rate), 0, data, i, 4); i += 4; 440 Buffer.BlockCopy(Utils.FloatToBytes(rate), 0, data, i, 4); i += 4;
442 441
443 rate = (float)m_throttleCategories[(int)ThrottleOutPacketType.Task].RequestedDripRate * 8 * multiplier; 442 rate = (float)m_throttleCategories[(int)ThrottleOutPacketType.Task].RequestedDripRate * multiplier;
444 Buffer.BlockCopy(Utils.FloatToBytes(rate), 0, data, i, 4); i += 4; 443 Buffer.BlockCopy(Utils.FloatToBytes(rate), 0, data, i, 4); i += 4;
445 444
446 rate = (float)m_throttleCategories[(int)ThrottleOutPacketType.Texture].RequestedDripRate * 8 * multiplier; 445 rate = (float)m_throttleCategories[(int)ThrottleOutPacketType.Texture].RequestedDripRate * multiplier;
447 Buffer.BlockCopy(Utils.FloatToBytes(rate), 0, data, i, 4); i += 4; 446 Buffer.BlockCopy(Utils.FloatToBytes(rate), 0, data, i, 4); i += 4;
448 447
449 rate = (float)m_throttleCategories[(int)ThrottleOutPacketType.Asset].RequestedDripRate * 8 * multiplier; 448 rate = (float)m_throttleCategories[(int)ThrottleOutPacketType.Asset].RequestedDripRate * multiplier;
450 Buffer.BlockCopy(Utils.FloatToBytes(rate), 0, data, i, 4); i += 4; 449 Buffer.BlockCopy(Utils.FloatToBytes(rate), 0, data, i, 4); i += 4;
451 450
452 m_packedThrottles = data; 451 m_packedThrottles = data;
@@ -485,19 +484,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
485 484
486 TokenBucket bucket = m_throttleCategories[category]; 485 TokenBucket bucket = m_throttleCategories[category];
487 486
488 // Don't send this packet if there is already a packet waiting in the queue 487 // Don't send this packet if queue is not empty
489 // even if we have the tokens to send it, tokens should go to the already
490 // queued packets
491 if (queue.Count > 0 || m_nextPackets[category] != null) 488 if (queue.Count > 0 || m_nextPackets[category] != null)
492 { 489 {
493 queue.Enqueue(packet, highPriority); 490 queue.Enqueue(packet, highPriority);
494 return true; 491 return true;
495 } 492 }
496 493
497
498 if (!forceQueue && bucket.RemoveTokens(packet.Buffer.DataLength)) 494 if (!forceQueue && bucket.RemoveTokens(packet.Buffer.DataLength))
499 { 495 {
500 // Enough tokens were removed from the bucket, the packet will not be queued 496 // enough tokens so it can be sent imediatly by caller
501 return false; 497 return false;
502 } 498 }
503 else 499 else