aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands_TestImplementation.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs38
2 files changed, 21 insertions, 19 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands_TestImplementation.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands_TestImplementation.cs
index f107993..3a87fa9 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands_TestImplementation.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands_TestImplementation.cs
@@ -32,7 +32,7 @@ using System.Text;
32 32
33namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler 33namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
34{ 34{
35 public class LSL_BuiltIn_Commands_TestImplementation : LSL_BuiltIn_Commands_Interface 35 public class LSL_BuiltIn_Commands_TestImplementation //: LSL_BuiltIn_Commands_Interface
36 { 36 {
37 public LSL_BuiltIn_Commands_TestImplementation(string FullScriptID) 37 public LSL_BuiltIn_Commands_TestImplementation(string FullScriptID)
38 { 38 {
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
index 328f456..832807d 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
@@ -46,46 +46,46 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
46 46
47 47
48 // Object<string, Script<string, script>> 48 // Object<string, Script<string, script>>
49 internal Dictionary<string, Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass>> Scripts = new Dictionary<string, Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass>>(); 49 internal Dictionary<string, Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass>> Scripts = new Dictionary<string, Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass>>();
50 50
51 51
52 internal Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass>.KeyCollection GetScriptKeys(string ObjectID) 52 internal Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass>.KeyCollection GetScriptKeys(string ObjectID)
53 { 53 {
54 if (Scripts.ContainsKey(ObjectID) == false) 54 if (Scripts.ContainsKey(ObjectID) == false)
55 return null; 55 return null;
56 56
57 Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass> Obj; 57 Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass> Obj;
58 Scripts.TryGetValue(ObjectID, out Obj); 58 Scripts.TryGetValue(ObjectID, out Obj);
59 59
60 return Obj.Keys; 60 return Obj.Keys;
61 61
62 } 62 }
63 63
64 internal OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass GetScript(string ObjectID, string ScriptID) 64 internal OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass GetScript(string ObjectID, string ScriptID)
65 { 65 {
66 if (Scripts.ContainsKey(ObjectID) == false) 66 if (Scripts.ContainsKey(ObjectID) == false)
67 return null; 67 return null;
68 68
69 Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass> Obj; 69 Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass> Obj;
70 Scripts.TryGetValue(ObjectID, out Obj); 70 Scripts.TryGetValue(ObjectID, out Obj);
71 if (Obj.ContainsKey(ScriptID) == false) 71 if (Obj.ContainsKey(ScriptID) == false)
72 return null; 72 return null;
73 73
74 // Get script 74 // Get script
75 OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass Script; 75 OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script;
76 Obj.TryGetValue(ScriptID, out Script); 76 Obj.TryGetValue(ScriptID, out Script);
77 77
78 return Script; 78 return Script;
79 79
80 } 80 }
81 internal void SetScript(string ObjectID, string ScriptID, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass Script) 81 internal void SetScript(string ObjectID, string ScriptID, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script)
82 { 82 {
83 // Create object if it doesn't exist 83 // Create object if it doesn't exist
84 if (Scripts.ContainsKey(ObjectID) == false) 84 if (Scripts.ContainsKey(ObjectID) == false)
85 Scripts.Add(ObjectID, new Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass>()); 85 Scripts.Add(ObjectID, new Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass>());
86 86
87 // Delete script if it exists 87 // Delete script if it exists
88 Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass> Obj; 88 Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass> Obj;
89 Scripts.TryGetValue(ObjectID, out Obj); 89 Scripts.TryGetValue(ObjectID, out Obj);
90 if (Obj.ContainsKey(ScriptID) == true) 90 if (Obj.ContainsKey(ScriptID) == true)
91 Obj.Remove(ScriptID); 91 Obj.Remove(ScriptID);
@@ -114,11 +114,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
114 FileName = ScriptID; 114 FileName = ScriptID;
115 115
116 // * Does script need compile? Send it to LSL compiler first. (TODO: Use (and clean) compiler cache) 116 // * Does script need compile? Send it to LSL compiler first. (TODO: Use (and clean) compiler cache)
117 if (FileName.ToLower().EndsWith(".lso")) 117 if (FileName.ToLower().EndsWith(".lsl"))
118 { 118 {
119 Common.SendToDebug("ScriptManager Script is LSO, compiling to .Net Assembly"); 119 Common.SendToDebug("ScriptManager Script is LSL, compiling to .Net Assembly");
120 // Create a new instance of the compiler (currently we don't want reuse) 120 // Create a new instance of the compiler (currently we don't want reuse)
121 OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.Engine LSLCompiler = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.Engine(); 121 OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler LSLCompiler = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler();
122 // Compile 122 // Compile
123 FileName = LSLCompiler.Compile(FileName); 123 FileName = LSLCompiler.Compile(FileName);
124 } 124 }
@@ -130,17 +130,19 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
130 AppDomain FreeAppDomain = GetFreeAppDomain(); 130 AppDomain FreeAppDomain = GetFreeAppDomain();
131 131
132 // * Load and start script 132 // * Load and start script
133 OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName); 133 //OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName);
134 OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName);
134 string FullScriptID = ScriptID + "." + ObjectID; 135 string FullScriptID = ScriptID + "." + ObjectID;
135 // Add it to our temporary active script keeper 136 // Add it to our temporary active script keeper
136 //Scripts.Add(FullScriptID, Script); 137 //Scripts.Add(FullScriptID, Script);
137 SetScript(ObjectID, ScriptID, Script); 138 SetScript(ObjectID, ScriptID, Script);
138 // We need to give (untrusted) assembly a private instance of BuiltIns 139 // We need to give (untrusted) assembly a private instance of BuiltIns
139 // this private copy will contain Read-Only FullScriptID so that it can bring that on to the server whenever needed. 140 // this private copy will contain Read-Only FullScriptID so that it can bring that on to the server whenever needed.
140 OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL_BuiltIn_Commands_Interface LSLB = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL_BuiltIn_Commands_TestImplementation(FullScriptID); 141 //OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL_BuiltIn_Commands_Interface LSLB = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL_BuiltIn_Commands_TestImplementation(FullScriptID);
142
141 // Start the script - giving it BuiltIns 143 // Start the script - giving it BuiltIns
142 Common.SendToDebug("ScriptManager initializing script, handing over private builtin command interface"); 144 Common.SendToDebug("ScriptManager initializing script, handing over private builtin command interface");
143 Script.Start(LSLB); 145 Script.Start(myScriptEngine.World, ScriptID);
144 146
145 147
146 } 148 }
@@ -162,7 +164,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
162 /// <param name="FreeAppDomain">AppDomain to load script into</param> 164 /// <param name="FreeAppDomain">AppDomain to load script into</param>
163 /// <param name="FileName">FileName of script assembly (.dll)</param> 165 /// <param name="FileName">FileName of script assembly (.dll)</param>
164 /// <returns></returns> 166 /// <returns></returns>
165 private OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass LoadAndInitAssembly(AppDomain FreeAppDomain, string FileName) 167 private OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass LoadAndInitAssembly(AppDomain FreeAppDomain, string FileName)
166 { 168 {
167 Common.SendToDebug("ScriptManager Loading Assembly " + FileName); 169 Common.SendToDebug("ScriptManager Loading Assembly " + FileName);
168 // Load .Net Assembly (.dll) 170 // Load .Net Assembly (.dll)
@@ -201,7 +203,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
201 //{ 203 //{
202 //} 204 //}
203 205
204 return (OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass)Activator.CreateInstance(t); 206 return (OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass)Activator.CreateInstance(t);
205 207
206 208
207 } 209 }
@@ -209,7 +211,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
209 internal void ExecuteFunction(string ObjectID, string ScriptID, string FunctionName, object[] args) 211 internal void ExecuteFunction(string ObjectID, string ScriptID, string FunctionName, object[] args)
210 { 212 {
211 Common.SendToDebug("Executing Function ObjectID: " + ObjectID + ", ScriptID: " + ScriptID + ", FunctionName: " + FunctionName); 213 Common.SendToDebug("Executing Function ObjectID: " + ObjectID + ", ScriptID: " + ScriptID + ", FunctionName: " + FunctionName);
212 OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass Script = myScriptEngine.myScriptManager.GetScript(ObjectID, ScriptID); 214 OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script = myScriptEngine.myScriptManager.GetScript(ObjectID, ScriptID);
213 215
214 Type type = Script.GetType(); 216 Type type = Script.GetType();
215 //object o = (object)Script; 217 //object o = (object)Script;