aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs22
1 files changed, 15 insertions, 7 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 34cad7b..35ccad9 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -3196,12 +3196,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3196 if (!IsActive) return; // We don't need to update inactive clients. 3196 if (!IsActive) return; // We don't need to update inactive clients.
3197 3197
3198 CoarseLocationUpdatePacket loc = (CoarseLocationUpdatePacket)PacketPool.Instance.GetPacket(PacketType.CoarseLocationUpdate); 3198 CoarseLocationUpdatePacket loc = (CoarseLocationUpdatePacket)PacketPool.Instance.GetPacket(PacketType.CoarseLocationUpdate);
3199 // TODO: don't create new blocks if recycling an old packet 3199 loc.Header.Reliable = false;
3200 int total = CoarseLocations.Count; 3200
3201 CoarseLocationUpdatePacket.IndexBlock ib = 3201 // Each packet can only hold around 62 avatar positions and the client clears the mini-map each time
3202 new CoarseLocationUpdatePacket.IndexBlock(); 3202 // a CoarseLocationUpdate packet is received. Oh well.
3203 int total = Math.Min(CoarseLocations.Count, 60);
3204
3205 CoarseLocationUpdatePacket.IndexBlock ib = new CoarseLocationUpdatePacket.IndexBlock();
3206
3203 loc.Location = new CoarseLocationUpdatePacket.LocationBlock[total]; 3207 loc.Location = new CoarseLocationUpdatePacket.LocationBlock[total];
3204 loc.AgentData = new CoarseLocationUpdatePacket.AgentDataBlock[total]; 3208 loc.AgentData = new CoarseLocationUpdatePacket.AgentDataBlock[total];
3209
3205 int selfindex = -1; 3210 int selfindex = -1;
3206 for (int i = 0; i < total; i++) 3211 for (int i = 0; i < total; i++)
3207 { 3212 {
@@ -3211,18 +3216,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3211 lb.X = (byte)CoarseLocations[i].X; 3216 lb.X = (byte)CoarseLocations[i].X;
3212 lb.Y = (byte)CoarseLocations[i].Y; 3217 lb.Y = (byte)CoarseLocations[i].Y;
3213 3218
3214 lb.Z = CoarseLocations[i].Z > 1024 ? (byte)0 : (byte)(CoarseLocations[i].Z * 0.25); 3219 lb.Z = CoarseLocations[i].Z > 1024 ? (byte)0 : (byte)(CoarseLocations[i].Z * 0.25f);
3215 loc.Location[i] = lb; 3220 loc.Location[i] = lb;
3216 loc.AgentData[i] = new CoarseLocationUpdatePacket.AgentDataBlock(); 3221 loc.AgentData[i] = new CoarseLocationUpdatePacket.AgentDataBlock();
3217 loc.AgentData[i].AgentID = users[i]; 3222 loc.AgentData[i].AgentID = users[i];
3218 if (users[i] == AgentId) 3223 if (users[i] == AgentId)
3219 selfindex = i; 3224 selfindex = i;
3220 } 3225 }
3226
3221 ib.You = (short)selfindex; 3227 ib.You = (short)selfindex;
3222 ib.Prey = -1; 3228 ib.Prey = -1;
3223 loc.Index = ib; 3229 loc.Index = ib;
3224 loc.Header.Reliable = false;
3225 loc.Header.Zerocoded = true;
3226 3230
3227 OutPacket(loc, ThrottleOutPacketType.Task); 3231 OutPacket(loc, ThrottleOutPacketType.Task);
3228 } 3232 }
@@ -4905,6 +4909,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4905 /// <param name="throttlePacketType">Throttling category for the packet</param> 4909 /// <param name="throttlePacketType">Throttling category for the packet</param>
4906 protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType) 4910 protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType)
4907 { 4911 {
4912 #region BinaryStats
4913 LLUDPServer.LogPacketHeader(false, m_circuitCode, 0, packet.Type, (ushort)packet.Length);
4914 #endregion BinaryStats
4915
4908 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, true); 4916 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, true);
4909 } 4917 }
4910 4918