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

gone in.
arthursv
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> /// <param name="map">heightmap</param>
public virtual void SendLayerData(float[] map) public virtual void SendLayerData(float[] map)
{ {
DoSendLayerData((object)map);
ThreadPool.QueueUserWorkItem(DoSendLayerData, map); ThreadPool.QueueUserWorkItem(DoSendLayerData, map);
} }
@ -1451,9 +1450,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
for (int y = 0; y < 16; y++) 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); Thread.Sleep(35);
} }
} }
@ -1470,54 +1476,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <param name="map">heightmap</param> /// <param name="map">heightmap</param>
/// <param name="px">X coordinate for patches 0..12</param> /// <param name="px">X coordinate for patches 0..12</param>
/// <param name="py">Y coordinate for patches 0..15</param> /// <param name="py">Y coordinate for patches 0..15</param>
private void SendLayerPacket(float[] map, int y, int x) // private void SendLayerPacket(float[] map, int y, int x)
{ // {
int[] patches = new int[4]; // int[] patches = new int[4];
patches[0] = x + 0 + y * 16; // patches[0] = x + 0 + y * 16;
patches[1] = x + 1 + y * 16; // patches[1] = x + 1 + y * 16;
patches[2] = x + 2 + y * 16; // patches[2] = x + 2 + y * 16;
patches[3] = x + 3 + y * 16; // patches[3] = x + 3 + y * 16;
LayerDataPacket layerpack; // Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches);
try // OutPacket(layerpack, ThrottleOutPacketType.Land);
{ // }
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);
}
}
}
/// <summary> /// <summary>
/// Sends a specified patch to a client /// 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); LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(((map.Length==65536)? map : LLHeightFieldMoronize(map)), patches);
layerpack.Header.Zerocoded = true; layerpack.Header.Zerocoded = true;
layerpack.Header.Reliable = true;
OutPacket(layerpack, ThrottleOutPacketType.Land); OutPacket(layerpack, ThrottleOutPacketType.Land);
@ -1588,8 +1556,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <param name="windSpeeds">16x16 array of wind speeds</param> /// <param name="windSpeeds">16x16 array of wind speeds</param>
public virtual void SendWindData(Vector2[] windSpeeds) public virtual void SendWindData(Vector2[] windSpeeds)
{ {
DoSendWindData((object)windSpeeds); ThreadPool.QueueUserWorkItem(new WaitCallback(DoSendWindData), (object)windSpeeds);
// ThreadPool.QueueUserWorkItem(new WaitCallback(DoSendWindData), (object)windSpeeds);
} }
/// <summary> /// <summary>

View File

@ -48,7 +48,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
private int m_saydistance = 30; private int m_saydistance = 30;
private int m_shoutdistance = 100; private int m_shoutdistance = 100;
private int m_whisperdistance = 10; private int m_whisperdistance = 10;
private string m_adminprefix = String.Empty;
private List<Scene> m_scenes = new List<Scene>(); private List<Scene> m_scenes = new List<Scene>();
internal object m_syncy = new object(); internal object m_syncy = new object();
@ -77,7 +76,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance); m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance);
m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance); m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance);
m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance", m_shoutdistance); m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance", m_shoutdistance);
m_adminprefix = config.Configs["Chat"].GetString("admin_prefix", m_adminprefix);
} }
public virtual void AddRegion(Scene scene) public virtual void AddRegion(Scene scene)
@ -209,8 +207,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
fromPos = avatar.AbsolutePosition; fromPos = avatar.AbsolutePosition;
fromName = avatar.Name; fromName = avatar.Name;
fromID = c.Sender.AgentId; fromID = c.Sender.AgentId;
if (avatar.GodLevel > 100)
fromName = m_adminprefix + fromName;
break; break;
@ -259,23 +255,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
string fromName = c.From; string fromName = c.From;
UUID fromID = UUID.Zero; UUID fromID = UUID.Zero;
UUID ownerID = UUID.Zero;
ChatSourceType sourceType = ChatSourceType.Object; ChatSourceType sourceType = ChatSourceType.Object;
if (null != c.Sender) if (null != c.Sender)
{ {
ScenePresence avatar = (c.Scene as Scene).GetScenePresence(c.Sender.AgentId); ScenePresence avatar = (c.Scene as Scene).GetScenePresence(c.Sender.AgentId);
fromID = c.Sender.AgentId; fromID = c.Sender.AgentId;
ownerID = c.Sender.AgentId;
fromName = avatar.Name; fromName = avatar.Name;
sourceType = ChatSourceType.Agent; sourceType = ChatSourceType.Agent;
} }
if (c.SenderObject != null)
{
SceneObjectPart senderObject = (SceneObjectPart)c.SenderObject;
fromID = senderObject.UUID;
ownerID = senderObject.OwnerID;
fromName = senderObject.Name;
}
// m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType);

View File

@ -214,8 +214,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
private void handleEstateRestartSimRequest(IClientAPI remoteClient, int timeInSeconds) private void handleEstateRestartSimRequest(IClientAPI remoteClient, int timeInSeconds)
{ {
// m_scene.Restart(timeInSeconds); m_scene.Restart(timeInSeconds);
remoteClient.SendBlueBoxMessage(UUID.Zero, "System", "Restart is not available");
} }
private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, UUID estateCovenantID) private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, UUID estateCovenantID)

View File

@ -156,10 +156,10 @@ namespace OpenSim.Region.Physics.OdePlugin
private const uint m_regionWidth = Constants.RegionSize; private const uint m_regionWidth = Constants.RegionSize;
private const uint m_regionHeight = Constants.RegionSize; private const uint m_regionHeight = Constants.RegionSize;
private bool IsLocked = false;
private float ODE_STEPSIZE = 0.020f; private float ODE_STEPSIZE = 0.020f;
private float metersInSpace = 29.9f; private float metersInSpace = 29.9f;
private List<PhysicsActor> RemoveQueue;
public float gravityx = 0f; public float gravityx = 0f;
public float gravityy = 0f; public float gravityy = 0f;
public float gravityz = -9.8f; public float gravityz = -9.8f;
@ -376,7 +376,6 @@ namespace OpenSim.Region.Physics.OdePlugin
// Initialize the mesh plugin // Initialize the mesh plugin
public override void Initialise(IMesher meshmerizer, IConfigSource config) public override void Initialise(IMesher meshmerizer, IConfigSource config)
{ {
RemoveQueue = new List<PhysicsActor>();
mesher = meshmerizer; mesher = meshmerizer;
m_config = config; m_config = config;
// Defaults // Defaults
@ -2047,24 +2046,16 @@ namespace OpenSim.Region.Physics.OdePlugin
public override void RemovePrim(PhysicsActor prim) public override void RemovePrim(PhysicsActor prim)
{ {
if (prim is OdePrim) if (prim is OdePrim)
{
if (!IsLocked) //Fix a deadlock situation.. have we been locked by Simulate?
{ {
lock (OdeLock) lock (OdeLock)
{ {
OdePrim p = (OdePrim)prim; OdePrim p = (OdePrim) prim;
p.setPrimForRemoval(); p.setPrimForRemoval();
AddPhysicsActorTaint(prim); AddPhysicsActorTaint(prim);
//RemovePrimThreadLocked(p); //RemovePrimThreadLocked(p);
} }
} }
else
{
//Add the prim to a queue which will be removed when Simulate has finished what it's doing.
RemoveQueue.Add(prim);
}
}
} }
/// <summary> /// <summary>
@ -2584,7 +2575,7 @@ namespace OpenSim.Region.Physics.OdePlugin
DeleteRequestedJoints(); // this must be outside of the lock (OdeLock) to avoid deadlocks DeleteRequestedJoints(); // this must be outside of the lock (OdeLock) to avoid deadlocks
CreateRequestedJoints(); // this must be outside of the lock (OdeLock) to avoid deadlocks CreateRequestedJoints(); // this must be outside of the lock (OdeLock) to avoid deadlocks
} }
IsLocked = true;
lock (OdeLock) lock (OdeLock)
{ {
// Process 10 frames if the sim is running normal.. // Process 10 frames if the sim is running normal..
@ -2997,19 +2988,6 @@ namespace OpenSim.Region.Physics.OdePlugin
d.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix); d.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix);
} }
} }
IsLocked = false;
if (RemoveQueue.Count > 0)
{
do
{
if (RemoveQueue[0] != null)
{
RemovePrimThreadLocked((OdePrim)RemoveQueue[0]);
}
RemoveQueue.RemoveAt(0);
}
while (RemoveQueue.Count > 0);
}
return fps; return fps;
} }