diff options
author | Tedd Hansen | 2007-08-18 19:54:04 +0000 |
---|---|---|
committer | Tedd Hansen | 2007-08-18 19:54:04 +0000 |
commit | 1d41fd4984308a4b811f40aca18a90a79f243020 (patch) | |
tree | 8752672490125f9809e3801088a7a53b74103432 /OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs | |
parent | Moved LSL_BuiltIn_Commands_Interface.cs to a separate library (OpenSim.Region... (diff) | |
download | opensim-SC-1d41fd4984308a4b811f40aca18a90a79f243020.zip opensim-SC-1d41fd4984308a4b811f40aca18a90a79f243020.tar.gz opensim-SC-1d41fd4984308a4b811f40aca18a90a79f243020.tar.bz2 opensim-SC-1d41fd4984308a4b811f40aca18a90a79f243020.tar.xz |
Working on AppDomains. Scripting is now officially broken. :]
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs index 1d2689d..2cbdfd3 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs | |||
@@ -65,6 +65,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
65 | 65 | ||
66 | 66 | ||
67 | // Object<string, Script<string, script>> | 67 | // Object<string, Script<string, script>> |
68 | // IMPORTANT: Types and MemberInfo-derived objects require a LOT of memory. | ||
69 | // Instead use RuntimeTypeHandle, RuntimeFieldHandle and RunTimeHandle (IntPtr) instead! | ||
68 | internal Dictionary<IScriptHost, Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass>> Scripts = new Dictionary<IScriptHost, Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass>>(); | 70 | internal Dictionary<IScriptHost, Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass>> Scripts = new Dictionary<IScriptHost, Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass>>(); |
69 | public Scene World | 71 | public Scene World |
70 | { | 72 | { |
@@ -221,23 +223,18 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
221 | /// <returns></returns> | 223 | /// <returns></returns> |
222 | private OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass LoadAndInitAssembly(AppDomain FreeAppDomain, string FileName, IScriptHost host) | 224 | private OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass LoadAndInitAssembly(AppDomain FreeAppDomain, string FileName, IScriptHost host) |
223 | { | 225 | { |
224 | //object[] ADargs = new object[] | ||
225 | // { | ||
226 | // this, | ||
227 | // host | ||
228 | // }; | ||
229 | 226 | ||
230 | ////LSL_BaseClass mbrt = (LSL_BaseClass)FreeAppDomain.CreateInstanceAndUnwrap(FileName, "SecondLife.Script"); | 227 | //LSL_BaseClass mbrt = (LSL_BaseClass)FreeAppDomain.CreateInstanceAndUnwrap(FileName, "SecondLife.Script"); |
231 | //Console.WriteLine("Base directory: " + AppDomain.CurrentDomain.BaseDirectory); | 228 | Console.WriteLine("Base directory: " + AppDomain.CurrentDomain.BaseDirectory); |
232 | 229 | ||
233 | //LSL_BaseClass mbrt = (LSL_BaseClass)FreeAppDomain.CreateInstanceFromAndUnwrap(FileName, "SecondLife.Script"); | 230 | LSL_BaseClass mbrt = (LSL_BaseClass)FreeAppDomain.CreateInstanceFromAndUnwrap(FileName, "SecondLife.Script"); |
234 | //Type mytype = mbrt.GetType(); | 231 | Type mytype = mbrt.GetType(); |
235 | 232 | ||
236 | //Console.WriteLine("is proxy={0}", RemotingServices.IsTransparentProxy(mbrt)); | 233 | Console.WriteLine("is proxy={0}", RemotingServices.IsTransparentProxy(mbrt)); |
237 | 234 | ||
238 | 235 | ||
239 | ////mbrt.Start(); | 236 | //mbrt.Start(); |
240 | //return mbrt; | 237 | return mbrt; |
241 | 238 | ||
242 | 239 | ||
243 | 240 | ||
@@ -301,11 +298,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
301 | Type type = Script.GetType(); | 298 | Type type = Script.GetType(); |
302 | 299 | ||
303 | 300 | ||
304 | m_scriptEngine.Log.Verbose("ScriptEngine", "Invoke: \"" + Script.State + "_event_" + FunctionName + "\""); | 301 | m_scriptEngine.Log.Verbose("ScriptEngine", "Invoke: \"" + Script.State() + "_event_" + FunctionName + "\""); |
305 | 302 | ||
306 | try | 303 | try |
307 | { | 304 | { |
308 | type.InvokeMember(Script.State + "_event_" + FunctionName, BindingFlags.InvokeMethod, null, Script, args); | 305 | type.InvokeMember(Script.State() + "_event_" + FunctionName, BindingFlags.InvokeMethod, null, Script, args); |
309 | } | 306 | } |
310 | catch (Exception e) | 307 | catch (Exception e) |
311 | { | 308 | { |