Did I say that i don't like git? Remove some stuff that shouldn't have

gone in.
This commit is contained in:
Melanie
2009-08-17 22:06:51 +01:00
parent 3a3f9d5abb
commit 9ad3e72ae1
4 changed files with 29 additions and 98 deletions

View File

@@ -1435,7 +1435,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <param name="map">heightmap</param>
public virtual void SendLayerData(float[] map)
{
DoSendLayerData((object)map);
ThreadPool.QueueUserWorkItem(DoSendLayerData, map);
}
@@ -1451,9 +1450,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
for (int y = 0; y < 16; y++)
{
for (int x = 0; x < 16; x += 4)
// For some terrains, sending more than one terrain patch at once results in a libsecondlife exception
// see http://opensimulator.org/mantis/view.php?id=1662
//for (int x = 0; x < 16; x += 4)
//{
// SendLayerPacket(map, y, x);
// Thread.Sleep(150);
//}
for (int x = 0; x < 16; x++)
{
SendLayerPacket(LLHeightFieldMoronize(map), y, x);
SendLayerData(x, y, LLHeightFieldMoronize(map));
Thread.Sleep(35);
}
}
@@ -1470,54 +1476,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <param name="map">heightmap</param>
/// <param name="px">X coordinate for patches 0..12</param>
/// <param name="py">Y coordinate for patches 0..15</param>
private void SendLayerPacket(float[] map, int y, int x)
{
int[] patches = new int[4];
patches[0] = x + 0 + y * 16;
patches[1] = x + 1 + y * 16;
patches[2] = x + 2 + y * 16;
patches[3] = x + 3 + y * 16;
// private void SendLayerPacket(float[] map, int y, int x)
// {
// int[] patches = new int[4];
// patches[0] = x + 0 + y * 16;
// patches[1] = x + 1 + y * 16;
// patches[2] = x + 2 + y * 16;
// patches[3] = x + 3 + y * 16;
LayerDataPacket layerpack;
try
{
layerpack = TerrainCompressor.CreateLandPacket(map, patches);
layerpack.Header.Zerocoded = true;
layerpack.Header.Reliable = true;
if (layerpack.Length > 1000) // Oversize packet was created
{
for (int xa = 0 ; xa < 4 ; xa++)
{
// Send oversize packet in individual patches
//
SendLayerData(x+xa, y, map);
}
}
else
{
OutPacket(layerpack, ThrottleOutPacketType.Land);
}
}
catch (OverflowException e)
{
for (int xa = 0 ; xa < 4 ; xa++)
{
// Send oversize packet in individual patches
//
SendLayerData(x+xa, y, map);
}
}
catch (IndexOutOfRangeException e)
{
for (int xa = 0 ; xa < 4 ; xa++)
{
// Bad terrain, send individual chunks
//
SendLayerData(x+xa, y, map);
}
}
}
// Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches);
// OutPacket(layerpack, ThrottleOutPacketType.Land);
// }
/// <summary>
/// Sends a specified patch to a client
@@ -1538,7 +1507,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(((map.Length==65536)? map : LLHeightFieldMoronize(map)), patches);
layerpack.Header.Zerocoded = true;
layerpack.Header.Reliable = true;
OutPacket(layerpack, ThrottleOutPacketType.Land);
@@ -1588,8 +1556,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <param name="windSpeeds">16x16 array of wind speeds</param>
public virtual void SendWindData(Vector2[] windSpeeds)
{
DoSendWindData((object)windSpeeds);
// ThreadPool.QueueUserWorkItem(new WaitCallback(DoSendWindData), (object)windSpeeds);
ThreadPool.QueueUserWorkItem(new WaitCallback(DoSendWindData), (object)windSpeeds);
}
/// <summary>