aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/DotNetEngine
diff options
context:
space:
mode:
authorMelanie Thielker2008-09-26 15:34:23 +0000
committerMelanie Thielker2008-09-26 15:34:23 +0000
commit12a6b7c835cae71e87352a48087c253e8c147c38 (patch)
tree52b9d26b7cb62e0b1ae1a6a6f5db42dabe511899 /OpenSim/Region/ScriptEngine/DotNetEngine
parent* minor: fix lolbug in RestInventoryService spotted by jhurliman (diff)
downloadopensim-SC_OLD-12a6b7c835cae71e87352a48087c253e8c147c38.zip
opensim-SC_OLD-12a6b7c835cae71e87352a48087c253e8c147c38.tar.gz
opensim-SC_OLD-12a6b7c835cae71e87352a48087c253e8c147c38.tar.bz2
opensim-SC_OLD-12a6b7c835cae71e87352a48087c253e8c147c38.tar.xz
Yay! Common/ is gone! One API is achieved!
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs3
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs41
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs9
4 files changed, 22 insertions, 33 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs
index e32c342..e37b18e 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs
@@ -29,7 +29,8 @@ using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Reflection; 31using System.Reflection;
32using OpenSim.Region.ScriptEngine.Common; 32using OpenSim.Region.ScriptEngine.Interfaces;
33using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
33 34
34namespace OpenSim.Region.ScriptEngine.DotNetEngine 35namespace OpenSim.Region.ScriptEngine.DotNetEngine
35{ 36{
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
index 4cb74fa..4adedc3 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
@@ -217,23 +217,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
217 217
218 } 218 }
219 219
220 ////private ICodeCompiler icc = codeProvider.CreateCompiler();
221 //public string CompileFromFile(string LSOFileName)
222 //{
223 // switch (Path.GetExtension(LSOFileName).ToLower())
224 // {
225 // case ".txt":
226 // case ".lsl":
227 // Common.ScriptEngineBase.Common.SendToDebug("Source code is LSL, converting to CS");
228 // return CompileFromLSLText(File.ReadAllText(LSOFileName));
229 // case ".cs":
230 // Common.ScriptEngineBase.Common.SendToDebug("Source code is CS");
231 // return CompileFromCSText(File.ReadAllText(LSOFileName));
232 // default:
233 // throw new Exception("Unknown script type.");
234 // }
235 //}
236
237 /// <summary> 220 /// <summary>
238 /// Converts script from LSL to CS and calls CompileFromCSText 221 /// Converts script from LSL to CS and calls CompileFromCSText
239 /// </summary> 222 /// </summary>
@@ -332,9 +315,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
332 private static string CreateJSCompilerScript(string compileScript) 315 private static string CreateJSCompilerScript(string compileScript)
333 { 316 {
334 compileScript = String.Empty + 317 compileScript = String.Empty +
335 "import OpenSim.Region.ScriptEngine.Common; import OpenSim.Region.ScriptEngine.Shared; import System.Collections.Generic;\r\n" + 318 "import OpenSim.Region.ScriptEngine.Shared; import System.Collections.Generic;\r\n" +
336 "package SecondLife {\r\n" + 319 "package SecondLife {\r\n" +
337 "class Script extends OpenSim.Region.ScriptEngine.Common.ScriptBaseClass { \r\n" + 320 "class Script extends OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass { \r\n" +
338 compileScript + 321 compileScript +
339 "} }\r\n"; 322 "} }\r\n";
340 return compileScript; 323 return compileScript;
@@ -343,9 +326,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
343 private static string CreateCSCompilerScript(string compileScript) 326 private static string CreateCSCompilerScript(string compileScript)
344 { 327 {
345 compileScript = String.Empty + 328 compileScript = String.Empty +
346 "using OpenSim.Region.ScriptEngine.Common; using OpenSim.Region.ScriptEngine.Shared; using System.Collections.Generic;\r\n" + 329 "using OpenSim.Region.ScriptEngine.Shared; using System.Collections.Generic;\r\n" +
347 String.Empty + "namespace SecondLife { " + 330 String.Empty + "namespace SecondLife { " +
348 String.Empty + "public class Script : OpenSim.Region.ScriptEngine.Common.ScriptBaseClass { \r\n" + 331 String.Empty + "public class Script : OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass { \r\n" +
349 @"public Script() { } " + 332 @"public Script() { } " +
350 compileScript + 333 compileScript +
351 "} }\r\n"; 334 "} }\r\n";
@@ -356,9 +339,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
356 { 339 {
357 compileScript = String.Empty + 340 compileScript = String.Empty +
358 "using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog; " + 341 "using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog; " +
359 "using OpenSim.Region.ScriptEngine.Common; using OpenSim.Region.ScriptEngine.Shared; using System.Collections.Generic;\r\n" + 342 "using OpenSim.Region.ScriptEngine.Shared; using System.Collections.Generic;\r\n" +
360 String.Empty + "namespace SecondLife { " + 343 String.Empty + "namespace SecondLife { " +
361 String.Empty + "public class Script : OpenSim.Region.ScriptEngine.Common.ScriptBaseClass { \r\n" + 344 String.Empty + "public class Script : OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass { \r\n" +
362 //@"public Script() { } " + 345 //@"public Script() { } " +
363 @"static OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog.YP YP=null; " + 346 @"static OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog.YP YP=null; " +
364 @"public Script() { YP= new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog.YP(); } "+ 347 @"public Script() { YP= new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog.YP(); } "+
@@ -371,9 +354,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
371 private static string CreateVBCompilerScript(string compileScript) 354 private static string CreateVBCompilerScript(string compileScript)
372 { 355 {
373 compileScript = String.Empty + 356 compileScript = String.Empty +
374 "Imports OpenSim.Region.ScriptEngine.Common: Imports OpenSim.Region.ScriptEngine.Shared: Imports System.Collections.Generic: " + 357 "Imports OpenSim.Region.ScriptEngine.Shared: Imports System.Collections.Generic: " +
375 String.Empty + "NameSpace SecondLife:" + 358 String.Empty + "NameSpace SecondLife:" +
376 String.Empty + "Public Class Script: Inherits OpenSim.Region.ScriptEngine.Common.ScriptBaseClass: " + 359 String.Empty + "Public Class Script: Inherits OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass: " +
377 "\r\nPublic Sub New()\r\nEnd Sub: " + 360 "\r\nPublic Sub New()\r\nEnd Sub: " +
378 compileScript + 361 compileScript +
379 ":End Class :End Namespace\r\n"; 362 ":End Class :End Namespace\r\n";
@@ -439,9 +422,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
439 string rootPath = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory); 422 string rootPath = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory);
440 string rootPathSE = Path.GetDirectoryName(GetType().Assembly.Location); 423 string rootPathSE = Path.GetDirectoryName(GetType().Assembly.Location);
441 //Console.WriteLine("Assembly location: " + rootPath); 424 //Console.WriteLine("Assembly location: " + rootPath);
442 parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Common.dll"));
443 parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Shared.dll")); 425 parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Shared.dll"));
444 parameters.ReferencedAssemblies.Add(Path.Combine(rootPathSE, "OpenSim.Region.ScriptEngine.DotNetEngine.dll")); 426 parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Shared.Api.Runtime.dll"));
427
428 if (lang == enumCompileType.yp)
429 {
430 parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Shared.YieldProlog.dll"));
431 }
445 432
446 //parameters.ReferencedAssemblies.Add("OpenSim.Region.Environment"); 433 //parameters.ReferencedAssemblies.Add("OpenSim.Region.Environment");
447 parameters.GenerateExecutable = false; 434 parameters.GenerateExecutable = false;
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
index 6a3f388..a2b5621 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
@@ -36,7 +36,7 @@ using OpenSim.Region.Environment.Scenes;
36using OpenSim.Region.ScriptEngine.Interfaces; 36using OpenSim.Region.ScriptEngine.Interfaces;
37using OpenMetaverse; 37using OpenMetaverse;
38using OpenSim.Region.ScriptEngine.Shared; 38using OpenSim.Region.ScriptEngine.Shared;
39using OpenSim.Region.ScriptEngine.Common; 39using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
40 40
41namespace OpenSim.Region.ScriptEngine.DotNetEngine 41namespace OpenSim.Region.ScriptEngine.DotNetEngine
42{ 42{
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
index 99f61cd..32e1df1 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
@@ -31,13 +31,14 @@ using log4net;
31using OpenMetaverse; 31using OpenMetaverse;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Region.Environment.Scenes; 33using OpenSim.Region.Environment.Scenes;
34using OpenSim.Region.ScriptEngine.Common; 34using OpenSim.Region.ScriptEngine.Interfaces;
35using OpenSim.Region.ScriptEngine.Shared; 35using OpenSim.Region.ScriptEngine.Shared;
36using OpenSim.Region.ScriptEngine.Shared.Api; 36using OpenSim.Region.ScriptEngine.Shared.Api;
37using System.Collections.Generic; 37using System.Collections.Generic;
38using System.IO; 38using System.IO;
39using System.Runtime.Serialization.Formatters.Binary; 39using System.Runtime.Serialization.Formatters.Binary;
40using System.Threading; 40using System.Threading;
41using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
41 42
42namespace OpenSim.Region.ScriptEngine.DotNetEngine 43namespace OpenSim.Region.ScriptEngine.DotNetEngine
43{ 44{
@@ -446,7 +447,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
446 447
447 detparms[id] = qParams; 448 detparms[id] = qParams;
448 if (id.Running) 449 if (id.Running)
449 id.Script.Exec.ExecuteEvent(id.State, FunctionName, args); 450 id.Script.ExecuteEvent(id.State, FunctionName, args);
450 detparms.Remove(id); 451 detparms.Remove(id);
451 } 452 }
452 453
@@ -470,8 +471,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
470 { 471 {
471 return 0; 472 return 0;
472 } 473 }
473 ExecutorBase.scriptEvents evflags = 474 int evflags = id.Script.GetStateEventFlags(id.State);
474 id.Script.Exec.GetStateEventFlags(id.State); 475
475 return (int)evflags; 476 return (int)evflags;
476 } 477 }
477 catch (Exception) 478 catch (Exception)