aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorAdam Frisby2007-07-15 15:40:50 +0000
committerAdam Frisby2007-07-15 15:40:50 +0000
commit8fc1dfec792f3527c7f153bd49852519d561d17a (patch)
tree0aae20f07b43c4ac9a4f2d5fff3f7eb1619733ab /OpenSim/Region/Environment
parent* Typo in prebuild.xml (diff)
downloadopensim-SC-8fc1dfec792f3527c7f153bd49852519d561d17a.zip
opensim-SC-8fc1dfec792f3527c7f153bd49852519d561d17a.tar.gz
opensim-SC-8fc1dfec792f3527c7f153bd49852519d561d17a.tar.bz2
opensim-SC-8fc1dfec792f3527c7f153bd49852519d561d17a.tar.xz
* Added loading methods for NullStorage.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs5
-rw-r--r--OpenSim/Region/Environment/StorageManager.cs63
2 files changed, 67 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 64f51d8..782c0fd 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -39,6 +39,7 @@ using OpenSim.Framework.Servers;
39using OpenSim.Framework.Types; 39using OpenSim.Framework.Types;
40using OpenSim.Physics.Manager; 40using OpenSim.Physics.Manager;
41using OpenSim.Region.Caches; 41using OpenSim.Region.Caches;
42using OpenSim.Region.Interfaces;
42using OpenSim.Region.Scripting; 43using OpenSim.Region.Scripting;
43using OpenSim.Region.Terrain; 44using OpenSim.Region.Terrain;
44using Caps = OpenSim.Region.Capabilities.Caps; 45using Caps = OpenSim.Region.Capabilities.Caps;
@@ -65,6 +66,7 @@ namespace OpenSim.Region.Environment.Scenes
65 protected AuthenticateSessionsBase authenticateHandler; 66 protected AuthenticateSessionsBase authenticateHandler;
66 protected RegionCommsListener regionCommsHost; 67 protected RegionCommsListener regionCommsHost;
67 protected CommunicationsManager commsManager; 68 protected CommunicationsManager commsManager;
69 protected StorageManager storageManager;
68 70
69 protected Dictionary<LLUUID, Caps> capsHandlers = new Dictionary<LLUUID, Caps>(); 71 protected Dictionary<LLUUID, Caps> capsHandlers = new Dictionary<LLUUID, Caps>();
70 protected BaseHttpServer httpListener; 72 protected BaseHttpServer httpListener;
@@ -118,11 +120,12 @@ namespace OpenSim.Region.Environment.Scenes
118 /// <param name="clientThreads">Dictionary to contain client threads</param> 120 /// <param name="clientThreads">Dictionary to contain client threads</param>
119 /// <param name="regionHandle">Region Handle for this region</param> 121 /// <param name="regionHandle">Region Handle for this region</param>
120 /// <param name="regionName">Region Name for this region</param> 122 /// <param name="regionName">Region Name for this region</param>
121 public Scene(ClientManager clientManager, RegionInfo regInfo, AuthenticateSessionsBase authen, CommunicationsManager commsMan, AssetCache assetCach, BaseHttpServer httpServer) 123 public Scene(ClientManager clientManager, RegionInfo regInfo, AuthenticateSessionsBase authen, CommunicationsManager commsMan, AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer)
122 { 124 {
123 updateLock = new Mutex(false); 125 updateLock = new Mutex(false);
124 this.authenticateHandler = authen; 126 this.authenticateHandler = authen;
125 this.commsManager = commsMan; 127 this.commsManager = commsMan;
128 this.storageManager = storeManager;
126 this.assetCache = assetCach; 129 this.assetCache = assetCach;
127 m_clientManager = clientManager; 130 m_clientManager = clientManager;
128 m_regInfo = regInfo; 131 m_regInfo = regInfo;
diff --git a/OpenSim/Region/Environment/StorageManager.cs b/OpenSim/Region/Environment/StorageManager.cs
new file mode 100644
index 0000000..9f2730f
--- /dev/null
+++ b/OpenSim/Region/Environment/StorageManager.cs
@@ -0,0 +1,63 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5using OpenSim.Framework;
6using OpenSim.Framework.Communications;
7using OpenSim.Framework.Servers;
8using OpenSim.Region.Capabilities;
9using OpenSim.Region.Environment.Scenes;
10using OpenSim.Region.Interfaces;
11
12using System.Reflection;
13
14namespace OpenSim.Region.Environment
15{
16 public class StorageManager
17 {
18 private IRegionDataStore m_dataStore;
19
20 public IRegionDataStore DataStore
21 {
22 get
23 {
24 return m_dataStore;
25 }
26 }
27
28 public StorageManager(IRegionDataStore storage)
29 {
30 m_dataStore = storage;
31 }
32
33 public StorageManager(string dllName, string dataStoreFile, string dataStoreDB)
34 {
35 Assembly pluginAssembly = Assembly.LoadFrom(dllName);
36
37 foreach (Type pluginType in pluginAssembly.GetTypes())
38 {
39 if (pluginType.IsPublic)
40 {
41 if (!pluginType.IsAbstract)
42 {
43 Type typeInterface = pluginType.GetInterface("IRegionDataStore", true);
44
45 if (typeInterface != null)
46 {
47 IRegionDataStore plug = (IRegionDataStore)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
48 plug.Initialise(dataStoreFile, dataStoreDB);
49
50 m_dataStore = plug;
51 }
52
53 typeInterface = null;
54 }
55 }
56 }
57
58 pluginAssembly = null;
59
60 //TODO: Add checking and warning to make sure it initialised.
61 }
62 }
63}