diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 5b5cab8..5bff2e9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -106,6 +106,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
106 | protected IUrlModule m_UrlModule = null; | 106 | protected IUrlModule m_UrlModule = null; |
107 | protected Dictionary<UUID, UserInfoCacheEntry> m_userInfoCache = | 107 | protected Dictionary<UUID, UserInfoCacheEntry> m_userInfoCache = |
108 | new Dictionary<UUID, UserInfoCacheEntry>(); | 108 | new Dictionary<UUID, UserInfoCacheEntry>(); |
109 | protected int EMAIL_PAUSE_TIME = 20; // documented delay value for smtp. | ||
109 | 110 | ||
110 | public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item) | 111 | public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item) |
111 | { | 112 | { |
@@ -113,6 +114,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
113 | m_host = host; | 114 | m_host = host; |
114 | m_item = item; | 115 | m_item = item; |
115 | 116 | ||
117 | LoadLimits(); // read script limits from config. | ||
118 | |||
119 | m_TransferModule = | ||
120 | m_ScriptEngine.World.RequestModuleInterface<IMessageTransferModule>(); | ||
121 | m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>(); | ||
122 | |||
123 | AsyncCommands = new AsyncCommandManager(ScriptEngine); | ||
124 | } | ||
125 | |||
126 | /* load configuration items that affect script, object and run-time behavior. */ | ||
127 | private void LoadLimits() | ||
128 | { | ||
116 | m_ScriptDelayFactor = | 129 | m_ScriptDelayFactor = |
117 | m_ScriptEngine.Config.GetFloat("ScriptDelayFactor", 1.0f); | 130 | m_ScriptEngine.Config.GetFloat("ScriptDelayFactor", 1.0f); |
118 | m_ScriptDistanceFactor = | 131 | m_ScriptDistanceFactor = |
@@ -125,12 +138,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
125 | m_ScriptEngine.Config.GetInt("NotecardLineReadCharsMax", 255); | 138 | m_ScriptEngine.Config.GetInt("NotecardLineReadCharsMax", 255); |
126 | if (m_notecardLineReadCharsMax > 65535) | 139 | if (m_notecardLineReadCharsMax > 65535) |
127 | m_notecardLineReadCharsMax = 65535; | 140 | m_notecardLineReadCharsMax = 65535; |
128 | 141 | // load limits for particular subsystems. | |
129 | m_TransferModule = | 142 | IConfig SMTPConfig; |
130 | m_ScriptEngine.World.RequestModuleInterface<IMessageTransferModule>(); | 143 | if ((SMTPConfig = m_ScriptEngine.ConfigSource.Configs["SMTP"]) != null) { |
131 | m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>(); | 144 | // there's an smtp config, so load in the snooze time. |
132 | 145 | EMAIL_PAUSE_TIME = SMTPConfig.GetInt("email_pause_time", EMAIL_PAUSE_TIME); | |
133 | AsyncCommands = new AsyncCommandManager(ScriptEngine); | 146 | } |
134 | } | 147 | } |
135 | 148 | ||
136 | public override Object InitializeLifetimeService() | 149 | public override Object InitializeLifetimeService() |
@@ -2877,6 +2890,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2877 | 2890 | ||
2878 | public virtual void llSleep(double sec) | 2891 | public virtual void llSleep(double sec) |
2879 | { | 2892 | { |
2893 | // m_log.Info("llSleep snoozing " + sec + "s."); | ||
2880 | m_host.AddScriptLPS(1); | 2894 | m_host.AddScriptLPS(1); |
2881 | Thread.Sleep((int)(sec * 1000)); | 2895 | Thread.Sleep((int)(sec * 1000)); |
2882 | } | 2896 | } |
@@ -3130,7 +3144,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3130 | } | 3144 | } |
3131 | 3145 | ||
3132 | emailModule.SendEmail(m_host.UUID, address, subject, message); | 3146 | emailModule.SendEmail(m_host.UUID, address, subject, message); |
3133 | ScriptSleep(20000); | 3147 | llSleep(EMAIL_PAUSE_TIME); |
3134 | } | 3148 | } |
3135 | 3149 | ||
3136 | public void llGetNextEmail(string address, string subject) | 3150 | public void llGetNextEmail(string address, string subject) |