aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-09-26 17:25:22 +0000
committerTeravus Ovares2008-09-26 17:25:22 +0000
commit16b6738cdadc70966a93b6d025ae469738955dcb (patch)
tree7a3c0075e9ee5fd04d972bc52be38aec4d51f648 /OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
parentDNE code cleanups (diff)
downloadopensim-SC-16b6738cdadc70966a93b6d025ae469738955dcb.zip
opensim-SC-16b6738cdadc70966a93b6d025ae469738955dcb.tar.gz
opensim-SC-16b6738cdadc70966a93b6d025ae469738955dcb.tar.bz2
opensim-SC-16b6738cdadc70966a93b6d025ae469738955dcb.tar.xz
* Patch from JHurliman
* Updates to libomv r2243, * Remove lots of unnecessary typecasts * Improves SendWindData() Thanks jhurliman. * Will update OpenSim-libs in 10 minutes..
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs110
1 files changed, 36 insertions, 74 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 4027377..5a48c90 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -1232,43 +1232,40 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1232 /// <summary> 1232 /// <summary>
1233 /// Send the region heightmap to the client 1233 /// Send the region heightmap to the client
1234 /// </summary> 1234 /// </summary>
1235 /// <param name="map">heightmap</param> 1235 /// <param name="windSpeeds">16x16 array of wind speeds</param>
1236 public virtual void SendWindData(float[] map) 1236 public virtual void SendWindData(Vector2[] windSpeeds)
1237 { 1237 {
1238 //ThreadPool.QueueUserWorkItem(new WaitCallback(DoSendWindData), (object)map); 1238 ThreadPool.QueueUserWorkItem(new WaitCallback(DoSendWindData), (object)windSpeeds);
1239 } 1239 }
1240 1240
1241 /// <summary> 1241 /// <summary>
1242 /// Send terrain layer information to the client. 1242 /// Send terrain layer information to the client.
1243 /// </summary> 1243 /// </summary>
1244 /// <param name="o"></param> 1244 /// <param name="o"></param>
1245 //private void DoSendWindData(object o) 1245 private void DoSendWindData(object o)
1246 //{ 1246 {
1247 //float[] map = (float[])o; 1247 Vector2[] windSpeeds = (Vector2[])o;
1248 1248
1249 //try 1249 TerrainPatch[] patches = new TerrainPatch[2];
1250 //{ 1250 patches[0] = new TerrainPatch();
1251 //for (int y = 0; y < 16; y++) 1251 patches[0].Data = new float[16 * 16];
1252 //{ 1252 patches[1] = new TerrainPatch();
1253 // For some terrains, sending more than one terrain patch at once results in a libsecondlife exception 1253 patches[1].Data = new float[16 * 16];
1254 // see http://opensimulator.org/mantis/view.php?id=1662 1254
1255 //for (int x = 0; x < 16; x += 4) 1255 for (int y = 0; y < 16; y++)
1256 //{ 1256 {
1257 // SendLayerPacket(map, y, x); 1257 for (int x = 0; x < 16; x++)
1258 // Thread.Sleep(150); 1258 {
1259 //} 1259 patches[0].Data[y * 16 + x] = windSpeeds[y * 16 + x].X;
1260 // for (int x = 0; x < 16; x++) 1260 patches[1].Data[y * 16 + x] = windSpeeds[y * 16 + x].Y;
1261 //{ 1261 }
1262 //SendWindData(x, y, map); 1262 }
1263 //Thread.Sleep(35); 1263
1264 //} 1264 LayerDataPacket layerpack = TerrainCompressor.CreateLayerDataPacket(patches, TerrainPatch.LayerType.Wind);
1265 //} 1265 layerpack.Header.Zerocoded = true;
1266 //} 1266
1267 //catch (Exception e) 1267 OutPacket(layerpack, ThrottleOutPacketType.Wind);
1268 //{ 1268 }
1269 // m_log.Warn("[CLIENT]: ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString());
1270 // }
1271 //}
1272 1269
1273 /// <summary> 1270 /// <summary>
1274 /// Sends a set of four patches (x, x+1, ..., x+3) to the client 1271 /// Sends a set of four patches (x, x+1, ..., x+3) to the client
@@ -1289,41 +1286,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1289 // } 1286 // }
1290 1287
1291 /// <summary> 1288 /// <summary>
1292 /// Sends a specified patch to a client
1293 /// </summary>
1294 /// <param name="px">Patch coordinate (x) 0..15</param>
1295 /// <param name="py">Patch coordinate (y) 0..15</param>
1296 /// <param name="map">heightmap</param>
1297 public void SendWindData(int p1x, int p1y, int p2x, int p2y, float[] map)
1298 {
1299 try
1300 {
1301 int[] patches = new int[2];
1302 int patch1x, patch1y, patch2x, patch2y;
1303 patch1x = p1x;
1304 patch1y = p1y;
1305 patch2x = p2x;
1306 patch2y = p2y;
1307
1308
1309 patches[0] = patch1x + 0 + patch1y * 16;
1310 patches[1] = patch2x + 0 + patch2y * 16;
1311
1312 LayerDataPacket layerpack = TerrainCompressor.CreateWindPacket(map, patches);
1313 layerpack.Header.Zerocoded = true;
1314
1315 OutPacket(layerpack, ThrottleOutPacketType.Wind);
1316
1317 }
1318 catch (Exception e)
1319 {
1320 m_log.Warn("[client]: ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString());
1321 }
1322 }
1323
1324
1325
1326 /// <summary>
1327 /// Tell the client that the given neighbour region is ready to receive a child agent. 1289 /// Tell the client that the given neighbour region is ready to receive a child agent.
1328 /// </summary> 1290 /// </summary>
1329 /// <param name="neighbourHandle"></param> 1291 /// <param name="neighbourHandle"></param>
@@ -2940,13 +2902,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2940 updatePacket.ParcelData.PassPrice = landData.PassPrice; 2902 updatePacket.ParcelData.PassPrice = landData.PassPrice;
2941 updatePacket.ParcelData.PublicCount = 0; //unemplemented 2903 updatePacket.ParcelData.PublicCount = 0; //unemplemented
2942 2904
2943 updatePacket.ParcelData.RegionDenyAnonymous = ((regionFlags & (uint)Simulator.RegionFlags.DenyAnonymous) > 2905 updatePacket.ParcelData.RegionDenyAnonymous = ((regionFlags & (uint)RegionFlags.DenyAnonymous) >
2944 0); 2906 0);
2945 updatePacket.ParcelData.RegionDenyIdentified = ((regionFlags & (uint)Simulator.RegionFlags.DenyIdentified) > 2907 updatePacket.ParcelData.RegionDenyIdentified = ((regionFlags & (uint)RegionFlags.DenyIdentified) >
2946 0); 2908 0);
2947 updatePacket.ParcelData.RegionDenyTransacted = ((regionFlags & (uint)Simulator.RegionFlags.DenyTransacted) > 2909 updatePacket.ParcelData.RegionDenyTransacted = ((regionFlags & (uint)RegionFlags.DenyTransacted) >
2948 0); 2910 0);
2949 updatePacket.ParcelData.RegionPushOverride = ((regionFlags & (uint)Simulator.RegionFlags.RestrictPushObject) > 2911 updatePacket.ParcelData.RegionPushOverride = ((regionFlags & (uint)RegionFlags.RestrictPushObject) >
2950 0); 2912 0);
2951 2913
2952 updatePacket.ParcelData.RentPrice = 0; 2914 updatePacket.ParcelData.RentPrice = 0;
@@ -3586,7 +3548,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3586 { 3548 {
3587 string name = (string)nod.Attributes["name"].Value.ToLower(); 3549 string name = (string)nod.Attributes["name"].Value.ToLower();
3588 string id = (string)nod.InnerText; 3550 string id = (string)nod.InnerText;
3589 m_defaultAnimations.Add(name, id); 3551 m_defaultAnimations.Add(name, (UUID)id);
3590 } 3552 }
3591 } 3553 }
3592 } 3554 }
@@ -4936,9 +4898,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4936 // 4898 //
4937 if (transfer.TransferInfo.SourceType == 3) 4899 if (transfer.TransferInfo.SourceType == 3)
4938 { 4900 {
4939 UUID taskID = null; 4901 UUID taskID = UUID.Zero;
4940 UUID itemID = null; 4902 UUID itemID = UUID.Zero;
4941 UUID requestID = null; 4903 UUID requestID = UUID.Zero;
4942 taskID = new UUID(transfer.TransferInfo.Params, 48); 4904 taskID = new UUID(transfer.TransferInfo.Params, 48);
4943 itemID = new UUID(transfer.TransferInfo.Params, 64); 4905 itemID = new UUID(transfer.TransferInfo.Params, 64);
4944 requestID = new UUID(transfer.TransferInfo.Params, 80); 4906 requestID = new UUID(transfer.TransferInfo.Params, 80);
@@ -5569,7 +5531,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5569 { 5531 {
5570 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 5532 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
5571 entry.AgentID = block.ID; 5533 entry.AgentID = block.ID;
5572 entry.Flags = (ParcelManager.AccessList)block.Flags; 5534 entry.Flags = (AccessList)block.Flags;
5573 entry.Time = new DateTime(); 5535 entry.Time = new DateTime();
5574 entries.Add(entry); 5536 entries.Add(entry);
5575 } 5537 }