* In our quest for sim heartbeat stats, we're a touch closer to accurate object count on sim stats.

* Fixed a rare, but possible NullReferenceException
afrisby
Teravus Ovares 2007-12-12 18:03:37 +00:00
parent 47b091f663
commit 5e6483f209
3 changed files with 15 additions and 10 deletions

View File

@ -870,7 +870,7 @@ namespace OpenSim.Region.Environment.Scenes
SceneObjectGroup copy = originPrim.Copy(AgentID, GroupID);
copy.AbsolutePosition = copy.AbsolutePosition + offset;
Entities.Add(copy.UUID, copy);
m_numPrim++;
copy.ScheduleGroupForFullUpdate();
}
}

View File

@ -518,6 +518,7 @@ namespace OpenSim.Region.Environment.Scenes
lock (Entities)
{
Entities.Remove(group.UUID);
m_innerScene.RemoveAPrimCount();
}
group.DeleteParts();
}

View File

@ -966,7 +966,6 @@ namespace OpenSim.Region.Environment.Scenes
// subscribe to physics events.
rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
}
m_innerScene.AddAPrimCount();
}
}
@ -1162,19 +1161,24 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="agentID"></param>
public override void RemoveClient(LLUUID agentID)
{
m_eventManager.TriggerOnRemovePresence(agentID);
ScenePresence avatar = GetScenePresence(agentID);
if (avatar.IsChildAgent)
try
{
m_innerScene.removeUserCount(false);
if (avatar.IsChildAgent)
{
m_innerScene.removeUserCount(false);
}
else
{
m_innerScene.removeUserCount(true);
}
}
else
catch (System.NullReferenceException)
{
m_innerScene.removeUserCount(true);
// We don't know which count to remove it from
// Avatar is already disposed :/
}
m_eventManager.TriggerOnRemovePresence(agentID);
Broadcast(delegate(IClientAPI client)
{
try