diff options
author | UbitUmarov | 2014-08-28 10:38:31 +0100 |
---|---|---|
committer | UbitUmarov | 2014-08-28 10:38:31 +0100 |
commit | ade4bf69b173958fb8b8309760cee9b87cfe2927 (patch) | |
tree | f9ed5de349675d90ad5a2261686c178a4e33b05a /OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | |
parent | try to make child presence know its root region. Incomplete, some paths dont... (diff) | |
download | opensim-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/UDP/LLUDPClient.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | 32 |
1 files changed, 14 insertions, 18 deletions
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 |