From f11107821e259d544dc42648f4cdba2b123cd71e Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 25 Sep 2008 17:26:32 +0000 Subject: Add an extension to allow registering multiple interfaces of a type with Scene. Make the script engines check that the engine name in the //Engine:language comment is a valid engine and treat it as a normal comment if it's not. //DotNetEngine: needs to be written as //ScriptEngine.DotNetEngine: now, since that is it's real internal name. //XEngine: still works --- .../ScriptEngine/Common/ScriptEngineBase/EventManager.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs') diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs index c8c9cd8..0308169 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs @@ -215,6 +215,12 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine) { + List engines = new List(myScriptEngine.World.RequestModuleInterfaces()); + + List names = new List(); + foreach (IScriptModule m in engines) + names.Add(m.ScriptEngineName); + int lineEnd = script.IndexOf('\n'); if (lineEnd != 1) @@ -224,8 +230,13 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase int colon = firstline.IndexOf(':'); if (firstline.Length > 2 && firstline.Substring(0, 2) == "//" && colon != -1) { - engine = firstline.Substring(2, colon-2); - script = "//" + script.Substring(script.IndexOf(':')+1); + string engineName = firstline.Substring(2, colon-2); + + if (names.Contains(engineName)) + { + engine = engineName; + script = "//" + script.Substring(script.IndexOf(':')+1); + } } } -- cgit v1.1