mirror of
https://github.com/opensim/opensim.git
synced 2026-05-19 14:35:44 +08:00
Added preliminary IRegionModule interface. Also have a work in progress way of Modules registering optional API methods (kind of like Apache optional functions). But there must be a cleaner/nicer way in c# of doing these than the current way. Added three work in progress modules: ChatModule (simple handles in world chat, but by moving this to a module, we could support other types of chat modules, ie like a irc - opensim bridge module. ) , AvatarProfilesModule and XferModule. Moved most of the code from Scene.ModifyTerrain() into the BasicTerrain library, as the start of trying to make that more modular. Stopped Child agents showing up as part of the "show users" command.
64 lines
1.8 KiB
C#
64 lines
1.8 KiB
C#
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.Environment.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)
|
|
{
|
|
OpenSim.Framework.Console.MainLog.Instance.Verbose("DATASTORE", "Attempting to load " + dllName);
|
|
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
|
|
|
|
foreach (Type pluginType in pluginAssembly.GetTypes())
|
|
{
|
|
if (pluginType.IsPublic)
|
|
{
|
|
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;
|
|
|
|
OpenSim.Framework.Console.MainLog.Instance.Verbose("DATASTORE", "Added IRegionDataStore Interface");
|
|
}
|
|
|
|
typeInterface = null;
|
|
}
|
|
}
|
|
|
|
pluginAssembly = null;
|
|
|
|
//TODO: Add checking and warning to make sure it initialised.
|
|
}
|
|
}
|
|
}
|