From 1602ba61759ce90c38a589d017108c132881d953 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 21 Sep 2008 22:16:17 +0000 Subject: Allows to use the new script engine feature. Begin your script with //XEngine: or //DotNetEnine: , optionally followed by a language like //XEngine:lsl, and it will be run on the chosen engine. --- .../Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs | 9 +++++++++ OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 9 +++++++++ 2 files changed, 18 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs index 4a4e808..9999d9c 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs @@ -194,6 +194,15 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine) { + if (script.Length > 15) + { + if (script.Substring(0, 15) == "//DotNetEngine:") + { + script = "//" + script.Substring(15); + engine = "DotNetEngine"; + } + } + if (engine != "DotNetEngine") return; diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index c72d281..161fd8c 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -341,6 +341,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine) { + if (script.Length > 10) + { + if (script.Substring(0, 10) == "//XEngine:") + { + script = "//" + script.Substring(10); + engine = "XEngine"; + } + } + if (engine != "XEngine") return; -- cgit v1.1