aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2009-08-17 22:06:51 +0100
committerMelanie2009-08-17 22:06:51 +0100
commit9ad3e72ae1945d754417480a9f733f441d054371 (patch)
treeefd6d015cda72357b02e91e0a1f54a58b4f065a8 /OpenSim/Region
parentAdded some padding to the remote inventory connector so that it tries to oper... (diff)
downloadopensim-SC-9ad3e72ae1945d754417480a9f733f441d054371.zip
opensim-SC-9ad3e72ae1945d754417480a9f733f441d054371.tar.gz
opensim-SC-9ad3e72ae1945d754417480a9f733f441d054371.tar.bz2
opensim-SC-9ad3e72ae1945d754417480a9f733f441d054371.tar.xz
Did I say that i don't like git? Remove some stuff that shouldn't have
gone in.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs77
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs13
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs3
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs38
4 files changed, 31 insertions, 100 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 9aef26d..06bea3d 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -1435,7 +1435,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1435 /// <param name="map">heightmap</param> 1435 /// <param name="map">heightmap</param>
1436 public virtual void SendLayerData(float[] map) 1436 public virtual void SendLayerData(float[] map)
1437 { 1437 {
1438 DoSendLayerData((object)map);
1439 ThreadPool.QueueUserWorkItem(DoSendLayerData, map); 1438 ThreadPool.QueueUserWorkItem(DoSendLayerData, map);
1440 } 1439 }
1441 1440
@@ -1451,9 +1450,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1451 { 1450 {
1452 for (int y = 0; y < 16; y++) 1451 for (int y = 0; y < 16; y++)
1453 { 1452 {
1454 for (int x = 0; x < 16; x += 4) 1453 // For some terrains, sending more than one terrain patch at once results in a libsecondlife exception
1455 { 1454 // see http://opensimulator.org/mantis/view.php?id=1662
1456 SendLayerPacket(LLHeightFieldMoronize(map), y, x); 1455 //for (int x = 0; x < 16; x += 4)
1456 //{
1457 // SendLayerPacket(map, y, x);
1458 // Thread.Sleep(150);
1459 //}
1460 for (int x = 0; x < 16; x++)
1461 {
1462 SendLayerData(x, y, LLHeightFieldMoronize(map));
1457 Thread.Sleep(35); 1463 Thread.Sleep(35);
1458 } 1464 }
1459 } 1465 }
@@ -1470,54 +1476,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1470 /// <param name="map">heightmap</param> 1476 /// <param name="map">heightmap</param>
1471 /// <param name="px">X coordinate for patches 0..12</param> 1477 /// <param name="px">X coordinate for patches 0..12</param>
1472 /// <param name="py">Y coordinate for patches 0..15</param> 1478 /// <param name="py">Y coordinate for patches 0..15</param>
1473 private void SendLayerPacket(float[] map, int y, int x) 1479 // private void SendLayerPacket(float[] map, int y, int x)
1474 { 1480 // {
1475 int[] patches = new int[4]; 1481 // int[] patches = new int[4];
1476 patches[0] = x + 0 + y * 16; 1482 // patches[0] = x + 0 + y * 16;
1477 patches[1] = x + 1 + y * 16; 1483 // patches[1] = x + 1 + y * 16;
1478 patches[2] = x + 2 + y * 16; 1484 // patches[2] = x + 2 + y * 16;
1479 patches[3] = x + 3 + y * 16; 1485 // patches[3] = x + 3 + y * 16;
1480 1486
1481 LayerDataPacket layerpack; 1487 // Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches);
1482 try 1488 // OutPacket(layerpack, ThrottleOutPacketType.Land);
1483 { 1489 // }
1484 layerpack = TerrainCompressor.CreateLandPacket(map, patches);
1485 layerpack.Header.Zerocoded = true;
1486 layerpack.Header.Reliable = true;
1487
1488 if (layerpack.Length > 1000) // Oversize packet was created
1489 {
1490 for (int xa = 0 ; xa < 4 ; xa++)
1491 {
1492 // Send oversize packet in individual patches
1493 //
1494 SendLayerData(x+xa, y, map);
1495 }
1496 }
1497 else
1498 {
1499 OutPacket(layerpack, ThrottleOutPacketType.Land);
1500 }
1501 }
1502 catch (OverflowException e)
1503 {
1504 for (int xa = 0 ; xa < 4 ; xa++)
1505 {
1506 // Send oversize packet in individual patches
1507 //
1508 SendLayerData(x+xa, y, map);
1509 }
1510 }
1511 catch (IndexOutOfRangeException e)
1512 {
1513 for (int xa = 0 ; xa < 4 ; xa++)
1514 {
1515 // Bad terrain, send individual chunks
1516 //
1517 SendLayerData(x+xa, y, map);
1518 }
1519 }
1520 }
1521 1490
1522 /// <summary> 1491 /// <summary>
1523 /// Sends a specified patch to a client 1492 /// Sends a specified patch to a client
@@ -1538,7 +1507,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1538 1507
1539 LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(((map.Length==65536)? map : LLHeightFieldMoronize(map)), patches); 1508 LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(((map.Length==65536)? map : LLHeightFieldMoronize(map)), patches);
1540 layerpack.Header.Zerocoded = true; 1509 layerpack.Header.Zerocoded = true;
1541 layerpack.Header.Reliable = true;
1542 1510
1543 OutPacket(layerpack, ThrottleOutPacketType.Land); 1511 OutPacket(layerpack, ThrottleOutPacketType.Land);
1544 1512
@@ -1588,8 +1556,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1588 /// <param name="windSpeeds">16x16 array of wind speeds</param> 1556 /// <param name="windSpeeds">16x16 array of wind speeds</param>
1589 public virtual void SendWindData(Vector2[] windSpeeds) 1557 public virtual void SendWindData(Vector2[] windSpeeds)
1590 { 1558 {
1591 DoSendWindData((object)windSpeeds); 1559 ThreadPool.QueueUserWorkItem(new WaitCallback(DoSendWindData), (object)windSpeeds);
1592 // ThreadPool.QueueUserWorkItem(new WaitCallback(DoSendWindData), (object)windSpeeds);
1593 } 1560 }
1594 1561
1595 /// <summary> 1562 /// <summary>
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
index 2426393..fcc2673 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
@@ -48,7 +48,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
48 private int m_saydistance = 30; 48 private int m_saydistance = 30;
49 private int m_shoutdistance = 100; 49 private int m_shoutdistance = 100;
50 private int m_whisperdistance = 10; 50 private int m_whisperdistance = 10;
51 private string m_adminprefix = String.Empty;
52 private List<Scene> m_scenes = new List<Scene>(); 51 private List<Scene> m_scenes = new List<Scene>();
53 52
54 internal object m_syncy = new object(); 53 internal object m_syncy = new object();
@@ -77,7 +76,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
77 m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance); 76 m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance);
78 m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance); 77 m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance);
79 m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance", m_shoutdistance); 78 m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance", m_shoutdistance);
80 m_adminprefix = config.Configs["Chat"].GetString("admin_prefix", m_adminprefix);
81 } 79 }
82 80
83 public virtual void AddRegion(Scene scene) 81 public virtual void AddRegion(Scene scene)
@@ -209,8 +207,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
209 fromPos = avatar.AbsolutePosition; 207 fromPos = avatar.AbsolutePosition;
210 fromName = avatar.Name; 208 fromName = avatar.Name;
211 fromID = c.Sender.AgentId; 209 fromID = c.Sender.AgentId;
212 if (avatar.GodLevel > 100)
213 fromName = m_adminprefix + fromName;
214 210
215 break; 211 break;
216 212
@@ -259,23 +255,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
259 string fromName = c.From; 255 string fromName = c.From;
260 256
261 UUID fromID = UUID.Zero; 257 UUID fromID = UUID.Zero;
262 UUID ownerID = UUID.Zero;
263 ChatSourceType sourceType = ChatSourceType.Object; 258 ChatSourceType sourceType = ChatSourceType.Object;
264 if (null != c.Sender) 259 if (null != c.Sender)
265 { 260 {
266 ScenePresence avatar = (c.Scene as Scene).GetScenePresence(c.Sender.AgentId); 261 ScenePresence avatar = (c.Scene as Scene).GetScenePresence(c.Sender.AgentId);
267 fromID = c.Sender.AgentId; 262 fromID = c.Sender.AgentId;
268 ownerID = c.Sender.AgentId;
269 fromName = avatar.Name; 263 fromName = avatar.Name;
270 sourceType = ChatSourceType.Agent; 264 sourceType = ChatSourceType.Agent;
271 } 265 }
272 if (c.SenderObject != null)
273 {
274 SceneObjectPart senderObject = (SceneObjectPart)c.SenderObject;
275 fromID = senderObject.UUID;
276 ownerID = senderObject.OwnerID;
277 fromName = senderObject.Name;
278 }
279 266
280 // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); 267 // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType);
281 268
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index 61ef20e..75b3fe6 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -214,8 +214,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
214 214
215 private void handleEstateRestartSimRequest(IClientAPI remoteClient, int timeInSeconds) 215 private void handleEstateRestartSimRequest(IClientAPI remoteClient, int timeInSeconds)
216 { 216 {
217// m_scene.Restart(timeInSeconds); 217 m_scene.Restart(timeInSeconds);
218 remoteClient.SendBlueBoxMessage(UUID.Zero, "System", "Restart is not available");
219 } 218 }
220 219
221 private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, UUID estateCovenantID) 220 private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, UUID estateCovenantID)
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index 80d7598..b7030f1 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -156,10 +156,10 @@ namespace OpenSim.Region.Physics.OdePlugin
156 156
157 private const uint m_regionWidth = Constants.RegionSize; 157 private const uint m_regionWidth = Constants.RegionSize;
158 private const uint m_regionHeight = Constants.RegionSize; 158 private const uint m_regionHeight = Constants.RegionSize;
159 private bool IsLocked = false; 159
160 private float ODE_STEPSIZE = 0.020f; 160 private float ODE_STEPSIZE = 0.020f;
161 private float metersInSpace = 29.9f; 161 private float metersInSpace = 29.9f;
162 private List<PhysicsActor> RemoveQueue; 162
163 public float gravityx = 0f; 163 public float gravityx = 0f;
164 public float gravityy = 0f; 164 public float gravityy = 0f;
165 public float gravityz = -9.8f; 165 public float gravityz = -9.8f;
@@ -376,7 +376,6 @@ namespace OpenSim.Region.Physics.OdePlugin
376 // Initialize the mesh plugin 376 // Initialize the mesh plugin
377 public override void Initialise(IMesher meshmerizer, IConfigSource config) 377 public override void Initialise(IMesher meshmerizer, IConfigSource config)
378 { 378 {
379 RemoveQueue = new List<PhysicsActor>();
380 mesher = meshmerizer; 379 mesher = meshmerizer;
381 m_config = config; 380 m_config = config;
382 // Defaults 381 // Defaults
@@ -2048,21 +2047,13 @@ namespace OpenSim.Region.Physics.OdePlugin
2048 { 2047 {
2049 if (prim is OdePrim) 2048 if (prim is OdePrim)
2050 { 2049 {
2051 if (!IsLocked) //Fix a deadlock situation.. have we been locked by Simulate? 2050 lock (OdeLock)
2052 { 2051 {
2053 lock (OdeLock) 2052 OdePrim p = (OdePrim) prim;
2054 {
2055 OdePrim p = (OdePrim)prim;
2056 2053
2057 p.setPrimForRemoval(); 2054 p.setPrimForRemoval();
2058 AddPhysicsActorTaint(prim); 2055 AddPhysicsActorTaint(prim);
2059 //RemovePrimThreadLocked(p); 2056 //RemovePrimThreadLocked(p);
2060 }
2061 }
2062 else
2063 {
2064 //Add the prim to a queue which will be removed when Simulate has finished what it's doing.
2065 RemoveQueue.Add(prim);
2066 } 2057 }
2067 } 2058 }
2068 } 2059 }
@@ -2584,7 +2575,7 @@ namespace OpenSim.Region.Physics.OdePlugin
2584 DeleteRequestedJoints(); // this must be outside of the lock (OdeLock) to avoid deadlocks 2575 DeleteRequestedJoints(); // this must be outside of the lock (OdeLock) to avoid deadlocks
2585 CreateRequestedJoints(); // this must be outside of the lock (OdeLock) to avoid deadlocks 2576 CreateRequestedJoints(); // this must be outside of the lock (OdeLock) to avoid deadlocks
2586 } 2577 }
2587 IsLocked = true; 2578
2588 lock (OdeLock) 2579 lock (OdeLock)
2589 { 2580 {
2590 // Process 10 frames if the sim is running normal.. 2581 // Process 10 frames if the sim is running normal..
@@ -2997,19 +2988,6 @@ namespace OpenSim.Region.Physics.OdePlugin
2997 d.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix); 2988 d.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix);
2998 } 2989 }
2999 } 2990 }
3000 IsLocked = false;
3001 if (RemoveQueue.Count > 0)
3002 {
3003 do
3004 {
3005 if (RemoveQueue[0] != null)
3006 {
3007 RemovePrimThreadLocked((OdePrim)RemoveQueue[0]);
3008 }
3009 RemoveQueue.RemoveAt(0);
3010 }
3011 while (RemoveQueue.Count > 0);
3012 }
3013 2991
3014 return fps; 2992 return fps;
3015 } 2993 }