diff options
-rw-r--r-- | OpenSim/Region/Application/OpenSimMain.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientViewBase.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/RegionApplicationBase.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/Environment/StorageManager.cs | 63 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/MyWorld.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/Program.cs | 4 | ||||
-rw-r--r-- | prebuild.xml | 1 |
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; | |||
44 | using OpenSim.Region.Communications.Local; | 44 | using OpenSim.Region.Communications.Local; |
45 | using OpenSim.Region.Communications.OGS1; | 45 | using OpenSim.Region.Communications.OGS1; |
46 | using OpenSim.Region.Environment.Scenes; | 46 | using OpenSim.Region.Environment.Scenes; |
47 | using OpenSim.Region.Environment; | ||
47 | using System.Text; | 48 | using System.Text; |
48 | 49 | ||
49 | namespace OpenSim | 50 | namespace 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; | |||
35 | using libsecondlife.Packets; | 35 | using libsecondlife.Packets; |
36 | using OpenSim.Framework.Console; | 36 | using OpenSim.Framework.Console; |
37 | using OpenSim.Framework.Utilities; | 37 | using OpenSim.Framework.Utilities; |
38 | using OpenSim.Region.Environment; | ||
38 | 39 | ||
39 | namespace OpenSim.Region.ClientStack | 40 | namespace 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; | |||
36 | using OpenSim.Framework.Types; | 36 | using OpenSim.Framework.Types; |
37 | using OpenSim.Physics.Manager; | 37 | using OpenSim.Physics.Manager; |
38 | using OpenSim.Region.Caches; | 38 | using OpenSim.Region.Caches; |
39 | using OpenSim.Region.Environment; | ||
39 | 40 | ||
40 | namespace OpenSim.Region.ClientStack | 41 | namespace 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; | |||
39 | using OpenSim.Framework.Types; | 39 | using OpenSim.Framework.Types; |
40 | using OpenSim.Physics.Manager; | 40 | using OpenSim.Physics.Manager; |
41 | using OpenSim.Region.Caches; | 41 | using OpenSim.Region.Caches; |
42 | using OpenSim.Region.Interfaces; | ||
42 | using OpenSim.Region.Scripting; | 43 | using OpenSim.Region.Scripting; |
43 | using OpenSim.Region.Terrain; | 44 | using OpenSim.Region.Terrain; |
44 | using Caps = OpenSim.Region.Capabilities.Caps; | 45 | using 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 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | using OpenSim.Framework; | ||
6 | using OpenSim.Framework.Communications; | ||
7 | using OpenSim.Framework.Servers; | ||
8 | using OpenSim.Region.Capabilities; | ||
9 | using OpenSim.Region.Environment.Scenes; | ||
10 | using OpenSim.Region.Interfaces; | ||
11 | |||
12 | using System.Reflection; | ||
13 | |||
14 | namespace 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; | |||
8 | using OpenSim.Region.Caches; | 8 | using OpenSim.Region.Caches; |
9 | using OpenSim.Region.Environment.Scenes; | 9 | using OpenSim.Region.Environment.Scenes; |
10 | using OpenSim.Region.Terrain; | 10 | using OpenSim.Region.Terrain; |
11 | using OpenSim.Region.Environment; | ||
12 | |||
11 | using Avatar=OpenSim.Region.Environment.Scenes.ScenePresence; | 13 | using Avatar=OpenSim.Region.Environment.Scenes.ScenePresence; |
12 | 14 | ||
13 | namespace SimpleApp | 15 | namespace 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"/> |