* 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); SceneObjectGroup copy = originPrim.Copy(AgentID, GroupID);
copy.AbsolutePosition = copy.AbsolutePosition + offset; copy.AbsolutePosition = copy.AbsolutePosition + offset;
Entities.Add(copy.UUID, copy); Entities.Add(copy.UUID, copy);
m_numPrim++;
copy.ScheduleGroupForFullUpdate(); copy.ScheduleGroupForFullUpdate();
} }
} }

View File

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

View File

@ -966,7 +966,6 @@ namespace OpenSim.Region.Environment.Scenes
// subscribe to physics events. // subscribe to physics events.
rootPart.DoPhysicsPropertyUpdate(UsePhysics, true); rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
} }
m_innerScene.AddAPrimCount();
} }
} }
@ -1162,19 +1161,24 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="agentID"></param> /// <param name="agentID"></param>
public override void RemoveClient(LLUUID agentID) public override void RemoveClient(LLUUID agentID)
{ {
m_eventManager.TriggerOnRemovePresence(agentID);
ScenePresence avatar = GetScenePresence(agentID); ScenePresence avatar = GetScenePresence(agentID);
try
if (avatar.IsChildAgent)
{ {
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) Broadcast(delegate(IClientAPI client)
{ {
try try