diff options
author | Tedd Hansen | 2008-09-21 01:09:54 +0000 |
---|---|---|
committer | Tedd Hansen | 2008-09-21 01:09:54 +0000 |
commit | ec494275a2eead0552f2f9819ceedbb4297bd7b5 (patch) | |
tree | 88607f93638fa9f1af48dda16402338df83ad89d /OpenSim/ApplicationPlugins/ScriptEngine | |
parent | Some error handling to avoid errors in SEC (diff) | |
download | opensim-SC-ec494275a2eead0552f2f9819ceedbb4297bd7b5.zip opensim-SC-ec494275a2eead0552f2f9819ceedbb4297bd7b5.tar.gz opensim-SC-ec494275a2eead0552f2f9819ceedbb4297bd7b5.tar.bz2 opensim-SC-ec494275a2eead0552f2f9819ceedbb4297bd7b5.tar.xz |
More locks, try's and disable some things in SEC - maybe it won't crash now. :)
Diffstat (limited to 'OpenSim/ApplicationPlugins/ScriptEngine')
3 files changed, 27 insertions, 14 deletions
diff --git a/OpenSim/ApplicationPlugins/ScriptEngine/ComponentLoader.cs b/OpenSim/ApplicationPlugins/ScriptEngine/ComponentLoader.cs index ab39568..c89da81 100644 --- a/OpenSim/ApplicationPlugins/ScriptEngine/ComponentLoader.cs +++ b/OpenSim/ApplicationPlugins/ScriptEngine/ComponentLoader.cs | |||
@@ -72,13 +72,19 @@ namespace OpenSim.ApplicationPlugins.ScriptEngine | |||
72 | { | 72 | { |
73 | // We have found an type which is derived from ProdiverBase, add it to provider list | 73 | // We have found an type which is derived from ProdiverBase, add it to provider list |
74 | m_log.InfoFormat("[ScriptEngine]: Adding component: {0}", componentType.Name); | 74 | m_log.InfoFormat("[ScriptEngine]: Adding component: {0}", componentType.Name); |
75 | ComponentRegistry.providers.Add(componentType.Name, componentType); | 75 | lock (ComponentRegistry.providers) |
76 | { | ||
77 | ComponentRegistry.providers.Add(componentType.Name, componentType); | ||
78 | } | ||
76 | } | 79 | } |
77 | if (componentType.IsSubclassOf(typeof(RegionScriptEngineBase))) | 80 | if (componentType.IsSubclassOf(typeof(RegionScriptEngineBase))) |
78 | { | 81 | { |
79 | // We have found an type which is derived from RegionScriptEngineBase, add it to engine list | 82 | // We have found an type which is derived from RegionScriptEngineBase, add it to engine list |
80 | m_log.InfoFormat("[ScriptEngine]: Adding script engine: {0}", componentType.Name); | 83 | m_log.InfoFormat("[ScriptEngine]: Adding script engine: {0}", componentType.Name); |
81 | ComponentRegistry.scriptEngines.Add(componentType.Name, componentType); | 84 | lock (ComponentRegistry.scriptEngines) |
85 | { | ||
86 | ComponentRegistry.scriptEngines.Add(componentType.Name, componentType); | ||
87 | } | ||
82 | } | 88 | } |
83 | } | 89 | } |
84 | } | 90 | } |
diff --git a/OpenSim/ApplicationPlugins/ScriptEngine/RegionScriptEngineBase.cs b/OpenSim/ApplicationPlugins/ScriptEngine/RegionScriptEngineBase.cs index e6f5210..ec676f2 100644 --- a/OpenSim/ApplicationPlugins/ScriptEngine/RegionScriptEngineBase.cs +++ b/OpenSim/ApplicationPlugins/ScriptEngine/RegionScriptEngineBase.cs | |||
@@ -74,16 +74,19 @@ namespace OpenSim.ApplicationPlugins.ScriptEngine | |||
74 | m_log.Info("[" + Name + "]: Loading: " + c); | 74 | m_log.Info("[" + Name + "]: Loading: " + c); |
75 | lock (Components) | 75 | lock (Components) |
76 | { | 76 | { |
77 | try | 77 | lock (ComponentRegistry.providers) |
78 | { | 78 | { |
79 | if (ComponentRegistry.providers.ContainsKey(c)) | 79 | try |
80 | Components.Add(Activator.CreateInstance(ComponentRegistry.providers[c]) as ComponentBase); | 80 | { |
81 | else | 81 | if (ComponentRegistry.providers.ContainsKey(c)) |
82 | m_log.Error("[" + Name + "]: Component \"" + c + "\" not found, can not load"); | 82 | Components.Add(Activator.CreateInstance(ComponentRegistry.providers[c]) as ComponentBase); |
83 | } | 83 | else |
84 | catch (Exception ex) | 84 | m_log.Error("[" + Name + "]: Component \"" + c + "\" not found, can not load"); |
85 | { | 85 | } |
86 | m_log.Error("[" + Name + "]: Exception loading \"" + c + "\": " + ex.ToString()); | 86 | catch (Exception ex) |
87 | { | ||
88 | m_log.Error("[" + Name + "]: Exception loading \"" + c + "\": " + ex.ToString()); | ||
89 | } | ||
87 | } | 90 | } |
88 | } | 91 | } |
89 | } | 92 | } |
diff --git a/OpenSim/ApplicationPlugins/ScriptEngine/RegionScriptEnginePlugin.cs b/OpenSim/ApplicationPlugins/ScriptEngine/RegionScriptEnginePlugin.cs index c4f4bbe..0851fc3 100644 --- a/OpenSim/ApplicationPlugins/ScriptEngine/RegionScriptEnginePlugin.cs +++ b/OpenSim/ApplicationPlugins/ScriptEngine/RegionScriptEnginePlugin.cs | |||
@@ -43,13 +43,17 @@ namespace OpenSim.ApplicationPlugins.ScriptEngine | |||
43 | public RegionScriptEngineBase scriptEngine; | 43 | public RegionScriptEngineBase scriptEngine; |
44 | public void Initialise(Scene scene, IConfigSource source) | 44 | public void Initialise(Scene scene, IConfigSource source) |
45 | { | 45 | { |
46 | return; | ||
46 | // New region is being created | 47 | // New region is being created |
47 | // Create a new script engine | 48 | // Create a new script engine |
48 | try | 49 | try |
49 | { | 50 | { |
50 | scriptEngine = | 51 | lock (ComponentRegistry.scriptEngines) |
51 | Activator.CreateInstance(ComponentRegistry.scriptEngines[tempScriptEngineName]) as | 52 | { |
52 | RegionScriptEngineBase; | 53 | scriptEngine = |
54 | Activator.CreateInstance(ComponentRegistry.scriptEngines[tempScriptEngineName]) as | ||
55 | RegionScriptEngineBase; | ||
56 | } | ||
53 | scriptEngine.Initialize(scene, source); | 57 | scriptEngine.Initialize(scene, source); |
54 | } | 58 | } |
55 | catch (Exception ex) | 59 | catch (Exception ex) |