From 47ea453b32fe8122ed2eb0d62607f65d3dbdddb8 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Tue, 17 Jul 2007 00:07:26 +0000 Subject: * debugged quite a lot of db-related strangeness and various refactoring goofs --- OpenSim/Region/Environment/Scenes/Scene.cs | 13 ++---- OpenSim/Region/Environment/Scenes/SceneBase.cs | 55 +++++++++++--------------- 2 files changed, 27 insertions(+), 41 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 671b222..5bba87a 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -89,7 +89,7 @@ namespace OpenSim.Region.Environment.Scenes return (this.phyScene); } } - + private LandManager m_LandManager; public LandManager LandManager { @@ -441,15 +441,8 @@ namespace OpenSim.Region.Environment.Scenes /// public void LoadPrimsFromStorage() { - try - { - MainLog.Instance.Verbose("World.cs: LoadPrimsFromStorage() - Loading primitives"); - this.localStorage.LoadPrimitives(this); - } - catch (Exception e) - { - MainLog.Instance.Warn("World.cs: LoadPrimsFromStorage() - Failed with exception " + e.ToString()); - } + MainLog.Instance.Verbose("World.cs: LoadPrimsFromStorage() - Loading primitives"); + this.localStorage.LoadPrimitives(this); } /// diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs index cbf69ac..4326553 100644 --- a/OpenSim/Region/Environment/Scenes/SceneBase.cs +++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs @@ -38,7 +38,7 @@ using OpenSim.Framework; namespace OpenSim.Region.Environment.Scenes { - public abstract class SceneBase : IWorld + public abstract class SceneBase : IWorld { public Dictionary Entities; protected ulong m_regionHandle; @@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.Scenes public TerrainEngine Terrain; - public string m_datastore; + protected string m_datastore; public ILocalStorage localStorage; protected object m_syncRoot = new object(); @@ -76,44 +76,37 @@ namespace OpenSim.Region.Environment.Scenes /// Successful or not public bool LoadStorageDLL(string dllName) { - try - { - Assembly pluginAssembly = Assembly.LoadFrom(dllName); - ILocalStorage store = null; + Assembly pluginAssembly = Assembly.LoadFrom(dllName); + ILocalStorage store = null; - foreach (Type pluginType in pluginAssembly.GetTypes()) + foreach (Type pluginType in pluginAssembly.GetTypes()) + { + if (pluginType.IsPublic) { - if (pluginType.IsPublic) + if (!pluginType.IsAbstract) { - if (!pluginType.IsAbstract) - { - Type typeInterface = pluginType.GetInterface("ILocalStorage", true); + Type typeInterface = pluginType.GetInterface("ILocalStorage", true); - if (typeInterface != null) - { - ILocalStorage plug = (ILocalStorage)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - store = plug; - - store.Initialise(this.m_datastore); - break; - } + if (typeInterface != null) + { + ILocalStorage plug = (ILocalStorage)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); + store = plug; - typeInterface = null; + store.Initialise(this.m_datastore); + break; } + + typeInterface = null; } } - pluginAssembly = null; - this.localStorage = store; - return (store == null); - } - catch (Exception e) - { - MainLog.Instance.Warn("World.cs: LoadStorageDLL() - Failed with exception " + e.ToString()); - return false; } + pluginAssembly = null; + this.localStorage = store; + return (store == null); + } - + /// /// Send the region heightmap to the client /// @@ -150,7 +143,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// public abstract void RemoveClient(LLUUID agentID); - + #endregion /// @@ -190,6 +183,6 @@ namespace OpenSim.Region.Environment.Scenes #endregion - + } } -- cgit v1.1