From 240712ca9fc726653e2a03b944baa8b6f8155b07 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Sat, 18 Aug 2007 22:09:07 +0000 Subject: Scripts are working again. Scripts are now loaded into limited AppDomains (no security yet). *phew* that only took me 12 hours of coding... --- .../DotNetEngine/Compiler/LSL/LSL_BaseClass.cs | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs') diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs index 84fa9eb..7334e6f 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs @@ -4,6 +4,8 @@ using System.Text; using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler; using OpenSim.Region.ScriptEngine.Common; using System.Threading; +using System.Reflection; + namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL { @@ -46,6 +48,33 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL return; } + public void ExecuteEvent(string FunctionName, object[] args) + { + //foreach (MemberInfo mi in this.GetType().GetMembers()) + //{ + //if (mi.ToString().ToLower().Contains("default")) + //{ + // Console.WriteLine("Member found: " + mi.ToString()); + //} + //} + + Type type = this.GetType(); + + Console.WriteLine("ScriptEngine Invoke: \"" + this.State() + "_event_" + FunctionName + "\""); + + try + { + type.InvokeMember(this.State() + "_event_" + FunctionName, BindingFlags.InvokeMethod, null, this, args); + } + catch (Exception e) + { + // TODO: Send to correct place + Console.WriteLine("ScriptEngine Exception attempting to executing script function: " + e.ToString()); + } + + + } + // -- cgit v1.1