Merge branch 'master' of ssh://MyConnection/var/git/opensim
commit
2fc3f61a42
|
@ -8,6 +8,7 @@
|
|||
</Dependencies>
|
||||
|
||||
<Extension path = "/OpenSim/RegionModules">
|
||||
<RegionModule id="ExportSerialisationModule" type="OpenSim.Region.CoreModules.World.Serialiser.SerialiserModule" />
|
||||
<RegionModule id="ArchiverModule" type="OpenSim.Region.CoreModules.World.Archiver.ArchiverModule" />
|
||||
<RegionModule id="CapabilitiesModule" type="OpenSim.Region.CoreModules.Agent.Capabilities.CapabilitiesModule" />
|
||||
<RegionModule id="TerrainModule" type="OpenSim.Region.CoreModules.World.Terrain.TerrainModule" />
|
||||
|
|
|
@ -28,7 +28,11 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Region.CoreModules.Framework.InterfaceCommander;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
|
@ -37,25 +41,32 @@ using OpenSim.Region.Framework.Scenes.Serialization;
|
|||
|
||||
namespace OpenSim.Region.CoreModules.World.Serialiser
|
||||
{
|
||||
public class SerialiserModule : IRegionModule, IRegionSerialiserModule
|
||||
public class SerialiserModule : ISharedRegionModule, IRegionSerialiserModule
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private Commander m_commander = new Commander("export");
|
||||
private List<Scene> m_regions = new List<Scene>();
|
||||
private string m_savedir = "exports" + "/";
|
||||
private List<IFileSerialiser> m_serialisers = new List<IFileSerialiser>();
|
||||
|
||||
#region IRegionModule Members
|
||||
#region ISharedRegionModule Members
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
scene.RegisterModuleCommander(m_commander);
|
||||
scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
|
||||
scene.RegisterModuleInterface<IRegionSerialiserModule>(this);
|
||||
|
||||
lock (m_regions)
|
||||
{
|
||||
m_regions.Add(scene);
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
IConfig config = source.Configs["Serialiser"];
|
||||
if (config != null)
|
||||
{
|
||||
m_savedir = config.GetString("save_dir", m_savedir);
|
||||
}
|
||||
|
||||
m_log.InfoFormat("[Serialiser] Enabled, using save dir \"{0}\"", m_savedir);
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
|
@ -69,6 +80,31 @@ namespace OpenSim.Region.CoreModules.World.Serialiser
|
|||
LoadCommanderCommands();
|
||||
}
|
||||
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
scene.RegisterModuleCommander(m_commander);
|
||||
scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
|
||||
scene.RegisterModuleInterface<IRegionSerialiserModule>(this);
|
||||
|
||||
lock (m_regions)
|
||||
{
|
||||
m_regions.Add(scene);
|
||||
}
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
lock (m_regions)
|
||||
{
|
||||
m_regions.Remove(scene);
|
||||
}
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
m_regions.Clear();
|
||||
|
@ -79,13 +115,9 @@ namespace OpenSim.Region.CoreModules.World.Serialiser
|
|||
get { return "ExportSerialisationModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region IRegionSerialiser Members
|
||||
|
||||
public void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, Vector3 loadOffset)
|
||||
|
|
|
@ -367,7 +367,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
presence2.AddAttachment(sog1);
|
||||
presence2.AddAttachment(sog2);
|
||||
|
||||
IRegionModule serialiser = new SerialiserModule();
|
||||
ISharedRegionModule serialiser = new SerialiserModule();
|
||||
SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), serialiser);
|
||||
SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), serialiser);
|
||||
|
||||
|
|
|
@ -65,7 +65,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
|||
m_log.Info("[RegionReady] Initialising");
|
||||
|
||||
m_config = config.Configs["RegionReady"];
|
||||
|
||||
if (m_config != null)
|
||||
{
|
||||
m_enabled = m_config.GetBoolean("enabled", false);
|
||||
|
|
|
@ -248,7 +248,7 @@ namespace OpenSim.Tests.Common.Setup
|
|||
/// <param name="modules"></param>
|
||||
public static void SetupSceneModules(Scene scene, params object[] modules)
|
||||
{
|
||||
SetupSceneModules(scene, null, modules);
|
||||
SetupSceneModules(scene, new IniConfigSource(), modules);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue