From ed68a3894cc82e8e9bca6bcbf621c5297538c708 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Sat, 15 Sep 2007 14:22:38 +0000 Subject: Now loading "OpenSim.Region.ScriptEngine.Common.dll" into scripts AppDomain and "using OpenSim.Region.ScriptEngine.Common;" at start of script when converted from LSL. Vectors and rotations now works. --- OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs | 7 +++++-- .../ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | 11 ++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine') diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs index b0b4662..c26c54e 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs @@ -96,11 +96,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine AppDomainSetup ads = new AppDomainSetup(); ads.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory; ads.DisallowBindingRedirects = false; - ads.DisallowCodeDownload = true; + ads.DisallowCodeDownload = true; + ads.LoaderOptimization = LoaderOptimization.MultiDomain; // Sounds good ;) ads.ShadowCopyFiles = "true"; // Enabled shadowing ads.ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile; - AppDomain AD = AppDomain.CreateDomain("ScriptAppDomain_" + AppDomainNameCount, null, ads); + AppDomain AD = AppDomain.CreateDomain("ScriptAppDomain_" + AppDomainNameCount, null, ads); + Console.WriteLine("Loading: " + AssemblyName.GetAssemblyName("OpenSim.Region.ScriptEngine.Common.dll").ToString()); + AD.Load(AssemblyName.GetAssemblyName("OpenSim.Region.ScriptEngine.Common.dll")); // Return the new AppDomain return AD; diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs index c70448b..ec6b962 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs @@ -18,8 +18,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL dataTypes.Add("integer", "int"); dataTypes.Add("float", "double"); dataTypes.Add("string", "string"); - dataTypes.Add("key", "string"); - dataTypes.Add("vector", "LSL_Types.Vector3"); + dataTypes.Add("key", "string"); + dataTypes.Add("vector", "LSL_Types.Vector3"); dataTypes.Add("rotation", "LSL_Types.Quaternion"); dataTypes.Add("list", "list"); dataTypes.Add("null", "null"); @@ -225,9 +225,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL } - // Add namespace, class name and inheritance - - Return = "";// + + // Add namespace, class name and inheritance + + Return = "" + + "using OpenSim.Region.ScriptEngine.Common;"; //"using System; " + //"using System.Collections.Generic; " + //"using System.Text; " + -- cgit v1.1