diff options
author | Melanie Thielker | 2008-09-22 02:11:40 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-09-22 02:11:40 +0000 |
commit | 79ac01fb0c33fc318b6a2d5a56fbfaeca7ad1043 (patch) | |
tree | d7d7ccdd382195b9acd614bfd2a357c4fb4cced0 /OpenSim/Region/ScriptEngine/Common/ScriptEngineBase | |
parent | Allows to use the new script engine feature. Begin your script with (diff) | |
download | opensim-SC-79ac01fb0c33fc318b6a2d5a56fbfaeca7ad1043.zip opensim-SC-79ac01fb0c33fc318b6a2d5a56fbfaeca7ad1043.tar.gz opensim-SC-79ac01fb0c33fc318b6a2d5a56fbfaeca7ad1043.tar.bz2 opensim-SC-79ac01fb0c33fc318b6a2d5a56fbfaeca7ad1043.tar.xz |
Prevent scripts from running under multiple engines at once
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/ScriptEngineBase')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs index 9999d9c..04fe4cd 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs | |||
@@ -194,12 +194,16 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
194 | 194 | ||
195 | public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine) | 195 | public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine) |
196 | { | 196 | { |
197 | if (script.Length > 15) | 197 | int lineEnd = script.IndexOf('\n'); |
198 | |||
199 | if (lineEnd != 1) | ||
198 | { | 200 | { |
199 | if (script.Substring(0, 15) == "//DotNetEngine:") | 201 | string firstline = script.Substring(0, lineEnd).Trim(); |
202 | |||
203 | int colon = firstline.IndexOf(':'); | ||
204 | if (firstline.Length > 2 && firstline.Substring(0, 2) == "//" && colon != -1) | ||
200 | { | 205 | { |
201 | script = "//" + script.Substring(15); | 206 | engine = firstline.Substring(2, colon-2); |
202 | engine = "DotNetEngine"; | ||
203 | } | 207 | } |
204 | } | 208 | } |
205 | 209 | ||