aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation
diff options
context:
space:
mode:
authorMelanie2012-07-11 14:27:33 +0100
committerMelanie2012-07-11 14:27:33 +0100
commit89c9528e38b4e06a2af6231ced4ed733bbafa174 (patch)
treeaed380f4bc51d9102e593446762f476694b9d87c /OpenSim/Region/ScriptEngine/Shared/Api/Implementation
parentMerge branch 'master' into careminster (diff)
parent remove expensive and leaked ( in Xengine at least) SayShout timer and (diff)
downloadopensim-SC-89c9528e38b4e06a2af6231ced4ed733bbafa174.zip
opensim-SC-89c9528e38b4e06a2af6231ced4ed733bbafa174.tar.gz
opensim-SC-89c9528e38b4e06a2af6231ced4ed733bbafa174.tar.bz2
opensim-SC-89c9528e38b4e06a2af6231ced4ed733bbafa174.tar.xz
Merge branch 'avination' into careminster
Conflicts: OpenSim/Data/MySQL/MySQLSimulationData.cs
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs33
1 files changed, 25 insertions, 8 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index b257cd4..e9db5d5 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -113,8 +113,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
113 new Dictionary<UUID, UserInfoCacheEntry>(); 113 new Dictionary<UUID, UserInfoCacheEntry>();
114 protected int EMAIL_PAUSE_TIME = 20; // documented delay value for smtp. 114 protected int EMAIL_PAUSE_TIME = 20; // documented delay value for smtp.
115 115
116 protected Timer m_ShoutSayTimer; 116// protected Timer m_ShoutSayTimer;
117 protected int m_SayShoutCount = 0; 117 protected int m_SayShoutCount = 0;
118 DateTime m_lastSayShoutCheck;
118 119
119 private Dictionary<string, string> MovementAnimationsForLSL = 120 private Dictionary<string, string> MovementAnimationsForLSL =
120 new Dictionary<string, string> { 121 new Dictionary<string, string> {
@@ -140,10 +141,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
140 141
141 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item) 142 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item)
142 { 143 {
144/*
143 m_ShoutSayTimer = new Timer(1000); 145 m_ShoutSayTimer = new Timer(1000);
144 m_ShoutSayTimer.Elapsed += SayShoutTimerElapsed; 146 m_ShoutSayTimer.Elapsed += SayShoutTimerElapsed;
145 m_ShoutSayTimer.AutoReset = true; 147 m_ShoutSayTimer.AutoReset = true;
146 m_ShoutSayTimer.Start(); 148 m_ShoutSayTimer.Start();
149*/
150 m_lastSayShoutCheck = DateTime.UtcNow;
147 151
148 m_ScriptEngine = ScriptEngine; 152 m_ScriptEngine = ScriptEngine;
149 m_host = host; 153 m_host = host;
@@ -858,12 +862,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
858 wComm.DeliverMessage(ChatTypeEnum.Whisper, channelID, m_host.Name, m_host.UUID, text); 862 wComm.DeliverMessage(ChatTypeEnum.Whisper, channelID, m_host.Name, m_host.UUID, text);
859 } 863 }
860 864
865 private void CheckSayShoutTime()
866 {
867 DateTime now = DateTime.UtcNow;
868 if ((now - m_lastSayShoutCheck).Ticks > 10000000) // 1sec
869 {
870 m_lastSayShoutCheck = now;
871 m_SayShoutCount = 0;
872 }
873 else
874 m_SayShoutCount++;
875 }
876
861 public void llSay(int channelID, string text) 877 public void llSay(int channelID, string text)
862 { 878 {
863 m_host.AddScriptLPS(1); 879 m_host.AddScriptLPS(1);
864 880
865 if (channelID == 0) 881 if (channelID == 0)
866 m_SayShoutCount++; 882// m_SayShoutCount++;
883 CheckSayShoutTime();
867 884
868 if (m_SayShoutCount >= 11) 885 if (m_SayShoutCount >= 11)
869 ScriptSleep(2000); 886 ScriptSleep(2000);
@@ -891,7 +908,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
891 m_host.AddScriptLPS(1); 908 m_host.AddScriptLPS(1);
892 909
893 if (channelID == 0) 910 if (channelID == 0)
894 m_SayShoutCount++; 911// m_SayShoutCount++;
912 CheckSayShoutTime();
895 913
896 if (m_SayShoutCount >= 11) 914 if (m_SayShoutCount >= 11)
897 ScriptSleep(2000); 915 ScriptSleep(2000);
@@ -2556,12 +2574,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2556 return new LSL_Vector(m_host.Acceleration.X, m_host.Acceleration.Y, m_host.Acceleration.Z); 2574 return new LSL_Vector(m_host.Acceleration.X, m_host.Acceleration.Y, m_host.Acceleration.Z);
2557 } 2575 }
2558 2576
2559
2560 public void llSetAngularVelocity(LSL_Vector avel, int local) 2577 public void llSetAngularVelocity(LSL_Vector avel, int local)
2561 { 2578 {
2562 m_host.AddScriptLPS(1); 2579 m_host.AddScriptLPS(1);
2563 // Still not done !!!! 2580 m_host.SetAngularVelocity(new Vector3((float)avel.x, (float)avel.y, (float)avel.z), local != 0);
2564// m_host.SetAngularVelocity(new Vector3((float)avel.x, (float)avel.y, (float)avel.z), local != 0);
2565 } 2581 }
2566 2582
2567 public LSL_Vector llGetOmega() 2583 public LSL_Vector llGetOmega()
@@ -3671,6 +3687,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3671 3687
3672 protected void TargetOmega(SceneObjectPart part, LSL_Vector axis, double spinrate, double gain) 3688 protected void TargetOmega(SceneObjectPart part, LSL_Vector axis, double spinrate, double gain)
3673 { 3689 {
3690 spinrate *= gain;
3674 part.UpdateAngularVelocity(new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate))); 3691 part.UpdateAngularVelocity(new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)));
3675 } 3692 }
3676 3693
@@ -12044,12 +12061,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
12044 12061
12045 return rq.ToString(); 12062 return rq.ToString();
12046 } 12063 }
12047 12064/*
12048 private void SayShoutTimerElapsed(Object sender, ElapsedEventArgs args) 12065 private void SayShoutTimerElapsed(Object sender, ElapsedEventArgs args)
12049 { 12066 {
12050 m_SayShoutCount = 0; 12067 m_SayShoutCount = 0;
12051 } 12068 }
12052 12069*/
12053 private struct Tri 12070 private struct Tri
12054 { 12071 {
12055 public Vector3 p1; 12072 public Vector3 p1;