diff options
author | UbitUmarov | 2019-03-17 21:37:21 +0000 |
---|---|---|
committer | UbitUmarov | 2019-03-17 21:37:21 +0000 |
commit | b9987b41837e00f21873e14df0cbf7e60377308a (patch) | |
tree | 8c706e694ec84d775525d0d3a5a9d3d1574a5687 /OpenSim | |
parent | remove redundant code (diff) | |
download | opensim-SC-b9987b41837e00f21873e14df0cbf7e60377308a.zip opensim-SC-b9987b41837e00f21873e14df0cbf7e60377308a.tar.gz opensim-SC-b9987b41837e00f21873e14df0cbf7e60377308a.tar.bz2 opensim-SC-b9987b41837e00f21873e14df0cbf7e60377308a.tar.xz |
stop sending some useless small packets
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 1004b07..39e2d39 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -4184,6 +4184,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4184 | m_udpServer.SendUDPPacket(m_udpClient, buf, ThrottleOutPacketType.Task, null, false, true); | 4184 | m_udpServer.SendUDPPacket(m_udpClient, buf, ThrottleOutPacketType.Task, null, false, true); |
4185 | } | 4185 | } |
4186 | 4186 | ||
4187 | //UUID m_courseLocationPrey = UUID.Zero; | ||
4188 | bool m_couseLocationLastEmpty = false; | ||
4189 | |||
4187 | static private readonly byte[] CoarseLocationUpdateHeader = new byte[] { | 4190 | static private readonly byte[] CoarseLocationUpdateHeader = new byte[] { |
4188 | 0, // no acks plz | 4191 | 0, // no acks plz |
4189 | 0, 0, 0, 0, // sequence number | 4192 | 0, 0, 0, 0, // sequence number |
@@ -4198,6 +4201,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4198 | return; | 4201 | return; |
4199 | 4202 | ||
4200 | int totalLocations = Math.Min(CoarseLocations.Count, 60); | 4203 | int totalLocations = Math.Min(CoarseLocations.Count, 60); |
4204 | if(totalLocations == 0) | ||
4205 | { | ||
4206 | if(m_couseLocationLastEmpty) | ||
4207 | return; | ||
4208 | m_couseLocationLastEmpty = true; | ||
4209 | } | ||
4210 | else | ||
4211 | m_couseLocationLastEmpty = false; | ||
4212 | |||
4201 | int totalAgents = Math.Min(users.Count, 60); | 4213 | int totalAgents = Math.Min(users.Count, 60); |
4202 | if(totalAgents > totalLocations) | 4214 | if(totalAgents > totalLocations) |
4203 | totalAgents = totalLocations; | 4215 | totalAgents = totalLocations; |
@@ -4205,6 +4217,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4205 | int selfindex = -1; | 4217 | int selfindex = -1; |
4206 | int preyindex = -1; | 4218 | int preyindex = -1; |
4207 | 4219 | ||
4220 | //bool doprey = m_courseLocationPrey != UUID.Zero; | ||
4221 | |||
4208 | UDPPacketBuffer buf = m_udpServer.GetNewUDPBuffer(m_udpClient.RemoteEndPoint); | 4222 | UDPPacketBuffer buf = m_udpServer.GetNewUDPBuffer(m_udpClient.RemoteEndPoint); |
4209 | Buffer.BlockCopy(CoarseLocationUpdateHeader, 0, buf.Data, 0, 8); | 4223 | Buffer.BlockCopy(CoarseLocationUpdateHeader, 0, buf.Data, 0, 8); |
4210 | byte[] data = buf.Data; | 4224 | byte[] data = buf.Data; |
@@ -4222,8 +4236,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4222 | { | 4236 | { |
4223 | if (users[i] == AgentId) | 4237 | if (users[i] == AgentId) |
4224 | selfindex = i; | 4238 | selfindex = i; |
4225 | //if (users[i] == PreyId) | 4239 | //if (doprey && users[i] == m_courseLocationPrey) |
4226 | // preyindex = -1; | 4240 | // preyindex = i; |
4227 | } | 4241 | } |
4228 | } | 4242 | } |
4229 | 4243 | ||
@@ -7534,15 +7548,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7534 | TrackAgentPacket TrackAgent = | 7548 | TrackAgentPacket TrackAgent = |
7535 | (TrackAgentPacket)Packet; | 7549 | (TrackAgentPacket)Packet; |
7536 | 7550 | ||
7551 | if(TrackAgent.AgentData.AgentID != AgentId || TrackAgent.AgentData.SessionID != SessionId) | ||
7552 | return false; | ||
7553 | |||
7537 | TrackAgentUpdate TrackAgentHandler = OnTrackAgent; | 7554 | TrackAgentUpdate TrackAgentHandler = OnTrackAgent; |
7538 | if (TrackAgentHandler != null) | 7555 | if (TrackAgentHandler != null) |
7539 | { | 7556 | { |
7540 | TrackAgentHandler(this, | 7557 | TrackAgentHandler(this, |
7541 | TrackAgent.AgentData.AgentID, | 7558 | TrackAgent.AgentData.AgentID, |
7542 | TrackAgent.TargetData.PreyID); | 7559 | TrackAgent.TargetData.PreyID); |
7543 | return true; | ||
7544 | } | 7560 | } |
7545 | return false; | 7561 | // else |
7562 | // m_courseLocationPrey = TrackAgent.TargetData.PreyID; | ||
7563 | return true; | ||
7546 | } | 7564 | } |
7547 | 7565 | ||
7548 | private bool HandlerRezObject(IClientAPI sender, Packet Pack) | 7566 | private bool HandlerRezObject(IClientAPI sender, Packet Pack) |