aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2008-08-25 18:07:29 +0000
committerMelanie Thielker2008-08-25 18:07:29 +0000
commit24456e846c17d5590446e65f137a4f9b1f90bb14 (patch)
tree7b81abd5b1410679ea42418a01f056ebdb87438c
parentAdd ScriptDelayFactor under LL-Functions in OpenSim.ini. Defaulted (diff)
downloadopensim-SC_OLD-24456e846c17d5590446e65f137a4f9b1f90bb14.zip
opensim-SC_OLD-24456e846c17d5590446e65f137a4f9b1f90bb14.tar.gz
opensim-SC_OLD-24456e846c17d5590446e65f137a4f9b1f90bb14.tar.bz2
opensim-SC_OLD-24456e846c17d5590446e65f137a4f9b1f90bb14.tar.xz
Add the same delay factor in the XEngine section for the XEngine
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs20
-rw-r--r--bin/OpenSim.ini.example2
2 files changed, 20 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 26a52f2..c939f74 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -66,6 +66,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
66 internal LLUUID m_itemID; 66 internal LLUUID m_itemID;
67 internal bool throwErrorOnNotImplemented = true; 67 internal bool throwErrorOnNotImplemented = true;
68 internal AsyncCommandManager AsyncCommands = null; 68 internal AsyncCommandManager AsyncCommands = null;
69 internal float m_ScriptDelayFactor = 1.0f;
69 70
70 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID) 71 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID)
71 { 72 {
@@ -74,9 +75,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
74 m_localID = localID; 75 m_localID = localID;
75 m_itemID = itemID; 76 m_itemID = itemID;
76 77
78 IConfigSource config = new IniConfigSource(Application.iniFilePath);
79 if (config.Configs["XEngine"] == null)
80 config.AddConfig("XEngine");
81
82 m_ScriptDelayFactor = config.Configs["XEngine"].
83 GetFloat("ScriptDelayFactor", 1.0f);
84
77 AsyncCommands = (AsyncCommandManager)ScriptEngine.AsyncCommands; 85 AsyncCommands = (AsyncCommandManager)ScriptEngine.AsyncCommands;
78 } 86 }
79 87
88 private void ScriptSleep(int delay)
89 {
90 delay = (int)((float)delay * m_ScriptDelayFactor);
91 if (delay == 0)
92 return;
93 System.Threading.Thread.Sleep(delay);
94 }
95
80 private DateTime m_timer = DateTime.Now; 96 private DateTime m_timer = DateTime.Now;
81 private bool m_waitingForScriptAnswer=false; 97 private bool m_waitingForScriptAnswer=false;
82 98
@@ -2142,7 +2158,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2142 llApplyImpulse(new LSL_Types.Vector3(llvel.X * groupmass, llvel.Y * groupmass, llvel.Z * groupmass), 0); 2158 llApplyImpulse(new LSL_Types.Vector3(llvel.X * groupmass, llvel.Y * groupmass, llvel.Z * groupmass), 0);
2143 found = true; 2159 found = true;
2144 //script delay 2160 //script delay
2145 System.Threading.Thread.Sleep((int)((groupmass * velmag) / 10)); 2161 ScriptSleep((int)((groupmass * velmag) / 10));
2146 break; 2162 break;
2147 } 2163 }
2148 } 2164 }
@@ -2798,7 +2814,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2798 parentPrim.GetProperties(client); 2814 parentPrim.GetProperties(client);
2799 2815
2800 // sleep for 1 second 2816 // sleep for 1 second
2801 System.Threading.Thread.Sleep(1000); 2817 ScriptSleep(1000);
2802 2818
2803 } 2819 }
2804 2820
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index e4b9c51..43de20f 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -657,6 +657,8 @@ EventLimit = 30
657KillTimedOutScripts = false 657KillTimedOutScripts = false
658; Allow OS console command functionality (VERY DANGEROUS!!) 658; Allow OS console command functionality (VERY DANGEROUS!!)
659AllowosConsoleCommand = false 659AllowosConsoleCommand = false
660; Sets the multiplier for the scripting delays
661ScriptDelayFactor = 1.0
660 662
661 663
662[GridInfo] 664[GridInfo]