aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs
diff options
context:
space:
mode:
authorTedd Hansen2007-08-14 15:59:36 +0000
committerTedd Hansen2007-08-14 15:59:36 +0000
commitafaa12a9e2fd24c03c0f46716e9758cc591703c2 (patch)
treef6f6977314ab65d88822b592378806142090e99d /OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs
parentMore inventory work, should be able to now create new inventory folders and t... (diff)
downloadopensim-SC_OLD-afaa12a9e2fd24c03c0f46716e9758cc591703c2.zip
opensim-SC_OLD-afaa12a9e2fd24c03c0f46716e9758cc591703c2.tar.gz
opensim-SC_OLD-afaa12a9e2fd24c03c0f46716e9758cc591703c2.tar.bz2
opensim-SC_OLD-afaa12a9e2fd24c03c0f46716e9758cc591703c2.tar.xz
ScriptEngine: Some error handling, logs to logger
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs31
1 files changed, 27 insertions, 4 deletions
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 }