Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

This commit is contained in:
Dan Lake
2012-02-01 16:25:35 -08:00
136 changed files with 5757 additions and 1738 deletions

View File

@@ -41,12 +41,6 @@ namespace OpenSim.Region.Framework.Scenes
{
public delegate void PhysicsCrash();
public delegate void ObjectDuplicateDelegate(EntityBase original, EntityBase clone);
public delegate void ObjectCreateDelegate(EntityBase obj);
public delegate void ObjectDeleteDelegate(EntityBase obj);
/// <summary>
/// This class used to be called InnerScene and may not yet truly be a SceneGraph. The non scene graph components
/// should be migrated out over time.
@@ -60,10 +54,6 @@ namespace OpenSim.Region.Framework.Scenes
protected internal event PhysicsCrash UnRecoverableError;
private PhysicsCrash handlerPhysicsCrash = null;
public event ObjectDuplicateDelegate OnObjectDuplicate;
public event ObjectCreateDelegate OnObjectCreate;
public event ObjectDeleteDelegate OnObjectRemove;
#endregion
#region Fields
@@ -364,11 +354,23 @@ namespace OpenSim.Region.Framework.Scenes
/// </returns>
protected bool AddSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates)
{
if (sceneObject == null || sceneObject.RootPart.UUID == UUID.Zero)
if (sceneObject.UUID == UUID.Zero)
{
m_log.ErrorFormat(
"[SCENEGRAPH]: Tried to add scene object {0} to {1} with illegal UUID of {2}",
sceneObject.Name, m_parentScene.RegionInfo.RegionName, UUID.Zero);
return false;
}
if (Entities.ContainsKey(sceneObject.UUID))
{
// m_log.DebugFormat(
// "[SCENEGRAPH]: Scene graph for {0} already contains object {1} in AddSceneObject()",
// m_parentScene.RegionInfo.RegionName, sceneObject.UUID);
return false;
}
// m_log.DebugFormat(
// "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}",
@@ -405,9 +407,6 @@ namespace OpenSim.Region.Framework.Scenes
if (attachToBackup)
sceneObject.AttachToBackup();
if (OnObjectCreate != null)
OnObjectCreate(sceneObject);
lock (SceneObjectGroupsByFullID)
SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
@@ -456,9 +455,6 @@ namespace OpenSim.Region.Framework.Scenes
if ((grp.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics)
RemovePhysicalPrim(grp.PrimCount);
}
if (OnObjectRemove != null)
OnObjectRemove(Entities[uuid]);
lock (SceneObjectGroupsByFullID)
SceneObjectGroupsByFullID.Remove(grp.UUID);
@@ -1154,8 +1150,10 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="action"></param>
protected internal void ForEachSOG(Action<SceneObjectGroup> action)
{
// FIXME: Need to lock here, really.
List<SceneObjectGroup> objlist = new List<SceneObjectGroup>(SceneObjectGroupsByFullID.Values);
List<SceneObjectGroup> objlist;
lock (SceneObjectGroupsByFullID)
objlist = new List<SceneObjectGroup>(SceneObjectGroupsByFullID.Values);
foreach (SceneObjectGroup obj in objlist)
{
try
@@ -1164,7 +1162,7 @@ namespace OpenSim.Region.Framework.Scenes
}
catch (Exception e)
{
// Catch it and move on. This includes situations where splist has inconsistent info
// Catch it and move on. This includes situations where objlist has inconsistent info
m_log.WarnFormat(
"[SCENEGRAPH]: Problem processing action in ForEachSOG: {0} {1}", e.Message, e.StackTrace);
}
@@ -1399,10 +1397,10 @@ namespace OpenSim.Region.Framework.Scenes
/// <summary>
/// Update the texture entry of the given prim.
/// </summary>
///
/// <remarks>
/// A texture entry is an object that contains details of all the textures of the prim's face. In this case,
/// the texture is given in its byte serialized form.
///
/// </remarks>
/// <param name="localID"></param>
/// <param name="texture"></param>
/// <param name="remoteClient"></param>
@@ -1980,9 +1978,6 @@ namespace OpenSim.Region.Framework.Scenes
// required for physics to update it's position
copy.AbsolutePosition = copy.AbsolutePosition;
if (OnObjectDuplicate != null)
OnObjectDuplicate(original, copy);
return copy;
}
}