aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 62eb7f7..1f60a7b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -33,6 +33,7 @@ using System.Runtime.Remoting.Lifetime;
33using System.Text; 33using System.Text;
34using System.Threading; 34using System.Threading;
35using System.Text.RegularExpressions; 35using System.Text.RegularExpressions;
36using System.Timers;
36using Nini.Config; 37using Nini.Config;
37using log4net; 38using log4net;
38using OpenMetaverse; 39using OpenMetaverse;
@@ -66,6 +67,7 @@ using LSL_Rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion;
66using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString; 67using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
67using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3; 68using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
68using System.Reflection; 69using System.Reflection;
70using Timer = System.Timers.Timer;
69 71
70namespace OpenSim.Region.ScriptEngine.Shared.Api 72namespace OpenSim.Region.ScriptEngine.Shared.Api
71{ 73{
@@ -105,8 +107,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
105 protected Dictionary<UUID, UserInfoCacheEntry> m_userInfoCache = 107 protected Dictionary<UUID, UserInfoCacheEntry> m_userInfoCache =
106 new Dictionary<UUID, UserInfoCacheEntry>(); 108 new Dictionary<UUID, UserInfoCacheEntry>();
107 109
110 protected Timer m_ShoutSayTimer;
111 protected int m_SayShoutCount = 0;
112
108 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID) 113 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID)
109 { 114 {
115 m_ShoutSayTimer = new Timer(1000);
116 m_ShoutSayTimer.Elapsed += SayShoutTimerElapsed;
117 m_ShoutSayTimer.AutoReset = true;
118 m_ShoutSayTimer.Start();
119
110 m_ScriptEngine = ScriptEngine; 120 m_ScriptEngine = ScriptEngine;
111 m_host = host; 121 m_host = host;
112 m_localID = localID; 122 m_localID = localID;
@@ -883,6 +893,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
883 { 893 {
884 m_host.AddScriptLPS(1); 894 m_host.AddScriptLPS(1);
885 895
896 if (channelID == 0)
897 m_SayShoutCount++;
898
899 if (m_SayShoutCount >= 11)
900 ScriptSleep(2000);
901
886 if (m_scriptConsoleChannelEnabled && (channelID == m_scriptConsoleChannel)) 902 if (m_scriptConsoleChannelEnabled && (channelID == m_scriptConsoleChannel))
887 { 903 {
888 Console.WriteLine(text); 904 Console.WriteLine(text);
@@ -905,6 +921,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
905 { 921 {
906 m_host.AddScriptLPS(1); 922 m_host.AddScriptLPS(1);
907 923
924 if (channelID == 0)
925 m_SayShoutCount++;
926
927 if (m_SayShoutCount >= 11)
928 ScriptSleep(2000);
929
908 if (text.Length > 1023) 930 if (text.Length > 1023)
909 text = text.Substring(0, 1023); 931 text = text.Substring(0, 1023);
910 932
@@ -10972,6 +10994,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10972 10994
10973 return rq.ToString(); 10995 return rq.ToString();
10974 } 10996 }
10997
10998 private void SayShoutTimerElapsed(Object sender, ElapsedEventArgs args)
10999 {
11000 m_SayShoutCount = 0;
11001 }
10975 } 11002 }
10976 11003
10977 public class NotecardCache 11004 public class NotecardCache