From 05708771bb493ace1cf956acfa7a29610c8809e8 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 17 Apr 2008 11:42:06 +0000 Subject: * Committing first version of SVN Backup Module This is a module which allows you to periodically export a serialised version of your region to a SVN repository and store it there. It is still a work in progress and is currently disabled and incomplete, but some of the functionality is demonstratable. * Enjoy. --- .../Modules/ExportSerialiser/ExportSerialisationModule.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Environment/Modules') diff --git a/OpenSim/Region/Environment/Modules/ExportSerialiser/ExportSerialisationModule.cs b/OpenSim/Region/Environment/Modules/ExportSerialiser/ExportSerialisationModule.cs index 8613e77..16d7484 100644 --- a/OpenSim/Region/Environment/Modules/ExportSerialiser/ExportSerialisationModule.cs +++ b/OpenSim/Region/Environment/Modules/ExportSerialiser/ExportSerialisationModule.cs @@ -12,19 +12,17 @@ using System.IO; namespace OpenSim.Region.Environment.Modules.ExportSerialiser { - public class ExportSerialisationModule : IRegionModule + public class ExportSerialisationModule : IRegionModule, OpenSim.Region.Environment.Modules.ExportSerialiser.IRegionSerialiser { private List m_regions = new List(); private List m_serialisers = new List(); private Commander m_commander = new Commander("Export"); private string m_savedir = "exports" + "/"; - private List SerialiseRegion(Scene scene) + public List SerialiseRegion(Scene scene, string saveDir) { List results = new List(); - string saveDir = m_savedir + scene.RegionInfo.RegionID.ToString() + "/"; - if (!Directory.Exists(saveDir)) { Directory.CreateDirectory(saveDir); @@ -62,6 +60,7 @@ namespace OpenSim.Region.Environment.Modules.ExportSerialiser { scene.RegisterModuleCommander("Export", m_commander); scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; + scene.RegisterModuleInterface(this); lock (m_regions) { @@ -88,7 +87,7 @@ namespace OpenSim.Region.Environment.Modules.ExportSerialiser { if (region.RegionInfo.RegionName == (string)args[0]) { - List results = SerialiseRegion(region); + List results = SerialiseRegion(region, m_savedir + region.RegionInfo.RegionID.ToString() + "/"); } } } @@ -97,7 +96,7 @@ namespace OpenSim.Region.Environment.Modules.ExportSerialiser { foreach (Scene region in m_regions) { - List results = SerialiseRegion(region); + List results = SerialiseRegion(region, m_savedir + region.RegionInfo.RegionID.ToString() + "/"); } } -- cgit v1.1