aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs5
-rw-r--r--OpenSim/Region/ClientStack/ClientViewBase.cs5
-rw-r--r--OpenSim/Region/ClientStack/RegionApplicationBase.cs1
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs5
-rw-r--r--OpenSim/Region/Environment/StorageManager.cs63
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyWorld.cs6
-rw-r--r--OpenSim/Region/Examples/SimpleApp/Program.cs4
-rw-r--r--prebuild.xml1
8 files changed, 83 insertions, 7 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index acf09eb..7dd426a 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -44,6 +44,7 @@ using OpenSim.Region.ClientStack;
44using OpenSim.Region.Communications.Local; 44using OpenSim.Region.Communications.Local;
45using OpenSim.Region.Communications.OGS1; 45using OpenSim.Region.Communications.OGS1;
46using OpenSim.Region.Environment.Scenes; 46using OpenSim.Region.Environment.Scenes;
47using OpenSim.Region.Environment;
47using System.Text; 48using System.Text;
48 49
49namespace OpenSim 50namespace OpenSim
@@ -210,7 +211,9 @@ namespace OpenSim
210 m_udpServer.Add(udpServer); 211 m_udpServer.Add(udpServer);
211 this.regionData.Add(regionDat); 212 this.regionData.Add(regionDat);
212 213
213 LocalWorld = new Scene(udpServer.PacketServer.ClientManager, regionDat, authenBase, commsManager, this.AssetCache, httpServer); 214 StorageManager tmpStoreManager = new StorageManager("OpenSim.DataStore.NullStorage.dll", regionDat.DataStore, "base");
215
216 LocalWorld = new Scene(udpServer.PacketServer.ClientManager, regionDat, authenBase, commsManager, this.AssetCache, tmpStoreManager, httpServer);
214 this.m_localWorld.Add(LocalWorld); 217 this.m_localWorld.Add(LocalWorld);
215 //LocalWorld.InventoryCache = InventoryCache; 218 //LocalWorld.InventoryCache = InventoryCache;
216 //LocalWorld.AssetCache = AssetCache; 219 //LocalWorld.AssetCache = AssetCache;
diff --git a/OpenSim/Region/ClientStack/ClientViewBase.cs b/OpenSim/Region/ClientStack/ClientViewBase.cs
index 211ba8b..2bc3ed8 100644
--- a/OpenSim/Region/ClientStack/ClientViewBase.cs
+++ b/OpenSim/Region/ClientStack/ClientViewBase.cs
@@ -35,6 +35,7 @@ using libsecondlife;
35using libsecondlife.Packets; 35using libsecondlife.Packets;
36using OpenSim.Framework.Console; 36using OpenSim.Framework.Console;
37using OpenSim.Framework.Utilities; 37using OpenSim.Framework.Utilities;
38using OpenSim.Region.Environment;
38 39
39namespace OpenSim.Region.ClientStack 40namespace OpenSim.Region.ClientStack
40{ 41{
@@ -69,7 +70,7 @@ namespace OpenSim.Region.ClientStack
69 protected virtual void ProcessOutPacket(Packet Pack) 70 protected virtual void ProcessOutPacket(Packet Pack)
70 { 71 {
71 // Keep track of when this packet was sent out 72 // Keep track of when this packet was sent out
72 Pack.TickCount = Environment.TickCount; 73 Pack.TickCount = System.Environment.TickCount;
73 74
74 // Console.WriteLine(CircuitCode + ":OUT: " + Pack.Type.ToString()); 75 // Console.WriteLine(CircuitCode + ":OUT: " + Pack.Type.ToString());
75 76
@@ -245,7 +246,7 @@ namespace OpenSim.Region.ClientStack
245 246
246 protected void ResendUnacked() 247 protected void ResendUnacked()
247 { 248 {
248 int now = Environment.TickCount; 249 int now = System.Environment.TickCount;
249 250
250 lock (NeedAck) 251 lock (NeedAck)
251 { 252 {
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
index 1e99c71..622b89c 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
@@ -36,6 +36,7 @@ using OpenSim.Framework.Servers;
36using OpenSim.Framework.Types; 36using OpenSim.Framework.Types;
37using OpenSim.Physics.Manager; 37using OpenSim.Physics.Manager;
38using OpenSim.Region.Caches; 38using OpenSim.Region.Caches;
39using OpenSim.Region.Environment;
39 40
40namespace OpenSim.Region.ClientStack 41namespace OpenSim.Region.ClientStack
41{ 42{
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}
diff --git a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
index d0e3fed..bdf1263 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
@@ -8,6 +8,8 @@ using OpenSim.Framework.Types;
8using OpenSim.Region.Caches; 8using OpenSim.Region.Caches;
9using OpenSim.Region.Environment.Scenes; 9using OpenSim.Region.Environment.Scenes;
10using OpenSim.Region.Terrain; 10using OpenSim.Region.Terrain;
11using OpenSim.Region.Environment;
12
11using Avatar=OpenSim.Region.Environment.Scenes.ScenePresence; 13using Avatar=OpenSim.Region.Environment.Scenes.ScenePresence;
12 14
13namespace SimpleApp 15namespace SimpleApp
@@ -16,8 +18,8 @@ namespace SimpleApp
16 { 18 {
17 private List<ScenePresence> m_avatars; 19 private List<ScenePresence> m_avatars;
18 20
19 public MyWorld(ClientManager clientManager, RegionInfo regionInfo, AuthenticateSessionsBase authen, CommunicationsManager commsMan, AssetCache assetCach, BaseHttpServer httpServer) 21 public MyWorld(ClientManager clientManager, RegionInfo regionInfo, AuthenticateSessionsBase authen, CommunicationsManager commsMan, AssetCache assetCach, StorageManager storeMan, BaseHttpServer httpServer)
20 : base(clientManager, regionInfo, authen, commsMan, assetCach, httpServer) 22 : base(clientManager, regionInfo, authen, commsMan, assetCach, storeMan, httpServer)
21 { 23 {
22 m_avatars = new List<Avatar>(); 24 m_avatars = new List<Avatar>();
23 } 25 }
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs
index ce60512..1c502ed 100644
--- a/OpenSim/Region/Examples/SimpleApp/Program.cs
+++ b/OpenSim/Region/Examples/SimpleApp/Program.cs
@@ -60,7 +60,9 @@ namespace SimpleApp
60 60
61 RegionInfo regionInfo = new RegionInfo(1000, 1000, internalEndPoint, "127.0.0.1"); 61 RegionInfo regionInfo = new RegionInfo(1000, 1000, internalEndPoint, "127.0.0.1");
62 62
63 world = new MyWorld(packetServer.ClientManager, regionInfo, m_circuitManager, communicationsManager, assetCache, httpServer); 63 OpenSim.Region.Environment.StorageManager storeMan = new OpenSim.Region.Environment.StorageManager("OpenSim.DataStore.NullStorage.dll", "simpleapp.yap", "simpleapp");
64
65 world = new MyWorld(packetServer.ClientManager, regionInfo, m_circuitManager, communicationsManager, assetCache, storeMan, httpServer);
64 world.PhysScene = physManager.GetPhysicsScene("basicphysics"); //PhysicsScene.Null; 66 world.PhysScene = physManager.GetPhysicsScene("basicphysics"); //PhysicsScene.Null;
65 67
66 world.LoadWorldMap(); 68 world.LoadWorldMap();
diff --git a/prebuild.xml b/prebuild.xml
index a62735b..cea5687 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -626,6 +626,7 @@
626 <Reference name="Axiom.MathLib.dll"/> 626 <Reference name="Axiom.MathLib.dll"/>
627 <Reference name="Db4objects.Db4o.dll"/> 627 <Reference name="Db4objects.Db4o.dll"/>
628 <Reference name="OpenSim.Region.Terrain.BasicTerrain"/> 628 <Reference name="OpenSim.Region.Terrain.BasicTerrain"/>
629 <Reference name="OpenSim.Region.Environment"/>
629 <Reference name="OpenSim.Framework"/> 630 <Reference name="OpenSim.Framework"/>
630 <Reference name="OpenSim.Framework.Console"/> 631 <Reference name="OpenSim.Framework.Console"/>
631 <Reference name="OpenSim.Region.Physics.Manager"/> 632 <Reference name="OpenSim.Region.Physics.Manager"/>