From 5e391b9f7c62e0d9328d09135521f65400e31283 Mon Sep 17 00:00:00 2001
From: Teravus Ovares (Dan Olivares)
Date: Sun, 16 Aug 2009 12:14:49 -0400
Subject: * ShortVersion, another attempt at fixing the test thread death that
randomly occurs. * LongVersion nIni may be causing the test thread death.
Pausing OpenSimulator during startup causes a nIni error that makes debugging
startup operations difficult for users. It might be because when it's in
pause mode, something else reads from the nini config passed? If it is, it
might not be fixable.. however, if it's concurrency that causes nini death
it would make sense to give each section of the tests a new IConfigSource so
that they don't read from the same configsource at the same time.
---
OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs | 1 +
1 file changed, 1 insertion(+)
(limited to 'OpenSim/Region/ClientStack/LindenUDP')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs
index bd11d97..9fb1041 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs
@@ -34,6 +34,7 @@ using OpenMetaverse;
using OpenMetaverse.Packets;
using OpenSim.Framework;
using OpenSim.Tests.Common;
+using OpenSim.Tests.Common.Mock;
namespace OpenSim.Region.ClientStack.LindenUDP.Tests
{
--
cgit v1.1
From 644db1e5400504ec70b22c3e928873948f1247c3 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Mon, 17 Aug 2009 09:40:38 +0100
Subject: Add System.Xml reference to the console project
---
.../Region/ClientStack/LindenUDP/LLClientView.cs | 77 +++++++++++++++-------
1 file changed, 55 insertions(+), 22 deletions(-)
(limited to 'OpenSim/Region/ClientStack/LindenUDP')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 12c2d86..e1d6f1b 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -1435,6 +1435,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// heightmap
public virtual void SendLayerData(float[] map)
{
+ DoSendLayerData((object)map);
ThreadPool.QueueUserWorkItem(DoSendLayerData, map);
}
@@ -1450,16 +1451,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
for (int y = 0; y < 16; y++)
{
- // 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++)
- {
- SendLayerData(x, y, LLHeightFieldMoronize(map));
+ for (int x = 0; x < 16; x += 4)
+ {
+ SendLayerPacket(LLHeightFieldMoronize(map), y, x);
Thread.Sleep(35);
}
}
@@ -1476,17 +1470,54 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// 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];
- // 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);
- // }
+ 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);
+ }
+ }
+ }
///
/// Sends a specified patch to a client
@@ -1507,6 +1538,7 @@ 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);
@@ -1556,7 +1588,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// 16x16 array of wind speeds
public virtual void SendWindData(Vector2[] windSpeeds)
{
- ThreadPool.QueueUserWorkItem(new WaitCallback(DoSendWindData), (object)windSpeeds);
+ DoSendWindData((object)windSpeeds);
+ // ThreadPool.QueueUserWorkItem(new WaitCallback(DoSendWindData), (object)windSpeeds);
}
///
--
cgit v1.1