Merge branch 'master' of ssh://MyConnection/var/git/opensim

remotes/origin/0.6.7-post-fixes
Teravus Ovares (Dan Olivares) 2009-09-01 19:39:07 -04:00
commit 2fc3f61a42
5 changed files with 49 additions and 17 deletions

View File

@ -8,6 +8,7 @@
</Dependencies> </Dependencies>
<Extension path = "/OpenSim/RegionModules"> <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="ArchiverModule" type="OpenSim.Region.CoreModules.World.Archiver.ArchiverModule" />
<RegionModule id="CapabilitiesModule" type="OpenSim.Region.CoreModules.Agent.Capabilities.CapabilitiesModule" /> <RegionModule id="CapabilitiesModule" type="OpenSim.Region.CoreModules.Agent.Capabilities.CapabilitiesModule" />
<RegionModule id="TerrainModule" type="OpenSim.Region.CoreModules.World.Terrain.TerrainModule" /> <RegionModule id="TerrainModule" type="OpenSim.Region.CoreModules.World.Terrain.TerrainModule" />

View File

@ -28,7 +28,11 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Reflection;
using log4net;
using Nini.Config; using Nini.Config;
using OpenMetaverse; using OpenMetaverse;
using OpenSim.Region.CoreModules.Framework.InterfaceCommander; using OpenSim.Region.CoreModules.Framework.InterfaceCommander;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
@ -37,25 +41,32 @@ using OpenSim.Region.Framework.Scenes.Serialization;
namespace OpenSim.Region.CoreModules.World.Serialiser 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 Commander m_commander = new Commander("export");
private List<Scene> m_regions = new List<Scene>(); private List<Scene> m_regions = new List<Scene>();
private string m_savedir = "exports" + "/"; private string m_savedir = "exports" + "/";
private List<IFileSerialiser> m_serialisers = new List<IFileSerialiser>(); 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); get { return null; }
scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
scene.RegisterModuleInterface<IRegionSerialiserModule>(this);
lock (m_regions)
{
m_regions.Add(scene);
} }
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() public void PostInitialise()
@ -69,6 +80,31 @@ namespace OpenSim.Region.CoreModules.World.Serialiser
LoadCommanderCommands(); 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() public void Close()
{ {
m_regions.Clear(); m_regions.Clear();
@ -79,13 +115,9 @@ namespace OpenSim.Region.CoreModules.World.Serialiser
get { return "ExportSerialisationModule"; } get { return "ExportSerialisationModule"; }
} }
public bool IsSharedModule
{
get { return true; }
}
#endregion #endregion
#region IRegionSerialiser Members #region IRegionSerialiser Members
public void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, Vector3 loadOffset) public void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, Vector3 loadOffset)

View File

@ -367,7 +367,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
presence2.AddAttachment(sog1); presence2.AddAttachment(sog1);
presence2.AddAttachment(sog2); presence2.AddAttachment(sog2);
IRegionModule serialiser = new SerialiserModule(); ISharedRegionModule serialiser = new SerialiserModule();
SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), serialiser); SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), serialiser);
SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), serialiser); SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), serialiser);

View File

@ -65,7 +65,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
m_log.Info("[RegionReady] Initialising"); m_log.Info("[RegionReady] Initialising");
m_config = config.Configs["RegionReady"]; m_config = config.Configs["RegionReady"];
if (m_config != null) if (m_config != null)
{ {
m_enabled = m_config.GetBoolean("enabled", false); m_enabled = m_config.GetBoolean("enabled", false);

View File

@ -248,7 +248,7 @@ namespace OpenSim.Tests.Common.Setup
/// <param name="modules"></param> /// <param name="modules"></param>
public static void SetupSceneModules(Scene scene, params object[] modules) public static void SetupSceneModules(Scene scene, params object[] modules)
{ {
SetupSceneModules(scene, null, modules); SetupSceneModules(scene, new IniConfigSource(), modules);
} }
/// <summary> /// <summary>