Scripts are working again. Scripts are now loaded into limited AppDomains (no security yet).

*phew* that only took me 12 hours of coding...
This commit is contained in:
Tedd Hansen
2007-08-18 22:09:07 +00:00
parent 6faa8d8d68
commit 240712ca9f
4 changed files with 99 additions and 54 deletions

View File

@@ -61,7 +61,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
string rootPath = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory);
string rootPathSE = Path.GetDirectoryName(this.GetType().Assembly.Location);
Console.WriteLine("Assembly location: " + rootPath);
//Console.WriteLine("Assembly location: " + rootPath);
parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Common.dll"));
parameters.ReferencedAssemblies.Add(Path.Combine(rootPathSE, "OpenSim.Region.ScriptEngine.DotNetEngine.dll"));

View File

@@ -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());
}
}
//