aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-06-12 20:19:42 +0000
committerTeravus Ovares2008-06-12 20:19:42 +0000
commit5219eb74209d83f1a240a75528fad9d302b84f0e (patch)
treeb9cd1712b30bb348998482ef39d51c777c4e854e /OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
parentFix mysql migrations. This is tested with an existing up to date schema, (diff)
downloadopensim-SC_OLD-5219eb74209d83f1a240a75528fad9d302b84f0e.zip
opensim-SC_OLD-5219eb74209d83f1a240a75528fad9d302b84f0e.tar.gz
opensim-SC_OLD-5219eb74209d83f1a240a75528fad9d302b84f0e.tar.bz2
opensim-SC_OLD-5219eb74209d83f1a240a75528fad9d302b84f0e.tar.xz
* 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).
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs47
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);