change to how initial terrain data is sent. Instead of sending the 64 packets in rapid fire as quickly as possible. The terrain data sending is now done in a threadpool worker thread over ~10 seconds with a thread.sleep between each packet sending. this hasn't been tested thoroughly, so it might not actually help with the atom bomb terrain (missing patches) but its a simple thing to revert if it makes things worse for anyone.

10 seconds is roughly the time between the region handshake completing and you being in world where you can see your avatar. So normally the terrain still should have loaded by time you get in the region, although it is possible that sometimes you might see the very end of the terrain load just after you arrive.
0.6.0-stable
MW 2008-05-22 19:44:57 +00:00
parent c124bb58ec
commit 811cd3e0bf
1 changed files with 46 additions and 10 deletions

View File

@ -1002,21 +1002,44 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <param name="map">heightmap</param> /// <param name="map">heightmap</param>
public virtual void SendLayerData(float[] map) public virtual void SendLayerData(float[] map)
{ {
ThreadPool.QueueUserWorkItem(new WaitCallback(DoSendLayerData), (object)map);
//try
//{
// int[] patches = new int[4];
// for (int y = 0; y < 16; y++)
// {
// for (int x = 0; x < 16; x += 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;
// Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches);
// OutPacket(layerpack, ThrottleOutPacketType.Land);
// }
// }
//}
//catch (Exception e)
//{
// m_log.Warn("[client]: " +
// "ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString());
//}
}
private void DoSendLayerData(object o)
{
float[] map = (float[])o;
try try
{ {
int[] patches = new int[4];
for (int y = 0; y < 16; y++) for (int y = 0; y < 16; y++)
{ {
for (int x = 0; x < 16; x += 4) for (int x = 0; x < 16; x += 4)
{ {
patches[0] = x + 0 + y * 16; SendLayerPacket(map, y, x);
patches[1] = x + 1 + y * 16; Thread.Sleep(150);
patches[2] = x + 2 + y * 16;
patches[3] = x + 3 + y * 16;
Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches);
OutPacket(layerpack, ThrottleOutPacketType.Land);
} }
} }
} }
@ -1027,6 +1050,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
} }
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;
Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches);
OutPacket(layerpack, ThrottleOutPacketType.Land);
}
/// <summary> /// <summary>
/// Sends a specified patch to a client /// Sends a specified patch to a client
/// </summary> /// </summary>