diff options
author | John Hurliman | 2009-10-18 02:00:42 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-18 02:00:42 -0700 |
commit | b4526a5a6d170e04655990c8edb8e355156a2061 (patch) | |
tree | 457cc8535e9213f6003545a0363f325b9ef9e90b /OpenSim/Region/ClientStack/LindenUDP | |
parent | * Committing Nini.dll with the patch from #3773 applied (diff) | |
download | opensim-SC-b4526a5a6d170e04655990c8edb8e355156a2061.zip opensim-SC-b4526a5a6d170e04655990c8edb8e355156a2061.tar.gz opensim-SC-b4526a5a6d170e04655990c8edb8e355156a2061.tar.bz2 opensim-SC-b4526a5a6d170e04655990c8edb8e355156a2061.tar.xz |
* Big performance increase in loading prims from the region database with MySQL
* Handle the AgentFOV packet
* Bypass queuing and throttles for ping checks to make ping times more closely match network latency
* Only track reliable bytes in LLUDPCLient.BytesSinceLastACK
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 24 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 51 |
2 files changed, 50 insertions, 25 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 2773a5e..b93e905 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -295,6 +295,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
295 | public event MuteListRequest OnMuteListRequest; | 295 | public event MuteListRequest OnMuteListRequest; |
296 | public event AvatarInterestUpdate OnAvatarInterestUpdate; | 296 | public event AvatarInterestUpdate OnAvatarInterestUpdate; |
297 | public event PlacesQuery OnPlacesQuery; | 297 | public event PlacesQuery OnPlacesQuery; |
298 | public event AgentFOV OnAgentFOV; | ||
298 | 299 | ||
299 | #endregion Events | 300 | #endregion Events |
300 | 301 | ||
@@ -346,6 +347,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
346 | protected ulong m_activeGroupPowers; | 347 | protected ulong m_activeGroupPowers; |
347 | protected Dictionary<UUID,ulong> m_groupPowers = new Dictionary<UUID, ulong>(); | 348 | protected Dictionary<UUID,ulong> m_groupPowers = new Dictionary<UUID, ulong>(); |
348 | protected int m_terrainCheckerCount; | 349 | protected int m_terrainCheckerCount; |
350 | protected uint m_agentFOVCounter; | ||
349 | 351 | ||
350 | // These numbers are guesses at a decent tradeoff between responsiveness | 352 | // These numbers are guesses at a decent tradeoff between responsiveness |
351 | // of the interest list and throughput. Lower is more responsive, higher | 353 | // of the interest list and throughput. Lower is more responsive, higher |
@@ -8871,19 +8873,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8871 | 8873 | ||
8872 | #endregion | 8874 | #endregion |
8873 | 8875 | ||
8876 | case PacketType.AgentFOV: | ||
8877 | AgentFOVPacket fovPacket = (AgentFOVPacket)Pack; | ||
8874 | 8878 | ||
8875 | #region unimplemented handlers | 8879 | if (fovPacket.FOVBlock.GenCounter > m_agentFOVCounter) |
8876 | 8880 | { | |
8877 | case PacketType.StartPingCheck: | 8881 | m_agentFOVCounter = fovPacket.FOVBlock.GenCounter; |
8878 | StartPingCheckPacket pingStart = (StartPingCheckPacket)Pack; | 8882 | AgentFOV handlerAgentFOV = OnAgentFOV; |
8879 | CompletePingCheckPacket pingComplete = new CompletePingCheckPacket(); | 8883 | if (handlerAgentFOV != null) |
8880 | pingComplete.PingID.PingID = pingStart.PingID.PingID; | 8884 | { |
8881 | m_udpServer.SendPacket(m_udpClient, pingComplete, ThrottleOutPacketType.Unknown, false); | 8885 | handlerAgentFOV(this, fovPacket.FOVBlock.VerticalAngle); |
8886 | } | ||
8887 | } | ||
8882 | break; | 8888 | break; |
8883 | 8889 | ||
8884 | case PacketType.CompletePingCheck: | 8890 | #region unimplemented handlers |
8885 | // TODO: Do stats tracking or something with these? | ||
8886 | break; | ||
8887 | 8891 | ||
8888 | case PacketType.ViewerStats: | 8892 | case PacketType.ViewerStats: |
8889 | // TODO: handle this packet | 8893 | // TODO: handle this packet |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 7a403aa..4f3478b 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -572,6 +572,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
572 | for (int i = 0; i < ackPacket.Packets.Length; i++) | 572 | for (int i = 0; i < ackPacket.Packets.Length; i++) |
573 | AcknowledgePacket(udpClient, ackPacket.Packets[i].ID, now, packet.Header.Resent); | 573 | AcknowledgePacket(udpClient, ackPacket.Packets[i].ID, now, packet.Header.Resent); |
574 | } | 574 | } |
575 | |||
576 | // We don't need to do anything else with PacketAck packets | ||
577 | return; | ||
575 | } | 578 | } |
576 | 579 | ||
577 | #endregion ACK Receiving | 580 | #endregion ACK Receiving |
@@ -579,20 +582,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
579 | #region ACK Sending | 582 | #region ACK Sending |
580 | 583 | ||
581 | if (packet.Header.Reliable) | 584 | if (packet.Header.Reliable) |
585 | { | ||
582 | udpClient.PendingAcks.Enqueue(packet.Header.Sequence); | 586 | udpClient.PendingAcks.Enqueue(packet.Header.Sequence); |
583 | 587 | ||
584 | // This is a somewhat odd sequence of steps to pull the client.BytesSinceLastACK value out, | 588 | // This is a somewhat odd sequence of steps to pull the client.BytesSinceLastACK value out, |
585 | // add the current received bytes to it, test if 2*MTU bytes have been sent, if so remove | 589 | // add the current received bytes to it, test if 2*MTU bytes have been sent, if so remove |
586 | // 2*MTU bytes from the value and send ACKs, and finally add the local value back to | 590 | // 2*MTU bytes from the value and send ACKs, and finally add the local value back to |
587 | // client.BytesSinceLastACK. Lockless thread safety | 591 | // client.BytesSinceLastACK. Lockless thread safety |
588 | int bytesSinceLastACK = Interlocked.Exchange(ref udpClient.BytesSinceLastACK, 0); | 592 | int bytesSinceLastACK = Interlocked.Exchange(ref udpClient.BytesSinceLastACK, 0); |
589 | bytesSinceLastACK += buffer.DataLength; | 593 | bytesSinceLastACK += buffer.DataLength; |
590 | if (bytesSinceLastACK > LLUDPServer.MTU * 2) | 594 | if (bytesSinceLastACK > LLUDPServer.MTU * 2) |
591 | { | 595 | { |
592 | bytesSinceLastACK -= LLUDPServer.MTU * 2; | 596 | bytesSinceLastACK -= LLUDPServer.MTU * 2; |
593 | SendAcks(udpClient); | 597 | SendAcks(udpClient); |
598 | } | ||
599 | Interlocked.Add(ref udpClient.BytesSinceLastACK, bytesSinceLastACK); | ||
594 | } | 600 | } |
595 | Interlocked.Add(ref udpClient.BytesSinceLastACK, bytesSinceLastACK); | ||
596 | 601 | ||
597 | #endregion ACK Sending | 602 | #endregion ACK Sending |
598 | 603 | ||
@@ -612,12 +617,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
612 | 617 | ||
613 | #endregion Incoming Packet Accounting | 618 | #endregion Incoming Packet Accounting |
614 | 619 | ||
615 | // Don't bother clogging up the queue with PacketAck packets that are already handled here | 620 | #region Ping Check Handling |
616 | if (packet.Type != PacketType.PacketAck) | 621 | |
622 | if (packet.Type == PacketType.StartPingCheck) | ||
617 | { | 623 | { |
618 | // Inbox insertion | 624 | // We don't need to do anything else with ping checks |
619 | packetInbox.Enqueue(new IncomingPacket(udpClient, packet)); | 625 | StartPingCheckPacket startPing = (StartPingCheckPacket)packet; |
626 | |||
627 | CompletePingCheckPacket completePing = new CompletePingCheckPacket(); | ||
628 | completePing.PingID.PingID = startPing.PingID.PingID; | ||
629 | SendPacket(udpClient, completePing, ThrottleOutPacketType.Unknown, false); | ||
630 | return; | ||
620 | } | 631 | } |
632 | else if (packet.Type == PacketType.CompletePingCheck) | ||
633 | { | ||
634 | // We don't currently track client ping times | ||
635 | return; | ||
636 | } | ||
637 | |||
638 | #endregion Ping Check Handling | ||
639 | |||
640 | // Inbox insertion | ||
641 | packetInbox.Enqueue(new IncomingPacket(udpClient, packet)); | ||
621 | } | 642 | } |
622 | 643 | ||
623 | protected override void PacketSent(UDPPacketBuffer buffer, int bytesSent) | 644 | protected override void PacketSent(UDPPacketBuffer buffer, int bytesSent) |