diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneBase.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneBase.cs | 55 |
1 files changed, 24 insertions, 31 deletions
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; | |||
38 | 38 | ||
39 | namespace OpenSim.Region.Environment.Scenes | 39 | namespace OpenSim.Region.Environment.Scenes |
40 | { | 40 | { |
41 | public abstract class SceneBase : IWorld | 41 | public abstract class SceneBase : IWorld |
42 | { | 42 | { |
43 | public Dictionary<LLUUID, EntityBase> Entities; | 43 | public Dictionary<LLUUID, EntityBase> Entities; |
44 | protected ulong m_regionHandle; | 44 | protected ulong m_regionHandle; |
@@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
47 | 47 | ||
48 | public TerrainEngine Terrain; | 48 | public TerrainEngine Terrain; |
49 | 49 | ||
50 | public string m_datastore; | 50 | protected string m_datastore; |
51 | public ILocalStorage localStorage; | 51 | public ILocalStorage localStorage; |
52 | 52 | ||
53 | protected object m_syncRoot = new object(); | 53 | protected object m_syncRoot = new object(); |
@@ -76,44 +76,37 @@ namespace OpenSim.Region.Environment.Scenes | |||
76 | /// <returns>Successful or not</returns> | 76 | /// <returns>Successful or not</returns> |
77 | public bool LoadStorageDLL(string dllName) | 77 | public bool LoadStorageDLL(string dllName) |
78 | { | 78 | { |
79 | try | 79 | Assembly pluginAssembly = Assembly.LoadFrom(dllName); |
80 | { | 80 | ILocalStorage store = null; |
81 | Assembly pluginAssembly = Assembly.LoadFrom(dllName); | ||
82 | ILocalStorage store = null; | ||
83 | 81 | ||
84 | foreach (Type pluginType in pluginAssembly.GetTypes()) | 82 | foreach (Type pluginType in pluginAssembly.GetTypes()) |
83 | { | ||
84 | if (pluginType.IsPublic) | ||
85 | { | 85 | { |
86 | if (pluginType.IsPublic) | 86 | if (!pluginType.IsAbstract) |
87 | { | 87 | { |
88 | if (!pluginType.IsAbstract) | 88 | Type typeInterface = pluginType.GetInterface("ILocalStorage", true); |
89 | { | ||
90 | Type typeInterface = pluginType.GetInterface("ILocalStorage", true); | ||
91 | 89 | ||
92 | if (typeInterface != null) | 90 | if (typeInterface != null) |
93 | { | 91 | { |
94 | ILocalStorage plug = (ILocalStorage)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | 92 | ILocalStorage plug = (ILocalStorage)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); |
95 | store = plug; | 93 | store = plug; |
96 | |||
97 | store.Initialise(this.m_datastore); | ||
98 | break; | ||
99 | } | ||
100 | 94 | ||
101 | typeInterface = null; | 95 | store.Initialise(this.m_datastore); |
96 | break; | ||
102 | } | 97 | } |
98 | |||
99 | typeInterface = null; | ||
103 | } | 100 | } |
104 | } | 101 | } |
105 | pluginAssembly = null; | ||
106 | this.localStorage = store; | ||
107 | return (store == null); | ||
108 | } | ||
109 | catch (Exception e) | ||
110 | { | ||
111 | MainLog.Instance.Warn("World.cs: LoadStorageDLL() - Failed with exception " + e.ToString()); | ||
112 | return false; | ||
113 | } | 102 | } |
103 | pluginAssembly = null; | ||
104 | this.localStorage = store; | ||
105 | return (store == null); | ||
106 | |||
114 | } | 107 | } |
115 | 108 | ||
116 | 109 | ||
117 | /// <summary> | 110 | /// <summary> |
118 | /// Send the region heightmap to the client | 111 | /// Send the region heightmap to the client |
119 | /// </summary> | 112 | /// </summary> |
@@ -150,7 +143,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
150 | /// </summary> | 143 | /// </summary> |
151 | /// <param name="agentID"></param> | 144 | /// <param name="agentID"></param> |
152 | public abstract void RemoveClient(LLUUID agentID); | 145 | public abstract void RemoveClient(LLUUID agentID); |
153 | 146 | ||
154 | #endregion | 147 | #endregion |
155 | 148 | ||
156 | /// <summary> | 149 | /// <summary> |
@@ -190,6 +183,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
190 | 183 | ||
191 | #endregion | 184 | #endregion |
192 | 185 | ||
193 | 186 | ||
194 | } | 187 | } |
195 | } | 188 | } |