From 5219eb74209d83f1a240a75528fad9d302b84f0e Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 12 Jun 2008 20:19:42 +0000 Subject: * Split the World Map code into a module. * Implemented a hack so regions beyond the 10,000m range will show the map without having to click on the map before they'll start to show. The hack shows regions around the one you're in, but it won't show the one you're in.. you still need to click on the map to get that (not sure why yet). Additionally, the map still only shows pictures for regions that are hosted on the same instance (no change). --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 47 +++++++++++++++++----- 1 file changed, 36 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP') 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 OutPacket(newSimPack, ThrottleOutPacketType.Unknown); } - public void SendMapBlock(List mapBlocks) + internal void SendMapBlockSplit(List mapBlocks) { MapBlockReplyPacket mapReply = (MapBlockReplyPacket)PacketPool.Instance.GetPacket(PacketType.MapBlockReply); // TODO: don't create new blocks if recycling an old packet + + MapBlockData[] mapBlocks2 = mapBlocks.ToArray(); + mapReply.AgentData.AgentID = AgentId; - mapReply.Data = new MapBlockReplyPacket.DataBlock[mapBlocks.Count]; + mapReply.Data = new MapBlockReplyPacket.DataBlock[mapBlocks2.Length]; mapReply.AgentData.Flags = 0; - for (int i = 0; i < mapBlocks.Count; i++) + for (int i = 0; i < mapBlocks2.Length; i++) { mapReply.Data[i] = new MapBlockReplyPacket.DataBlock(); - mapReply.Data[i].MapImageID = mapBlocks[i].MapImageId; - mapReply.Data[i].X = mapBlocks[i].X; - mapReply.Data[i].Y = mapBlocks[i].Y; - mapReply.Data[i].WaterHeight = mapBlocks[i].WaterHeight; - mapReply.Data[i].Name = Helpers.StringToField(mapBlocks[i].Name); - mapReply.Data[i].RegionFlags = mapBlocks[i].RegionFlags; - mapReply.Data[i].Access = mapBlocks[i].Access; - mapReply.Data[i].Agents = mapBlocks[i].Agents; + mapReply.Data[i].MapImageID = mapBlocks2[i].MapImageId; + mapReply.Data[i].X = mapBlocks2[i].X; + mapReply.Data[i].Y = mapBlocks2[i].Y; + mapReply.Data[i].WaterHeight = mapBlocks2[i].WaterHeight; + mapReply.Data[i].Name = Helpers.StringToField(mapBlocks2[i].Name); + mapReply.Data[i].RegionFlags = mapBlocks2[i].RegionFlags; + mapReply.Data[i].Access = mapBlocks2[i].Access; + mapReply.Data[i].Agents = mapBlocks2[i].Agents; } OutPacket(mapReply, ThrottleOutPacketType.Land); } + public void SendMapBlock(List mapBlocks) + { + + MapBlockData[] mapBlocks2 = mapBlocks.ToArray(); + + int maxsend = 10; + + //int packets = Math.Ceiling(mapBlocks2.Length / maxsend); + + List sendingBlocks = new List(); + + for (int i = 0; i < mapBlocks2.Length; i++) + { + sendingBlocks.Add(mapBlocks2[i]); + if (((i + 1) == mapBlocks2.Length) || ((i % maxsend) == 0)) + { + SendMapBlockSplit(sendingBlocks); + sendingBlocks = new List(); + } + } + } + public void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags) { TeleportLocalPacket tpLocal = (TeleportLocalPacket)PacketPool.Instance.GetPacket(PacketType.TeleportLocal); -- cgit v1.1