diff options
author | Mike Mazur | 2009-02-25 00:32:26 +0000 |
---|---|---|
committer | Mike Mazur | 2009-02-25 00:32:26 +0000 |
commit | bdf95e54a2da5b60e7817d748f7389289a59bc5e (patch) | |
tree | e688db1880284466aef41abb545dc9ed50ea66cc /OpenSim/Region/ClientStack | |
parent | Setting svn:eol-style=native on new files. (diff) | |
download | opensim-SC-bdf95e54a2da5b60e7817d748f7389289a59bc5e.zip opensim-SC-bdf95e54a2da5b60e7817d748f7389289a59bc5e.tar.gz opensim-SC-bdf95e54a2da5b60e7817d748f7389289a59bc5e.tar.bz2 opensim-SC-bdf95e54a2da5b60e7817d748f7389289a59bc5e.tar.xz |
A few updates necessary for load balancer.
- handle GetUser request for nonexistent user gracefully
- include throttle levels in ClientInfo
- code to save/restore throttles in client stack
- only update/send updates to active clients
- make animation classes serializable
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs | 59 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs | 25 |
3 files changed, 55 insertions, 31 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index e643a0e..825e87a 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -2584,6 +2584,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2584 | 2584 | ||
2585 | public void SendCoarseLocationUpdate(List<Vector3> CoarseLocations) | 2585 | public void SendCoarseLocationUpdate(List<Vector3> CoarseLocations) |
2586 | { | 2586 | { |
2587 | if (!IsActive) return; // We don't need to update inactive clients. | ||
2588 | |||
2587 | CoarseLocationUpdatePacket loc = (CoarseLocationUpdatePacket)PacketPool.Instance.GetPacket(PacketType.CoarseLocationUpdate); | 2589 | CoarseLocationUpdatePacket loc = (CoarseLocationUpdatePacket)PacketPool.Instance.GetPacket(PacketType.CoarseLocationUpdate); |
2588 | // TODO: don't create new blocks if recycling an old packet | 2590 | // TODO: don't create new blocks if recycling an old packet |
2589 | int total = CoarseLocations.Count; | 2591 | int total = CoarseLocations.Count; |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs index 23118a2..4270222 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs | |||
@@ -196,13 +196,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
196 | // configuration! | 196 | // configuration! |
197 | // | 197 | // |
198 | 198 | ||
199 | if ((m_SynchronizeClient != null) && (!m_Client.IsActive)) | ||
200 | { | ||
201 | if (m_SynchronizeClient(m_Client.Scene, packet, | ||
202 | m_Client.AgentId, throttlePacketType)) | ||
203 | return; | ||
204 | } | ||
205 | |||
206 | packet.Header.Sequence = 0; | 199 | packet.Header.Sequence = 0; |
207 | 200 | ||
208 | lock (m_NeedAck) | 201 | lock (m_NeedAck) |
@@ -480,11 +473,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
480 | if (packet == null) | 473 | if (packet == null) |
481 | return; | 474 | return; |
482 | 475 | ||
483 | // If this client is on another partial instance, no need | 476 | // When too many acks are needed to be sent, the client sends |
484 | // to handle packets | 477 | // a packet consisting of acks only |
485 | // | 478 | // |
486 | if (!m_Client.IsActive && packet.Type != PacketType.LogoutRequest) | 479 | if (packet.Type == PacketType.PacketAck) |
487 | { | 480 | { |
481 | PacketAckPacket ackPacket = (PacketAckPacket)packet; | ||
482 | |||
483 | foreach (PacketAckPacket.PacketsBlock block in | ||
484 | ackPacket.Packets) | ||
485 | { | ||
486 | ProcessAck(block.ID); | ||
487 | } | ||
488 | |||
488 | PacketPool.Instance.ReturnPacket(packet); | 489 | PacketPool.Instance.ReturnPacket(packet); |
489 | return; | 490 | return; |
490 | } | 491 | } |
@@ -500,26 +501,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
500 | } | 501 | } |
501 | } | 502 | } |
502 | 503 | ||
503 | // When too many acks are needed to be sent, the client sends | 504 | // If this client is on another partial instance, no need |
504 | // a packet consisting of acks only | 505 | // to handle packets |
505 | // | 506 | // |
506 | if (packet.Type == PacketType.PacketAck) | 507 | if (!m_Client.IsActive && packet.Type != PacketType.LogoutRequest) |
507 | { | 508 | { |
508 | PacketAckPacket ackPacket = (PacketAckPacket)packet; | ||
509 | |||
510 | foreach (PacketAckPacket.PacketsBlock block in | ||
511 | ackPacket.Packets) | ||
512 | { | ||
513 | ProcessAck(block.ID); | ||
514 | } | ||
515 | |||
516 | PacketPool.Instance.ReturnPacket(packet); | 509 | PacketPool.Instance.ReturnPacket(packet); |
517 | return; | 510 | return; |
518 | } | 511 | } |
519 | else if (packet.Type == PacketType.StartPingCheck) | 512 | |
513 | if (packet.Type == PacketType.StartPingCheck) | ||
520 | { | 514 | { |
521 | StartPingCheckPacket startPing = (StartPingCheckPacket)packet; | 515 | StartPingCheckPacket startPing = (StartPingCheckPacket)packet; |
522 | CompletePingCheckPacket endPing | 516 | CompletePingCheckPacket endPing |
523 | = (CompletePingCheckPacket)PacketPool.Instance.GetPacket(PacketType.CompletePingCheck); | 517 | = (CompletePingCheckPacket)PacketPool.Instance.GetPacket(PacketType.CompletePingCheck); |
524 | 518 | ||
525 | endPing.PingID.PingID = startPing.PingID.PingID; | 519 | endPing.PingID.PingID = startPing.PingID.PingID; |
@@ -639,6 +633,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
639 | 633 | ||
640 | info.sequence = m_Sequence; | 634 | info.sequence = m_Sequence; |
641 | 635 | ||
636 | float multiplier = m_PacketQueue.ThrottleMultiplier; | ||
637 | info.resendThrottle = (int) (m_PacketQueue.ResendThrottle.Throttle / multiplier); | ||
638 | info.landThrottle = (int) (m_PacketQueue.LandThrottle.Throttle / multiplier); | ||
639 | info.windThrottle = (int) (m_PacketQueue.WindThrottle.Throttle / multiplier); | ||
640 | info.cloudThrottle = (int) (m_PacketQueue.CloudThrottle.Throttle / multiplier); | ||
641 | info.taskThrottle = (int) (m_PacketQueue.TaskThrottle.Throttle / multiplier); | ||
642 | info.assetThrottle = (int) (m_PacketQueue.AssetThrottle.Throttle / multiplier); | ||
643 | info.textureThrottle = (int) (m_PacketQueue.TextureThrottle.Throttle / multiplier); | ||
644 | info.totalThrottle = (int) (m_PacketQueue.TotalThrottle.Throttle / multiplier); | ||
645 | |||
642 | return info; | 646 | return info; |
643 | } | 647 | } |
644 | 648 | ||
@@ -676,6 +680,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
676 | } | 680 | } |
677 | 681 | ||
678 | m_Sequence = info.sequence; | 682 | m_Sequence = info.sequence; |
683 | |||
684 | m_PacketQueue.ResendThrottle.Throttle = info.resendThrottle; | ||
685 | m_PacketQueue.LandThrottle.Throttle = info.landThrottle; | ||
686 | m_PacketQueue.WindThrottle.Throttle = info.windThrottle; | ||
687 | m_PacketQueue.CloudThrottle.Throttle = info.cloudThrottle; | ||
688 | m_PacketQueue.TaskThrottle.Throttle = info.taskThrottle; | ||
689 | m_PacketQueue.AssetThrottle.Throttle = info.assetThrottle; | ||
690 | m_PacketQueue.TextureThrottle.Throttle = info.textureThrottle; | ||
691 | m_PacketQueue.TotalThrottle.Throttle = info.totalThrottle; | ||
679 | } | 692 | } |
680 | 693 | ||
681 | public void AddImportantPacket(PacketType type) | 694 | public void AddImportantPacket(PacketType type) |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs index 1c398d9..6bfa864 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs | |||
@@ -69,18 +69,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
69 | // This value also determines how many times per throttletimems the timer will run | 69 | // This value also determines how many times per throttletimems the timer will run |
70 | // If throttleimems is 1000 ms, then the timer will fire every 1000/7 milliseconds | 70 | // If throttleimems is 1000 ms, then the timer will fire every 1000/7 milliseconds |
71 | 71 | ||
72 | private float throttleMultiplier = 2.0f; // Default value really doesn't matter. | ||
72 | private int throttleTimeDivisor = 7; | 73 | private int throttleTimeDivisor = 7; |
73 | 74 | ||
74 | private int throttletimems = 1000; | 75 | private int throttletimems = 1000; |
75 | 76 | ||
76 | private LLPacketThrottle ResendThrottle; | 77 | internal LLPacketThrottle ResendThrottle; |
77 | private LLPacketThrottle LandThrottle; | 78 | internal LLPacketThrottle LandThrottle; |
78 | private LLPacketThrottle WindThrottle; | 79 | internal LLPacketThrottle WindThrottle; |
79 | private LLPacketThrottle CloudThrottle; | 80 | internal LLPacketThrottle CloudThrottle; |
80 | private LLPacketThrottle TaskThrottle; | 81 | internal LLPacketThrottle TaskThrottle; |
81 | private LLPacketThrottle AssetThrottle; | 82 | internal LLPacketThrottle AssetThrottle; |
82 | private LLPacketThrottle TextureThrottle; | 83 | internal LLPacketThrottle TextureThrottle; |
83 | private LLPacketThrottle TotalThrottle; | 84 | internal LLPacketThrottle TotalThrottle; |
84 | 85 | ||
85 | // private long LastThrottle; | 86 | // private long LastThrottle; |
86 | // private long ThrottleInterval; | 87 | // private long ThrottleInterval; |
@@ -108,6 +109,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
108 | TextureOutgoingPacketQueue = new Queue<LLQueItem>(); | 109 | TextureOutgoingPacketQueue = new Queue<LLQueItem>(); |
109 | AssetOutgoingPacketQueue = new Queue<LLQueItem>(); | 110 | AssetOutgoingPacketQueue = new Queue<LLQueItem>(); |
110 | 111 | ||
112 | // Store the throttle multiplier for posterity. | ||
113 | throttleMultiplier = userSettings.ClientThrottleMultipler; | ||
114 | |||
111 | // Set up the throttle classes (min, max, current) in bits per second | 115 | // Set up the throttle classes (min, max, current) in bits per second |
112 | ResendThrottle = new LLPacketThrottle(5000, 100000, 16000, userSettings.ClientThrottleMultipler); | 116 | ResendThrottle = new LLPacketThrottle(5000, 100000, 16000, userSettings.ClientThrottleMultipler); |
113 | LandThrottle = new LLPacketThrottle(1000, 100000, 2000, userSettings.ClientThrottleMultipler); | 117 | LandThrottle = new LLPacketThrottle(1000, 100000, 2000, userSettings.ClientThrottleMultipler); |
@@ -624,5 +628,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
624 | { | 628 | { |
625 | return SendQueue.GetQueueArray(); | 629 | return SendQueue.GetQueueArray(); |
626 | } | 630 | } |
631 | |||
632 | public float ThrottleMultiplier | ||
633 | { | ||
634 | get { return throttleMultiplier; } | ||
635 | } | ||
627 | } | 636 | } |
628 | } | 637 | } |