* A hacky Top Scripts display. It isn't accurate as far as ms accounting, however you can use it to help find out what scripts are causing your simulator to cry.

* Access it from the Estate tools/Debug tab.
This commit is contained in:
Teravus Ovares
2008-05-25 20:50:45 +00:00
parent 76a3bde76e
commit c20f7d6171
9 changed files with 123 additions and 13 deletions

View File

@@ -2752,6 +2752,14 @@ namespace OpenSim.Region.Environment.Scenes
PhysActor.OnCollisionUpdate -= PhysicsCollision;
}
}
if ((GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Scripted) != 0)
{
m_parentGroup.Scene.EventManager.OnScriptTimerEvent += handleTimerAccounting;
}
else
{
m_parentGroup.Scene.EventManager.OnScriptTimerEvent -= handleTimerAccounting;
}
LocalFlags=(LLObject.ObjectFlags)objectflagupdate;
@@ -2812,6 +2820,30 @@ namespace OpenSim.Region.Environment.Scenes
GetProperties(client);
m_updateFlag = 2;
}
private void handleTimerAccounting(uint localID, double interval)
{
if (localID == LocalId)
{
float sec = (float)interval;
if (m_parentGroup != null)
{
if (sec == 0)
{
if (m_parentGroup.scriptScore + 0.001f >= float.MaxValue - 0.001)
m_parentGroup.scriptScore = 0;
m_parentGroup.scriptScore += 0.001f;
return;
}
if (m_parentGroup.scriptScore + (0.001f / sec) >= float.MaxValue - (0.001f / sec))
m_parentGroup.scriptScore = 0;
m_parentGroup.scriptScore += (0.001f / sec);
}
}
}
}
}