aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs15
1 files changed, 10 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
index 2de4e62..8b5e3e3 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
@@ -31,6 +31,7 @@ using System.Collections.Generic;
31using System.Text; 31using System.Text;
32using System.Threading; 32using System.Threading;
33using System.Reflection; 33using System.Reflection;
34using OpenSim.Region.Environment.Scenes.Scripting;
34 35
35namespace OpenSim.Region.ScriptEngine.DotNetEngine 36namespace OpenSim.Region.ScriptEngine.DotNetEngine
36{ 37{
@@ -148,10 +149,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
148 // * Find next available AppDomain to put it in 149 // * Find next available AppDomain to put it in
149 AppDomain FreeAppDomain = GetFreeAppDomain(); 150 AppDomain FreeAppDomain = GetFreeAppDomain();
150 151
151 // * Load and start script 152 // * Load and start script, for now with dummy host
153
152 //OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName); 154 //OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName);
153 OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName); 155 OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName, new NullScriptHost() );
154 string FullScriptID = ScriptID + "." + ObjectID; 156 string FullScriptID = ScriptID + "." + ObjectID;
155 // Add it to our temporary active script keeper 157 // Add it to our temporary active script keeper
156 //Scripts.Add(FullScriptID, Script); 158 //Scripts.Add(FullScriptID, Script);
157 SetScript(ObjectID, ScriptID, Script); 159 SetScript(ObjectID, ScriptID, Script);
@@ -161,6 +163,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
161 163
162 // Start the script - giving it BuiltIns 164 // Start the script - giving it BuiltIns
163 //myScriptEngine.m_logger.Verbose("ScriptEngine", "ScriptManager initializing script, handing over private builtin command interface"); 165 //myScriptEngine.m_logger.Verbose("ScriptEngine", "ScriptManager initializing script, handing over private builtin command interface");
166
164 Script.Start(myScriptEngine.World, ScriptID); 167 Script.Start(myScriptEngine.World, ScriptID);
165 168
166 } 169 }
@@ -189,7 +192,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
189 /// <param name="FreeAppDomain">AppDomain to load script into</param> 192 /// <param name="FreeAppDomain">AppDomain to load script into</param>
190 /// <param name="FileName">FileName of script assembly (.dll)</param> 193 /// <param name="FileName">FileName of script assembly (.dll)</param>
191 /// <returns></returns> 194 /// <returns></returns>
192 private OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass LoadAndInitAssembly(AppDomain FreeAppDomain, string FileName) 195 private OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass LoadAndInitAssembly(AppDomain FreeAppDomain, string FileName, IScriptHost host)
193 { 196 {
194 //myScriptEngine.m_logger.Verbose("ScriptEngine", "ScriptManager Loading Assembly " + FileName); 197 //myScriptEngine.m_logger.Verbose("ScriptEngine", "ScriptManager Loading Assembly " + FileName);
195 // Load .Net Assembly (.dll) 198 // Load .Net Assembly (.dll)
@@ -228,7 +231,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
228 //{ 231 //{
229 //} 232 //}
230 233
231 return (OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass)Activator.CreateInstance(t); 234 object[] args = new object[] { host };
235
236 return (OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass)Activator.CreateInstance(t, args );
232 237
233 238
234 } 239 }