diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 47 |
1 files changed, 36 insertions, 11 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 47a9f53..5cbe04e 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -1209,29 +1209,54 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1209 | OutPacket(newSimPack, ThrottleOutPacketType.Unknown); | 1209 | OutPacket(newSimPack, ThrottleOutPacketType.Unknown); |
1210 | } | 1210 | } |
1211 | 1211 | ||
1212 | public void SendMapBlock(List<MapBlockData> mapBlocks) | 1212 | internal void SendMapBlockSplit(List<MapBlockData> mapBlocks) |
1213 | { | 1213 | { |
1214 | MapBlockReplyPacket mapReply = (MapBlockReplyPacket)PacketPool.Instance.GetPacket(PacketType.MapBlockReply); | 1214 | MapBlockReplyPacket mapReply = (MapBlockReplyPacket)PacketPool.Instance.GetPacket(PacketType.MapBlockReply); |
1215 | // TODO: don't create new blocks if recycling an old packet | 1215 | // TODO: don't create new blocks if recycling an old packet |
1216 | |||
1217 | MapBlockData[] mapBlocks2 = mapBlocks.ToArray(); | ||
1218 | |||
1216 | mapReply.AgentData.AgentID = AgentId; | 1219 | mapReply.AgentData.AgentID = AgentId; |
1217 | mapReply.Data = new MapBlockReplyPacket.DataBlock[mapBlocks.Count]; | 1220 | mapReply.Data = new MapBlockReplyPacket.DataBlock[mapBlocks2.Length]; |
1218 | mapReply.AgentData.Flags = 0; | 1221 | mapReply.AgentData.Flags = 0; |
1219 | 1222 | ||
1220 | for (int i = 0; i < mapBlocks.Count; i++) | 1223 | for (int i = 0; i < mapBlocks2.Length; i++) |
1221 | { | 1224 | { |
1222 | mapReply.Data[i] = new MapBlockReplyPacket.DataBlock(); | 1225 | mapReply.Data[i] = new MapBlockReplyPacket.DataBlock(); |
1223 | mapReply.Data[i].MapImageID = mapBlocks[i].MapImageId; | 1226 | mapReply.Data[i].MapImageID = mapBlocks2[i].MapImageId; |
1224 | mapReply.Data[i].X = mapBlocks[i].X; | 1227 | mapReply.Data[i].X = mapBlocks2[i].X; |
1225 | mapReply.Data[i].Y = mapBlocks[i].Y; | 1228 | mapReply.Data[i].Y = mapBlocks2[i].Y; |
1226 | mapReply.Data[i].WaterHeight = mapBlocks[i].WaterHeight; | 1229 | mapReply.Data[i].WaterHeight = mapBlocks2[i].WaterHeight; |
1227 | mapReply.Data[i].Name = Helpers.StringToField(mapBlocks[i].Name); | 1230 | mapReply.Data[i].Name = Helpers.StringToField(mapBlocks2[i].Name); |
1228 | mapReply.Data[i].RegionFlags = mapBlocks[i].RegionFlags; | 1231 | mapReply.Data[i].RegionFlags = mapBlocks2[i].RegionFlags; |
1229 | mapReply.Data[i].Access = mapBlocks[i].Access; | 1232 | mapReply.Data[i].Access = mapBlocks2[i].Access; |
1230 | mapReply.Data[i].Agents = mapBlocks[i].Agents; | 1233 | mapReply.Data[i].Agents = mapBlocks2[i].Agents; |
1231 | } | 1234 | } |
1232 | OutPacket(mapReply, ThrottleOutPacketType.Land); | 1235 | OutPacket(mapReply, ThrottleOutPacketType.Land); |
1233 | } | 1236 | } |
1234 | 1237 | ||
1238 | public void SendMapBlock(List<MapBlockData> mapBlocks) | ||
1239 | { | ||
1240 | |||
1241 | MapBlockData[] mapBlocks2 = mapBlocks.ToArray(); | ||
1242 | |||
1243 | int maxsend = 10; | ||
1244 | |||
1245 | //int packets = Math.Ceiling(mapBlocks2.Length / maxsend); | ||
1246 | |||
1247 | List<MapBlockData> sendingBlocks = new List<MapBlockData>(); | ||
1248 | |||
1249 | for (int i = 0; i < mapBlocks2.Length; i++) | ||
1250 | { | ||
1251 | sendingBlocks.Add(mapBlocks2[i]); | ||
1252 | if (((i + 1) == mapBlocks2.Length) || ((i % maxsend) == 0)) | ||
1253 | { | ||
1254 | SendMapBlockSplit(sendingBlocks); | ||
1255 | sendingBlocks = new List<MapBlockData>(); | ||
1256 | } | ||
1257 | } | ||
1258 | } | ||
1259 | |||
1235 | public void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags) | 1260 | public void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags) |
1236 | { | 1261 | { |
1237 | TeleportLocalPacket tpLocal = (TeleportLocalPacket)PacketPool.Instance.GetPacket(PacketType.TeleportLocal); | 1262 | TeleportLocalPacket tpLocal = (TeleportLocalPacket)PacketPool.Instance.GetPacket(PacketType.TeleportLocal); |