mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 08:06:27 +08:00
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:
@@ -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"));
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user