diff options
Diffstat (limited to 'OpenSim/Region/ExtensionsScriptModule/Engines/CSharp')
-rw-r--r-- | OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/CSharpScriptEngine.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs | 16 |
2 files changed, 12 insertions, 17 deletions
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/CSharpScriptEngine.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/CSharpScriptEngine.cs index d4b27fc..176fc7b 100644 --- a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/CSharpScriptEngine.cs +++ b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/CSharpScriptEngine.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp | |||
40 | return ".cs"; | 40 | return ".cs"; |
41 | } | 41 | } |
42 | 42 | ||
43 | private Dictionary<string,IScript> LoadDotNetScript(CodeDomProvider compiler, string filename) | 43 | private Dictionary<string, IScript> LoadDotNetScript(CodeDomProvider compiler, string filename) |
44 | { | 44 | { |
45 | CompilerParameters compilerParams = new CompilerParameters(); | 45 | CompilerParameters compilerParams = new CompilerParameters(); |
46 | CompilerResults compilerResults; | 46 | CompilerResults compilerResults; |
@@ -66,15 +66,16 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp | |||
66 | } | 66 | } |
67 | else | 67 | else |
68 | { | 68 | { |
69 | Dictionary<string,IScript> scripts = new Dictionary<string,IScript>(); | 69 | Dictionary<string, IScript> scripts = new Dictionary<string, IScript>(); |
70 | 70 | ||
71 | foreach (Type pluginType in compilerResults.CompiledAssembly.GetExportedTypes()) | 71 | foreach (Type pluginType in compilerResults.CompiledAssembly.GetExportedTypes()) |
72 | { | 72 | { |
73 | Type testInterface = pluginType.GetInterface("IScript", true); | 73 | Type testInterface = pluginType.GetInterface("IScript", true); |
74 | 74 | ||
75 | if (testInterface != null) | 75 | if (testInterface != null) |
76 | { | 76 | { |
77 | IScript script = (IScript)compilerResults.CompiledAssembly.CreateInstance(pluginType.ToString()); | 77 | IScript script = |
78 | (IScript) compilerResults.CompiledAssembly.CreateInstance(pluginType.ToString()); | ||
78 | 79 | ||
79 | string scriptName = "C#/" + script.Name; | 80 | string scriptName = "C#/" + script.Name; |
80 | Console.WriteLine("Script: " + scriptName + " loaded."); | 81 | Console.WriteLine("Script: " + scriptName + " loaded."); |
@@ -94,10 +95,10 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp | |||
94 | return null; | 95 | return null; |
95 | } | 96 | } |
96 | 97 | ||
97 | public Dictionary<string,IScript> compile(string filename) | 98 | public Dictionary<string, IScript> compile(string filename) |
98 | { | 99 | { |
99 | CSharpCodeProvider csharpProvider = new CSharpCodeProvider(); | 100 | CSharpCodeProvider csharpProvider = new CSharpCodeProvider(); |
100 | return LoadDotNetScript(csharpProvider, filename); | 101 | return LoadDotNetScript(csharpProvider, filename); |
101 | } | 102 | } |
102 | } | 103 | } |
103 | } | 104 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs index 7ae4658..2d684d1 100644 --- a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs +++ b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs | |||
@@ -26,19 +26,13 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | using OpenSim.Framework.Console; | ||
30 | using OpenSim.Framework; | ||
31 | using OpenSim.Region.Environment; | ||
32 | using OpenSim.Region.Environment.Scenes; | 29 | using OpenSim.Region.Environment.Scenes; |
33 | 30 | ||
34 | using System.Collections.Generic; | ||
35 | using libsecondlife; | ||
36 | |||
37 | namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples | 31 | namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples |
38 | { | 32 | { |
39 | public class LSLExportScript : IScript | 33 | public class LSLExportScript : IScript |
40 | { | 34 | { |
41 | ScriptInfo script; | 35 | private ScriptInfo script; |
42 | 36 | ||
43 | public string Name | 37 | public string Name |
44 | { | 38 | { |
@@ -48,11 +42,11 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples | |||
48 | public void Initialise(ScriptInfo scriptInfo) | 42 | public void Initialise(ScriptInfo scriptInfo) |
49 | { | 43 | { |
50 | script = scriptInfo; | 44 | script = scriptInfo; |
51 | 45 | ||
52 | script.events.OnPluginConsole += new EventManager.OnPluginConsoleDelegate(ProcessConsoleMsg); | 46 | script.events.OnPluginConsole += new EventManager.OnPluginConsoleDelegate(ProcessConsoleMsg); |
53 | } | 47 | } |
54 | 48 | ||
55 | void ProcessConsoleMsg(string[] args) | 49 | private void ProcessConsoleMsg(string[] args) |
56 | { | 50 | { |
57 | /*if (args[0].ToLower() == "lslexport") | 51 | /*if (args[0].ToLower() == "lslexport") |
58 | { | 52 | { |
@@ -79,7 +73,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples | |||
79 | }*/ | 73 | }*/ |
80 | } | 74 | } |
81 | 75 | ||
82 | string processPrimitiveToString(OpenSim.Region.Environment.Scenes.SceneObjectPart prim) | 76 | private string processPrimitiveToString(SceneObjectPart prim) |
83 | { | 77 | { |
84 | /*string desc = prim.Description; | 78 | /*string desc = prim.Description; |
85 | string name = prim.Name; | 79 | string name = prim.Name; |
@@ -97,4 +91,4 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples | |||
97 | return ""; | 91 | return ""; |
98 | } | 92 | } |
99 | } | 93 | } |
100 | } | 94 | } \ No newline at end of file |