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

Resolve merge conflicts

Conflicts:
	OpenSim/Region/Framework/Scenes/SceneGraph.cs
prebuild-update
Justin Clark-Casey (justincc) 2010-08-26 00:35:03 +01:00
commit 87a6554d4b
3 changed files with 47 additions and 31 deletions

View File

@ -81,12 +81,17 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
catch (Exception e) catch (Exception e)
{ {
m_log.DebugFormat("[FORMS]: exception occured on sending request to {0}: {1}", requestUrl, e.Message); m_log.DebugFormat("[FORMS]: exception occured on sending request to {0}: " + e.ToString(), requestUrl);
} }
finally finally
{ {
if (requestStream != null) // If this is closed, it will be disposed internally,
requestStream.Close(); // but the above write is asynchronous and may hit after
// we're through here. So the thread handling that will
// throw and put us back into the catch above. Isn't
// .NET great?
//if (requestStream != null)
// requestStream.Close();
// Let's not close this // Let's not close this
//buffer.Close(); //buffer.Close();
@ -112,7 +117,7 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
catch (Exception e) catch (Exception e)
{ {
m_log.DebugFormat("[FORMS]: exception occured on receiving reply {0}", e.Message); m_log.DebugFormat("[FORMS]: exception occured on receiving reply " + e.ToString());
} }
finally finally
{ {

View File

@ -3164,7 +3164,6 @@ namespace OpenSim.Region.Framework.Scenes
} }
m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode); m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode);
//m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false)); //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false));
//m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true)); //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true));
} }

View File

@ -95,7 +95,6 @@ namespace OpenSim.Region.Framework.Scenes
protected internal Dictionary<uint, SceneObjectGroup> SceneObjectGroupsByLocalID = new Dictionary<uint, SceneObjectGroup>(); protected internal Dictionary<uint, SceneObjectGroup> SceneObjectGroupsByLocalID = new Dictionary<uint, SceneObjectGroup>();
protected internal Dictionary<UUID, SceneObjectGroup> SceneObjectGroupsByFullID = new Dictionary<UUID, SceneObjectGroup>(); protected internal Dictionary<UUID, SceneObjectGroup> SceneObjectGroupsByFullID = new Dictionary<UUID, SceneObjectGroup>();
private readonly Object m_dictionary_lock = new Object();
private Object m_updateLock = new Object(); private Object m_updateLock = new Object();
@ -136,11 +135,10 @@ namespace OpenSim.Region.Framework.Scenes
m_scenePresenceArray = newlist; m_scenePresenceArray = newlist;
} }
lock (m_dictionary_lock) lock (SceneObjectGroupsByFullID)
{
SceneObjectGroupsByFullID.Clear(); SceneObjectGroupsByFullID.Clear();
lock (SceneObjectGroupsByLocalID)
SceneObjectGroupsByLocalID.Clear(); SceneObjectGroupsByLocalID.Clear();
}
Entities.Clear(); Entities.Clear();
} }
@ -384,10 +382,10 @@ namespace OpenSim.Region.Framework.Scenes
} }
sceneObject.AttachToScene(m_parentScene); sceneObject.AttachToScene(m_parentScene);
if (sendClientUpdates) if (sendClientUpdates)
sceneObject.ScheduleGroupForFullUpdate(); sceneObject.ScheduleGroupForFullUpdate();
Entities.Add(sceneObject); Entities.Add(sceneObject);
m_numPrim += sceneObject.Children.Count; m_numPrim += sceneObject.Children.Count;
@ -397,15 +395,18 @@ namespace OpenSim.Region.Framework.Scenes
if (OnObjectCreate != null) if (OnObjectCreate != null)
OnObjectCreate(sceneObject); OnObjectCreate(sceneObject);
lock (m_dictionary_lock) lock (SceneObjectGroupsByFullID)
{ {
SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject; SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
foreach (SceneObjectPart part in sceneObject.Children.Values)
SceneObjectGroupsByFullID[part.UUID] = sceneObject;
}
lock (SceneObjectGroupsByLocalID)
{
SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject; SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject;
foreach (SceneObjectPart part in sceneObject.Children.Values) foreach (SceneObjectPart part in sceneObject.Children.Values)
{
SceneObjectGroupsByFullID[part.UUID] = sceneObject;
SceneObjectGroupsByLocalID[part.LocalId] = sceneObject; SceneObjectGroupsByLocalID[part.LocalId] = sceneObject;
}
} }
} }
} }
@ -421,29 +422,32 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (Entities.ContainsKey(uuid)) if (Entities.ContainsKey(uuid))
{ {
SceneObjectGroup grp = (SceneObjectGroup)Entities[uuid];
if (!resultOfObjectLinked) if (!resultOfObjectLinked)
{ {
SceneObjectGroup sog = Entities[uuid] as SceneObjectGroup; m_numPrim -= grp.PrimCount;
lock (sog.Children) if ((grp.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics)
{ RemovePhysicalPrim(grp.PrimCount);
m_numPrim -= sog.PrimCount;
if ((((SceneObjectGroup)Entities[uuid]).RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics)
{
RemovePhysicalPrim(sog.PrimCount);
}
}
} }
if (OnObjectRemove != null) if (OnObjectRemove != null)
OnObjectRemove(Entities[uuid]); OnObjectRemove(Entities[uuid]);
lock (m_dictionary_lock) lock (SceneObjectGroupsByFullID)
{ {
SceneObjectGroupsByFullID.Remove(uuid); foreach (SceneObjectPart part in grp.Children.Values)
SceneObjectGroupsByLocalID.Remove(((SceneObjectGroup)Entities[uuid]).LocalId); SceneObjectGroupsByFullID.Remove(part.UUID);
SceneObjectGroupsByFullID.Remove(grp.RootPart.UUID);
} }
lock (SceneObjectGroupsByLocalID)
{
foreach (SceneObjectPart part in grp.Children.Values)
SceneObjectGroupsByLocalID.Remove(part.LocalId);
SceneObjectGroupsByLocalID.Remove(grp.RootPart.LocalId);
}
Entities.Remove(uuid); Entities.Remove(uuid);
//SceneObjectGroup part; //SceneObjectGroup part;
//((part.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics) //((part.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics)
@ -868,7 +872,9 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (SceneObjectGroupsByLocalID.TryGetValue(localID, out sog)) if (SceneObjectGroupsByLocalID.TryGetValue(localID, out sog))
{ {
return sog; if (sog.HasChildPrim(localID))
return sog;
SceneObjectGroupsByLocalID.Remove(localID);
} }
} }
@ -904,7 +910,13 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (SceneObjectGroupsByFullID.TryGetValue(fullID, out sog)) if (SceneObjectGroupsByFullID.TryGetValue(fullID, out sog))
{ {
return sog; lock (sog.Children)
{
if (sog.Children.ContainsKey(fullID))
return sog;
}
SceneObjectGroupsByFullID.Remove(fullID);
} }
} }