aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-05-25 20:50:45 +0000
committerTeravus Ovares2008-05-25 20:50:45 +0000
commitc20f7d6171a9df151c3ccde063336338da9ae322 (patch)
treea6093b52da4093e3b692771a421ce4a55052d24b /OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
parentThank you very much, Melanie for a patch that: (diff)
downloadopensim-SC_OLD-c20f7d6171a9df151c3ccde063336338da9ae322.zip
opensim-SC_OLD-c20f7d6171a9df151c3ccde063336338da9ae322.tar.gz
opensim-SC_OLD-c20f7d6171a9df151c3ccde063336338da9ae322.tar.bz2
opensim-SC_OLD-c20f7d6171a9df151c3ccde063336338da9ae322.tar.xz
* 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.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs32
1 files changed, 32 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index b724bda..c6b3059 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -2752,6 +2752,14 @@ namespace OpenSim.Region.Environment.Scenes
2752 PhysActor.OnCollisionUpdate -= PhysicsCollision; 2752 PhysActor.OnCollisionUpdate -= PhysicsCollision;
2753 } 2753 }
2754 } 2754 }
2755 if ((GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Scripted) != 0)
2756 {
2757 m_parentGroup.Scene.EventManager.OnScriptTimerEvent += handleTimerAccounting;
2758 }
2759 else
2760 {
2761 m_parentGroup.Scene.EventManager.OnScriptTimerEvent -= handleTimerAccounting;
2762 }
2755 2763
2756 LocalFlags=(LLObject.ObjectFlags)objectflagupdate; 2764 LocalFlags=(LLObject.ObjectFlags)objectflagupdate;
2757 2765
@@ -2812,6 +2820,30 @@ namespace OpenSim.Region.Environment.Scenes
2812 GetProperties(client); 2820 GetProperties(client);
2813 m_updateFlag = 2; 2821 m_updateFlag = 2;
2814 } 2822 }
2823 private void handleTimerAccounting(uint localID, double interval)
2824 {
2825 if (localID == LocalId)
2826 {
2827
2828 float sec = (float)interval;
2829 if (m_parentGroup != null)
2830 {
2831 if (sec == 0)
2832 {
2833 if (m_parentGroup.scriptScore + 0.001f >= float.MaxValue - 0.001)
2834 m_parentGroup.scriptScore = 0;
2835
2836 m_parentGroup.scriptScore += 0.001f;
2837 return;
2838 }
2839
2840 if (m_parentGroup.scriptScore + (0.001f / sec) >= float.MaxValue - (0.001f / sec))
2841 m_parentGroup.scriptScore = 0;
2842 m_parentGroup.scriptScore += (0.001f / sec);
2843 }
2844
2845 }
2846 }
2815 2847
2816 } 2848 }
2817} 2849}