* Added loading methods for NullStorage.
parent
f65c3d5a31
commit
8fc1dfec79
|
@ -44,6 +44,7 @@ using OpenSim.Region.ClientStack;
|
|||
using OpenSim.Region.Communications.Local;
|
||||
using OpenSim.Region.Communications.OGS1;
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
using OpenSim.Region.Environment;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenSim
|
||||
|
@ -210,7 +211,9 @@ namespace OpenSim
|
|||
m_udpServer.Add(udpServer);
|
||||
this.regionData.Add(regionDat);
|
||||
|
||||
LocalWorld = new Scene(udpServer.PacketServer.ClientManager, regionDat, authenBase, commsManager, this.AssetCache, httpServer);
|
||||
StorageManager tmpStoreManager = new StorageManager("OpenSim.DataStore.NullStorage.dll", regionDat.DataStore, "base");
|
||||
|
||||
LocalWorld = new Scene(udpServer.PacketServer.ClientManager, regionDat, authenBase, commsManager, this.AssetCache, tmpStoreManager, httpServer);
|
||||
this.m_localWorld.Add(LocalWorld);
|
||||
//LocalWorld.InventoryCache = InventoryCache;
|
||||
//LocalWorld.AssetCache = AssetCache;
|
||||
|
|
|
@ -35,6 +35,7 @@ using libsecondlife;
|
|||
using libsecondlife.Packets;
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Framework.Utilities;
|
||||
using OpenSim.Region.Environment;
|
||||
|
||||
namespace OpenSim.Region.ClientStack
|
||||
{
|
||||
|
@ -69,7 +70,7 @@ namespace OpenSim.Region.ClientStack
|
|||
protected virtual void ProcessOutPacket(Packet Pack)
|
||||
{
|
||||
// Keep track of when this packet was sent out
|
||||
Pack.TickCount = Environment.TickCount;
|
||||
Pack.TickCount = System.Environment.TickCount;
|
||||
|
||||
// Console.WriteLine(CircuitCode + ":OUT: " + Pack.Type.ToString());
|
||||
|
||||
|
@ -245,7 +246,7 @@ namespace OpenSim.Region.ClientStack
|
|||
|
||||
protected void ResendUnacked()
|
||||
{
|
||||
int now = Environment.TickCount;
|
||||
int now = System.Environment.TickCount;
|
||||
|
||||
lock (NeedAck)
|
||||
{
|
||||
|
|
|
@ -36,6 +36,7 @@ using OpenSim.Framework.Servers;
|
|||
using OpenSim.Framework.Types;
|
||||
using OpenSim.Physics.Manager;
|
||||
using OpenSim.Region.Caches;
|
||||
using OpenSim.Region.Environment;
|
||||
|
||||
namespace OpenSim.Region.ClientStack
|
||||
{
|
||||
|
|
|
@ -39,6 +39,7 @@ using OpenSim.Framework.Servers;
|
|||
using OpenSim.Framework.Types;
|
||||
using OpenSim.Physics.Manager;
|
||||
using OpenSim.Region.Caches;
|
||||
using OpenSim.Region.Interfaces;
|
||||
using OpenSim.Region.Scripting;
|
||||
using OpenSim.Region.Terrain;
|
||||
using Caps = OpenSim.Region.Capabilities.Caps;
|
||||
|
@ -65,6 +66,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
protected AuthenticateSessionsBase authenticateHandler;
|
||||
protected RegionCommsListener regionCommsHost;
|
||||
protected CommunicationsManager commsManager;
|
||||
protected StorageManager storageManager;
|
||||
|
||||
protected Dictionary<LLUUID, Caps> capsHandlers = new Dictionary<LLUUID, Caps>();
|
||||
protected BaseHttpServer httpListener;
|
||||
|
@ -118,11 +120,12 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
/// <param name="clientThreads">Dictionary to contain client threads</param>
|
||||
/// <param name="regionHandle">Region Handle for this region</param>
|
||||
/// <param name="regionName">Region Name for this region</param>
|
||||
public Scene(ClientManager clientManager, RegionInfo regInfo, AuthenticateSessionsBase authen, CommunicationsManager commsMan, AssetCache assetCach, BaseHttpServer httpServer)
|
||||
public Scene(ClientManager clientManager, RegionInfo regInfo, AuthenticateSessionsBase authen, CommunicationsManager commsMan, AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer)
|
||||
{
|
||||
updateLock = new Mutex(false);
|
||||
this.authenticateHandler = authen;
|
||||
this.commsManager = commsMan;
|
||||
this.storageManager = storeManager;
|
||||
this.assetCache = assetCach;
|
||||
m_clientManager = clientManager;
|
||||
m_regInfo = regInfo;
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Communications;
|
||||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Region.Capabilities;
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
using OpenSim.Region.Interfaces;
|
||||
|
||||
using System.Reflection;
|
||||
|
||||
namespace OpenSim.Region.Environment
|
||||
{
|
||||
public class StorageManager
|
||||
{
|
||||
private IRegionDataStore m_dataStore;
|
||||
|
||||
public IRegionDataStore DataStore
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_dataStore;
|
||||
}
|
||||
}
|
||||
|
||||
public StorageManager(IRegionDataStore storage)
|
||||
{
|
||||
m_dataStore = storage;
|
||||
}
|
||||
|
||||
public StorageManager(string dllName, string dataStoreFile, string dataStoreDB)
|
||||
{
|
||||
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
|
||||
|
||||
foreach (Type pluginType in pluginAssembly.GetTypes())
|
||||
{
|
||||
if (pluginType.IsPublic)
|
||||
{
|
||||
if (!pluginType.IsAbstract)
|
||||
{
|
||||
Type typeInterface = pluginType.GetInterface("IRegionDataStore", true);
|
||||
|
||||
if (typeInterface != null)
|
||||
{
|
||||
IRegionDataStore plug = (IRegionDataStore)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
|
||||
plug.Initialise(dataStoreFile, dataStoreDB);
|
||||
|
||||
m_dataStore = plug;
|
||||
}
|
||||
|
||||
typeInterface = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pluginAssembly = null;
|
||||
|
||||
//TODO: Add checking and warning to make sure it initialised.
|
||||
}
|
||||
}
|
||||
}
|
|
@ -8,6 +8,8 @@ using OpenSim.Framework.Types;
|
|||
using OpenSim.Region.Caches;
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
using OpenSim.Region.Terrain;
|
||||
using OpenSim.Region.Environment;
|
||||
|
||||
using Avatar=OpenSim.Region.Environment.Scenes.ScenePresence;
|
||||
|
||||
namespace SimpleApp
|
||||
|
@ -16,8 +18,8 @@ namespace SimpleApp
|
|||
{
|
||||
private List<ScenePresence> m_avatars;
|
||||
|
||||
public MyWorld(ClientManager clientManager, RegionInfo regionInfo, AuthenticateSessionsBase authen, CommunicationsManager commsMan, AssetCache assetCach, BaseHttpServer httpServer)
|
||||
: base(clientManager, regionInfo, authen, commsMan, assetCach, httpServer)
|
||||
public MyWorld(ClientManager clientManager, RegionInfo regionInfo, AuthenticateSessionsBase authen, CommunicationsManager commsMan, AssetCache assetCach, StorageManager storeMan, BaseHttpServer httpServer)
|
||||
: base(clientManager, regionInfo, authen, commsMan, assetCach, storeMan, httpServer)
|
||||
{
|
||||
m_avatars = new List<Avatar>();
|
||||
}
|
||||
|
|
|
@ -60,7 +60,9 @@ namespace SimpleApp
|
|||
|
||||
RegionInfo regionInfo = new RegionInfo(1000, 1000, internalEndPoint, "127.0.0.1");
|
||||
|
||||
world = new MyWorld(packetServer.ClientManager, regionInfo, m_circuitManager, communicationsManager, assetCache, httpServer);
|
||||
OpenSim.Region.Environment.StorageManager storeMan = new OpenSim.Region.Environment.StorageManager("OpenSim.DataStore.NullStorage.dll", "simpleapp.yap", "simpleapp");
|
||||
|
||||
world = new MyWorld(packetServer.ClientManager, regionInfo, m_circuitManager, communicationsManager, assetCache, storeMan, httpServer);
|
||||
world.PhysScene = physManager.GetPhysicsScene("basicphysics"); //PhysicsScene.Null;
|
||||
|
||||
world.LoadWorldMap();
|
||||
|
|
|
@ -626,6 +626,7 @@
|
|||
<Reference name="Axiom.MathLib.dll"/>
|
||||
<Reference name="Db4objects.Db4o.dll"/>
|
||||
<Reference name="OpenSim.Region.Terrain.BasicTerrain"/>
|
||||
<Reference name="OpenSim.Region.Environment"/>
|
||||
<Reference name="OpenSim.Framework"/>
|
||||
<Reference name="OpenSim.Framework.Console"/>
|
||||
<Reference name="OpenSim.Region.Physics.Manager"/>
|
||||
|
|
Loading…
Reference in New Issue