diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scripting')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineInterface.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs | 31 |
2 files changed, 28 insertions, 5 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineInterface.cs b/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineInterface.cs index 5f378a6..510f257 100644 --- a/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineInterface.cs +++ b/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineInterface.cs | |||
@@ -34,7 +34,7 @@ namespace OpenSim.Region.Environment.Scenes.Scripting | |||
34 | { | 34 | { |
35 | public interface ScriptEngineInterface | 35 | public interface ScriptEngineInterface |
36 | { | 36 | { |
37 | void InitializeEngine(OpenSim.Region.Environment.Scenes.Scene Sceneworld); | 37 | void InitializeEngine(OpenSim.Region.Environment.Scenes.Scene Sceneworld, OpenSim.Framework.Console.LogBase logger); |
38 | void Shutdown(); | 38 | void Shutdown(); |
39 | void StartScript(string ScriptID, string ObjectID); | 39 | void StartScript(string ScriptID, string ObjectID); |
40 | } | 40 | } |
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs b/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs index 4b912e4..2c87359 100644 --- a/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs +++ b/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs | |||
@@ -36,14 +36,25 @@ namespace OpenSim.Region.Environment.Scenes.Scripting | |||
36 | { | 36 | { |
37 | public class ScriptEngineLoader | 37 | public class ScriptEngineLoader |
38 | { | 38 | { |
39 | public ScriptEngineLoader() | 39 | private OpenSim.Framework.Console.LogBase m_log; |
40 | public ScriptEngineLoader(OpenSim.Framework.Console.LogBase logger) | ||
40 | { | 41 | { |
42 | m_log = logger; | ||
41 | } | 43 | } |
42 | 44 | ||
43 | public ScriptEngineInterface LoadScriptEngine(string EngineName) | 45 | public ScriptEngineInterface LoadScriptEngine(string EngineName) |
44 | { | 46 | { |
45 | return LoadAndInitAssembly(Path.Combine("ScriptEngines", "OpenSim.Region.ScriptEngine." + EngineName + ".dll"), | 47 | ScriptEngineInterface ret = null; |
46 | "OpenSim.Region.ScriptEngine." + EngineName + ".ScriptEngine"); | 48 | try |
49 | { | ||
50 | ret = LoadAndInitAssembly(Path.Combine("ScriptEngines", "OpenSim.Region.ScriptEngine." + EngineName + ".dll"), | ||
51 | "OpenSim.Region.ScriptEngine." + EngineName + ".ScriptEngine"); | ||
52 | } | ||
53 | catch (Exception e) | ||
54 | { | ||
55 | m_log.Error("ScriptEngine", "Error loading assembly \"" + EngineName + "\": " + e.ToString()); | ||
56 | } | ||
57 | return ret; | ||
47 | } | 58 | } |
48 | 59 | ||
49 | /// <summary> | 60 | /// <summary> |
@@ -73,6 +84,7 @@ namespace OpenSim.Region.Environment.Scenes.Scripting | |||
73 | //} | 84 | //} |
74 | //catch (Exception e) | 85 | //catch (Exception e) |
75 | //{ | 86 | //{ |
87 | // m_log.Error("ScriptEngine", "Error loading assembly \"" + FileName + "\": " + e.ToString()); | ||
76 | //} | 88 | //} |
77 | 89 | ||
78 | 90 | ||
@@ -89,9 +101,20 @@ namespace OpenSim.Region.Environment.Scenes.Scripting | |||
89 | //} | 101 | //} |
90 | //catch (Exception e) | 102 | //catch (Exception e) |
91 | //{ | 103 | //{ |
104 | // m_log.Error("ScriptEngine", "Error initializing type \"" + NameSpace + "\" from \"" + FileName + "\": " + e.ToString()); | ||
92 | //} | 105 | //} |
93 | 106 | ||
94 | return (ScriptEngineInterface)Activator.CreateInstance(t); | 107 | ScriptEngineInterface ret; |
108 | //try | ||
109 | //{ | ||
110 | ret = (ScriptEngineInterface)Activator.CreateInstance(t); | ||
111 | //} | ||
112 | //catch (Exception e) | ||
113 | //{ | ||
114 | // m_log.Error("ScriptEngine", "Error initializing type \"" + NameSpace + "\" from \"" + FileName + "\": " + e.ToString()); | ||
115 | //} | ||
116 | |||
117 | return ret; | ||
95 | 118 | ||
96 | 119 | ||
97 | } | 120 | } |