diff options
author | Melanie | 2013-01-19 21:49:33 +0100 |
---|---|---|
committer | Melanie | 2013-01-19 21:49:33 +0100 |
commit | 2d3a57a002c74704501f4ce0f0359f2a19699eb5 (patch) | |
tree | cc74ca02d7b8f8c9e63e4007c354f3296fe87392 /OpenSim/Region/ClientStack | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Remove group IM test code also mentioning "OpenSimulator Testing" (diff) | |
download | opensim-SC-2d3a57a002c74704501f4ce0f0359f2a19699eb5.zip opensim-SC-2d3a57a002c74704501f4ce0f0359f2a19699eb5.tar.gz opensim-SC-2d3a57a002c74704501f4ce0f0359f2a19699eb5.tar.bz2 opensim-SC-2d3a57a002c74704501f4ce0f0359f2a19699eb5.tar.xz |
Merge branch 'avination'
Conflicts:
OpenSim/Framework/ThrottleOutPacketType.cs
OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs
Diffstat (limited to '')
4 files changed, 66 insertions, 43 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs index 908f628..6ec1115 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs | |||
@@ -501,7 +501,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
501 | ScenePresence p; | 501 | ScenePresence p; |
502 | if (m_scene.TryGetScenePresence(User, out p)) // If we don't get a user they're not here anymore. | 502 | if (m_scene.TryGetScenePresence(User, out p)) // If we don't get a user they're not here anymore. |
503 | { | 503 | { |
504 | AlterThrottle(UserSetThrottle, p); | 504 | // AlterThrottle(UserSetThrottle, p); |
505 | UpdateThrottle(UserSetThrottle, p); | ||
505 | } | 506 | } |
506 | } | 507 | } |
507 | } | 508 | } |
@@ -546,7 +547,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
546 | // Client set throttle ! | 547 | // Client set throttle ! |
547 | UserSetThrottle = pimagethrottle; | 548 | UserSetThrottle = pimagethrottle; |
548 | CapSetThrottle = (int)(pimagethrottle*CapThrottleDistributon); | 549 | CapSetThrottle = (int)(pimagethrottle*CapThrottleDistributon); |
549 | UDPSetThrottle = (int) (pimagethrottle*(100 - CapThrottleDistributon)); | 550 | // UDPSetThrottle = (int) (pimagethrottle*(100 - CapThrottleDistributon)); |
551 | |||
552 | float udp = 1.0f - CapThrottleDistributon; | ||
553 | if(udp < 0.5f) | ||
554 | udp = 0.5f; | ||
555 | UDPSetThrottle = (int) ((float)pimagethrottle * udp); | ||
550 | if (CapSetThrottle < 4068) | 556 | if (CapSetThrottle < 4068) |
551 | CapSetThrottle = 4068; // at least two discovery mesh | 557 | CapSetThrottle = 4068; // at least two discovery mesh |
552 | p.ControllingClient.SetAgentThrottleSilent((int) Throttle, UDPSetThrottle); | 558 | p.ControllingClient.SetAgentThrottleSilent((int) Throttle, UDPSetThrottle); |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 12e9d4d..bae41fb 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -897,32 +897,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
897 | msg.MessageBlock.Message = Util.StringToBytes1024(im.message); | 897 | msg.MessageBlock.Message = Util.StringToBytes1024(im.message); |
898 | msg.MessageBlock.BinaryBucket = im.binaryBucket; | 898 | msg.MessageBlock.BinaryBucket = im.binaryBucket; |
899 | 899 | ||
900 | if (im.message.StartsWith("[grouptest]")) | 900 | OutPacket(msg, ThrottleOutPacketType.Task); |
901 | { // this block is test code for implementing group IM - delete when group IM is finished | ||
902 | IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>(); | ||
903 | if (eq != null) | ||
904 | { | ||
905 | im.dialog = 17; | ||
906 | |||
907 | //eq.ChatterboxInvitation( | ||
908 | // new UUID("00000000-68f9-1111-024e-222222111123"), | ||
909 | // "OpenSimulator Testing", im.fromAgentID, im.message, im.toAgentID, im.fromAgentName, im.dialog, 0, | ||
910 | // false, 0, new Vector3(), 1, im.imSessionID, im.fromGroup, im.binaryBucket); | ||
911 | |||
912 | eq.ChatterboxInvitation( | ||
913 | new UUID("00000000-68f9-1111-024e-222222111123"), | ||
914 | "OpenSimulator Testing", new UUID(im.fromAgentID), im.message, new UUID(im.toAgentID), im.fromAgentName, im.dialog, 0, | ||
915 | false, 0, new Vector3(), 1, new UUID(im.imSessionID), im.fromGroup, Util.StringToBytes256("OpenSimulator Testing")); | ||
916 | |||
917 | eq.ChatterBoxSessionAgentListUpdates( | ||
918 | new UUID("00000000-68f9-1111-024e-222222111123"), | ||
919 | new UUID(im.fromAgentID), new UUID(im.toAgentID), false, false, false); | ||
920 | } | ||
921 | |||
922 | Console.WriteLine("SendInstantMessage: " + msg); | ||
923 | } | ||
924 | else | ||
925 | OutPacket(msg, ThrottleOutPacketType.Task); | ||
926 | } | 901 | } |
927 | } | 902 | } |
928 | 903 | ||
@@ -2788,7 +2763,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2788 | Transfer.TransferInfo.Size = req.AssetInf.Data.Length; | 2763 | Transfer.TransferInfo.Size = req.AssetInf.Data.Length; |
2789 | Transfer.TransferInfo.TransferID = req.TransferRequestID; | 2764 | Transfer.TransferInfo.TransferID = req.TransferRequestID; |
2790 | Transfer.Header.Zerocoded = true; | 2765 | Transfer.Header.Zerocoded = true; |
2791 | OutPacket(Transfer, isWearable ? ThrottleOutPacketType.Task : ThrottleOutPacketType.Asset); | 2766 | OutPacket(Transfer, isWearable ? ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority : ThrottleOutPacketType.Asset); |
2792 | 2767 | ||
2793 | if (req.NumPackets == 1) | 2768 | if (req.NumPackets == 1) |
2794 | { | 2769 | { |
@@ -2799,7 +2774,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2799 | TransferPacket.TransferData.Data = req.AssetInf.Data; | 2774 | TransferPacket.TransferData.Data = req.AssetInf.Data; |
2800 | TransferPacket.TransferData.Status = 1; | 2775 | TransferPacket.TransferData.Status = 1; |
2801 | TransferPacket.Header.Zerocoded = true; | 2776 | TransferPacket.Header.Zerocoded = true; |
2802 | OutPacket(TransferPacket, isWearable ? ThrottleOutPacketType.Task : ThrottleOutPacketType.Asset); | 2777 | OutPacket(TransferPacket, isWearable ? ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority : ThrottleOutPacketType.Asset); |
2803 | } | 2778 | } |
2804 | else | 2779 | else |
2805 | { | 2780 | { |
@@ -2832,7 +2807,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2832 | TransferPacket.TransferData.Status = 1; | 2807 | TransferPacket.TransferData.Status = 1; |
2833 | } | 2808 | } |
2834 | TransferPacket.Header.Zerocoded = true; | 2809 | TransferPacket.Header.Zerocoded = true; |
2835 | OutPacket(TransferPacket, isWearable ? ThrottleOutPacketType.Task : ThrottleOutPacketType.Asset); | 2810 | OutPacket(TransferPacket, isWearable ? ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority : ThrottleOutPacketType.Asset); |
2836 | 2811 | ||
2837 | processedLength += chunkSize; | 2812 | processedLength += chunkSize; |
2838 | packetNumber++; | 2813 | packetNumber++; |
@@ -3605,7 +3580,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3605 | } | 3580 | } |
3606 | } | 3581 | } |
3607 | 3582 | ||
3608 | OutPacket(aw, ThrottleOutPacketType.Task); | 3583 | OutPacket(aw, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority); |
3609 | } | 3584 | } |
3610 | 3585 | ||
3611 | public void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry) | 3586 | public void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry) |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index f1a1812..e52ac37 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | |||
@@ -92,7 +92,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
92 | /// <summary>Packets we have sent that need to be ACKed by the client</summary> | 92 | /// <summary>Packets we have sent that need to be ACKed by the client</summary> |
93 | public readonly UnackedPacketCollection NeedAcks = new UnackedPacketCollection(); | 93 | public readonly UnackedPacketCollection NeedAcks = new UnackedPacketCollection(); |
94 | /// <summary>ACKs that are queued up, waiting to be sent to the client</summary> | 94 | /// <summary>ACKs that are queued up, waiting to be sent to the client</summary> |
95 | public readonly OpenSim.Framework.LocklessQueue<uint> PendingAcks = new OpenSim.Framework.LocklessQueue<uint>(); | 95 | public readonly DoubleLocklessQueue<uint> PendingAcks = new DoubleLocklessQueue<uint>(); |
96 | 96 | ||
97 | /// <summary>Current packet sequence number</summary> | 97 | /// <summary>Current packet sequence number</summary> |
98 | public int CurrentSequence; | 98 | public int CurrentSequence; |
@@ -146,7 +146,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
146 | /// <summary>Throttle buckets for each packet category</summary> | 146 | /// <summary>Throttle buckets for each packet category</summary> |
147 | private readonly TokenBucket[] m_throttleCategories; | 147 | private readonly TokenBucket[] m_throttleCategories; |
148 | /// <summary>Outgoing queues for throttled packets</summary> | 148 | /// <summary>Outgoing queues for throttled packets</summary> |
149 | private readonly OpenSim.Framework.LocklessQueue<OutgoingPacket>[] m_packetOutboxes = new OpenSim.Framework.LocklessQueue<OutgoingPacket>[THROTTLE_CATEGORY_COUNT]; | 149 | private readonly DoubleLocklessQueue<OutgoingPacket>[] m_packetOutboxes = new DoubleLocklessQueue<OutgoingPacket>[THROTTLE_CATEGORY_COUNT]; |
150 | /// <summary>A container that can hold one packet for each outbox, used to store | 150 | /// <summary>A container that can hold one packet for each outbox, used to store |
151 | /// dequeued packets that are being held for throttling</summary> | 151 | /// dequeued packets that are being held for throttling</summary> |
152 | private readonly OutgoingPacket[] m_nextPackets = new OutgoingPacket[THROTTLE_CATEGORY_COUNT]; | 152 | private readonly OutgoingPacket[] m_nextPackets = new OutgoingPacket[THROTTLE_CATEGORY_COUNT]; |
@@ -202,7 +202,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
202 | ThrottleOutPacketType type = (ThrottleOutPacketType)i; | 202 | ThrottleOutPacketType type = (ThrottleOutPacketType)i; |
203 | 203 | ||
204 | // Initialize the packet outboxes, where packets sit while they are waiting for tokens | 204 | // Initialize the packet outboxes, where packets sit while they are waiting for tokens |
205 | m_packetOutboxes[i] = new OpenSim.Framework.LocklessQueue<OutgoingPacket>(); | 205 | m_packetOutboxes[i] = new DoubleLocklessQueue<OutgoingPacket>(); |
206 | // Initialize the token buckets that control the throttling for each category | 206 | // Initialize the token buckets that control the throttling for each category |
207 | m_throttleCategories[i] = new TokenBucket(m_throttleCategory, rates.GetRate(type)); | 207 | m_throttleCategories[i] = new TokenBucket(m_throttleCategory, rates.GetRate(type)); |
208 | } | 208 | } |
@@ -430,15 +430,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
430 | /// </returns> | 430 | /// </returns> |
431 | public bool EnqueueOutgoing(OutgoingPacket packet, bool forceQueue) | 431 | public bool EnqueueOutgoing(OutgoingPacket packet, bool forceQueue) |
432 | { | 432 | { |
433 | return EnqueueOutgoing(packet, forceQueue, false); | ||
434 | } | ||
435 | |||
436 | public bool EnqueueOutgoing(OutgoingPacket packet, bool forceQueue, bool highPriority) | ||
437 | { | ||
433 | int category = (int)packet.Category; | 438 | int category = (int)packet.Category; |
434 | 439 | ||
435 | if (category >= 0 && category < m_packetOutboxes.Length) | 440 | if (category >= 0 && category < m_packetOutboxes.Length) |
436 | { | 441 | { |
437 | OpenSim.Framework.LocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category]; | 442 | DoubleLocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category]; |
438 | 443 | ||
439 | if (m_deliverPackets == false) | 444 | if (m_deliverPackets == false) |
440 | { | 445 | { |
441 | queue.Enqueue(packet); | 446 | queue.Enqueue(packet, highPriority); |
442 | return true; | 447 | return true; |
443 | } | 448 | } |
444 | 449 | ||
@@ -449,7 +454,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
449 | // queued packets | 454 | // queued packets |
450 | if (queue.Count > 0) | 455 | if (queue.Count > 0) |
451 | { | 456 | { |
452 | queue.Enqueue(packet); | 457 | queue.Enqueue(packet, highPriority); |
453 | return true; | 458 | return true; |
454 | } | 459 | } |
455 | 460 | ||
@@ -462,7 +467,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
462 | else | 467 | else |
463 | { | 468 | { |
464 | // Force queue specified or not enough tokens in the bucket, queue this packet | 469 | // Force queue specified or not enough tokens in the bucket, queue this packet |
465 | queue.Enqueue(packet); | 470 | queue.Enqueue(packet, highPriority); |
466 | return true; | 471 | return true; |
467 | } | 472 | } |
468 | } | 473 | } |
@@ -494,7 +499,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
494 | if (m_deliverPackets == false) return false; | 499 | if (m_deliverPackets == false) return false; |
495 | 500 | ||
496 | OutgoingPacket packet = null; | 501 | OutgoingPacket packet = null; |
497 | OpenSim.Framework.LocklessQueue<OutgoingPacket> queue; | 502 | DoubleLocklessQueue<OutgoingPacket> queue; |
498 | TokenBucket bucket; | 503 | TokenBucket bucket; |
499 | bool packetSent = false; | 504 | bool packetSent = false; |
500 | ThrottleOutPacketTypeFlags emptyCategories = 0; | 505 | ThrottleOutPacketTypeFlags emptyCategories = 0; |
@@ -534,7 +539,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
534 | } | 539 | } |
535 | catch | 540 | catch |
536 | { | 541 | { |
537 | m_packetOutboxes[i] = new OpenSim.Framework.LocklessQueue<OutgoingPacket>(); | 542 | m_packetOutboxes[i] = new DoubleLocklessQueue<OutgoingPacket>(); |
538 | } | 543 | } |
539 | if (success) | 544 | if (success) |
540 | { | 545 | { |
@@ -567,7 +572,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
567 | } | 572 | } |
568 | else | 573 | else |
569 | { | 574 | { |
570 | m_packetOutboxes[i] = new OpenSim.Framework.LocklessQueue<OutgoingPacket>(); | 575 | m_packetOutboxes[i] = new DoubleLocklessQueue<OutgoingPacket>(); |
571 | emptyCategories |= CategoryToFlag(i); | 576 | emptyCategories |= CategoryToFlag(i); |
572 | } | 577 | } |
573 | } | 578 | } |
@@ -724,4 +729,33 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
724 | } | 729 | } |
725 | } | 730 | } |
726 | } | 731 | } |
732 | |||
733 | public class DoubleLocklessQueue<T> : OpenSim.Framework.LocklessQueue<T> | ||
734 | { | ||
735 | OpenSim.Framework.LocklessQueue<T> highQueue = new OpenSim.Framework.LocklessQueue<T>(); | ||
736 | |||
737 | public override int Count | ||
738 | { | ||
739 | get | ||
740 | { | ||
741 | return base.Count + highQueue.Count; | ||
742 | } | ||
743 | } | ||
744 | |||
745 | public override bool Dequeue(out T item) | ||
746 | { | ||
747 | if (highQueue.Dequeue(out item)) | ||
748 | return true; | ||
749 | |||
750 | return base.Dequeue(out item); | ||
751 | } | ||
752 | |||
753 | public void Enqueue(T item, bool highPriority) | ||
754 | { | ||
755 | if (highPriority) | ||
756 | highQueue.Enqueue(item); | ||
757 | else | ||
758 | Enqueue(item); | ||
759 | } | ||
760 | } | ||
727 | } | 761 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 9a4abd4..6c72edc 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -803,6 +803,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
803 | 803 | ||
804 | #region Queue or Send | 804 | #region Queue or Send |
805 | 805 | ||
806 | bool highPriority = false; | ||
807 | |||
808 | if (category != ThrottleOutPacketType.Unknown && (category & ThrottleOutPacketType.HighPriority) != 0) | ||
809 | { | ||
810 | category = (ThrottleOutPacketType)((int)category & 127); | ||
811 | highPriority = true; | ||
812 | } | ||
813 | |||
806 | OutgoingPacket outgoingPacket = new OutgoingPacket(udpClient, buffer, category, null); | 814 | OutgoingPacket outgoingPacket = new OutgoingPacket(udpClient, buffer, category, null); |
807 | // If we were not provided a method for handling unacked, use the UDPServer default method | 815 | // If we were not provided a method for handling unacked, use the UDPServer default method |
808 | outgoingPacket.UnackedMethod = ((method == null) ? delegate(OutgoingPacket oPacket) { ResendUnacked(oPacket); } : method); | 816 | outgoingPacket.UnackedMethod = ((method == null) ? delegate(OutgoingPacket oPacket) { ResendUnacked(oPacket); } : method); |
@@ -811,7 +819,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
811 | // continue to display the deleted object until relog. Therefore, we need to always queue a kill object | 819 | // continue to display the deleted object until relog. Therefore, we need to always queue a kill object |
812 | // packet so that it isn't sent before a queued update packet. | 820 | // packet so that it isn't sent before a queued update packet. |
813 | bool requestQueue = type == PacketType.KillObject; | 821 | bool requestQueue = type == PacketType.KillObject; |
814 | if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, requestQueue)) | 822 | if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, requestQueue, highPriority)) |
815 | SendPacketFinal(outgoingPacket); | 823 | SendPacketFinal(outgoingPacket); |
816 | 824 | ||
817 | #endregion Queue or Send | 825 | #endregion Queue or Send |