From 527b5f86a2442162f9cf1daf3ebd9129fabdea22 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Sun, 30 Dec 2007 16:34:54 +0000 Subject: [PATCH] In this commit I am using an editor feature called "Save All" before I commit. --- OpenSim/Region/ScriptEngine/Common/LSL_Types.cs | 3 +++ .../ScriptEngine/DotNetEngine/AppDomainManager.cs | 12 ++++++++++++ OpenSim/Region/ScriptEngine/DotNetEngine/Common.cs | 2 ++ .../DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | 4 ++++ .../Region/ScriptEngine/DotNetEngine/ScriptEngine.cs | 3 ++- 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs index e4c1229db0..4e3296c16a 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs @@ -33,6 +33,9 @@ namespace OpenSim.Region.ScriptEngine.Common [Serializable] public class LSL_Types { + + // Types are kept is separate .dll to avoid having to add whatever .dll it is in it to script AppDomain + [Serializable] public struct Vector3 { diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs index bc241ce46e..66153a7f64 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs @@ -36,6 +36,18 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine { public class AppDomainManager { + + // + // This class does AppDomain handling and loading/unloading of scripts in it. + // It is instanced in "ScriptEngine" and controlled from "ScriptManager" + // + // 1. Create a new AppDomain if old one is full (or doesn't exist) + // 2. Load scripts into AppDomain + // 3. Unload scripts from AppDomain (stopping them and marking them as inactive) + // 4. Unload AppDomain completely when all scripts in it has stopped + // + + private int maxScriptsPerAppDomain = 1; /// diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Common.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Common.cs index 4594ad8e38..db9a5359de 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Common.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Common.cs @@ -33,6 +33,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine public static bool debug = true; public static ScriptEngine mySE; + // This class just contains some static log stuff used for debugging. + //public delegate void SendToDebugEventDelegate(string Message); //public delegate void SendToLogEventDelegate(string Message); //static public event SendToDebugEventDelegate SendToDebugEvent; diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs index 8e377985e5..dfdf8f470d 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs @@ -33,6 +33,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL { public class LSL2CSConverter { + + + // Uses regex to convert LSL code to C# code. + //private Regex rnw = new Regex(@"[a-zA-Z0-9_\-]", RegexOptions.Compiled); private Dictionary dataTypes = new Dictionary(); private Dictionary quotes = new Dictionary(); diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs index 82049f7fa2..fabce6a77d 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs @@ -35,8 +35,9 @@ using OpenSim.Region.Environment.Scenes; namespace OpenSim.Region.ScriptEngine.DotNetEngine { /// - /// This is the root object for ScriptEngine + /// This is the root object for ScriptEngine. Objects access each other trough this class. /// + /// [Serializable] public class ScriptEngine : IRegionModule {