diff options
Diffstat (limited to 'OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/CSharpScriptEngine.cs')
-rw-r--r-- | OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/CSharpScriptEngine.cs | 13 |
1 files changed, 7 insertions, 6 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 |