mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
* 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:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user