From 402ff75d781d6f4e38eee8884d7b4411bb756c9b Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Thu, 15 Mar 2012 13:16:02 -0700 Subject: Adds a new script command 'modInvoke' to invoke registered functions from region modules. The LSL translator is extended to generate the modInvoke format of commands for directly inlined function calls. A region module can register a function Test() with the name "Test". LSL code can call that function as "Test()". The compiler will translate that invocation into modInvoke("Test", ...) --- OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs') diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index c10143b..8f2ec49 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs @@ -35,6 +35,7 @@ using Microsoft.CSharp; //using Microsoft.JScript; using Microsoft.VisualBasic; using log4net; + using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.ScriptEngine.Interfaces; using OpenMetaverse; @@ -293,6 +294,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools { // m_log.DebugFormat("[Compiler]: Compiling script\n{0}", Script); + IScriptModuleComms comms = m_scriptEngine.World.RequestModuleInterface(); + linemap = null; m_warnings.Clear(); @@ -382,7 +385,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools if (language == enumCompileType.lsl) { // Its LSL, convert it to C# - LSL_Converter = (ICodeConverter)new CSCodeGenerator(); + LSL_Converter = (ICodeConverter)new CSCodeGenerator(comms); compileScript = LSL_Converter.Convert(Script); // copy converter warnings into our warnings. -- cgit v1.1