From 8251508412940b3f584f051a860a1bb4ddbfb62e Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 3 Jul 2008 23:04:12 +0000 Subject: * On client login, send only one terrain patch at a time (with pauses) instead of 4 at a time * Certain terrains which are fine went patches are sent singly cause a libsecondlife failure when patches are sent in batches * See http://opensimulator.org/mantis/view.php?id=1662 for more details --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 34 ++++++++++++++++------ 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index cd3efe3..949aa27 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -1101,27 +1101,44 @@ namespace OpenSim.Region.ClientStack.LindenUDP //} } + /// + /// Send terrain layer information to the client. + /// + /// private void DoSendLayerData(object o) { float[] map = (float[])o; + try { 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(map, y, x); - Thread.Sleep(150); + SendLayerData(x, y, map); + Thread.Sleep(35); } } } catch (Exception e) { - m_log.Warn("[client]: " + - "ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString()); + m_log.Warn("[CLIENT]: ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString()); } } + /// + /// Sends a set of four patches (x, x+1, ..., x+3) to the client + /// + /// heightmap + /// X coordinate for patches 0..12 + /// Y coordinate for patches 0..15 private void SendLayerPacket(float[] map, int y, int x) { int[] patches = new int[4]; @@ -1137,8 +1154,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// Sends a specified patch to a client /// - /// Patch coordinate (x) 0..16 - /// Patch coordinate (y) 0..16 + /// Patch coordinate (x) 0..15 + /// Patch coordinate (y) 0..15 /// heightmap public void SendLayerData(int px, int py, float[] map) { @@ -1157,8 +1174,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } catch (Exception e) { - m_log.Warn("[client]: " + - "ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString()); + m_log.Warn("[client]: ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString()); } } -- cgit v1.1