aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/ExportSerialiser
diff options
context:
space:
mode:
authorAdam Frisby2008-04-17 11:42:06 +0000
committerAdam Frisby2008-04-17 11:42:06 +0000
commit05708771bb493ace1cf956acfa7a29610c8809e8 (patch)
treeeec5c7e1a89272b61b9c573c6e789b5732c21063 /OpenSim/Region/Environment/Modules/ExportSerialiser
parent* Added appropriate license.txt in ThirdPartyLicenses/ for APR. (diff)
downloadopensim-SC_OLD-05708771bb493ace1cf956acfa7a29610c8809e8.zip
opensim-SC_OLD-05708771bb493ace1cf956acfa7a29610c8809e8.tar.gz
opensim-SC_OLD-05708771bb493ace1cf956acfa7a29610c8809e8.tar.bz2
opensim-SC_OLD-05708771bb493ace1cf956acfa7a29610c8809e8.tar.xz
* 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.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/ExportSerialiser')
-rw-r--r--OpenSim/Region/Environment/Modules/ExportSerialiser/ExportSerialisationModule.cs11
1 files changed, 5 insertions, 6 deletions
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;
12 12
13namespace OpenSim.Region.Environment.Modules.ExportSerialiser 13namespace OpenSim.Region.Environment.Modules.ExportSerialiser
14{ 14{
15 public class ExportSerialisationModule : IRegionModule 15 public class ExportSerialisationModule : IRegionModule, OpenSim.Region.Environment.Modules.ExportSerialiser.IRegionSerialiser
16 { 16 {
17 private List<Scene> m_regions = new List<Scene>(); 17 private List<Scene> m_regions = new List<Scene>();
18 private List<IFileSerialiser> m_serialisers = new List<IFileSerialiser>(); 18 private List<IFileSerialiser> m_serialisers = new List<IFileSerialiser>();
19 private Commander m_commander = new Commander("Export"); 19 private Commander m_commander = new Commander("Export");
20 private string m_savedir = "exports" + "/"; 20 private string m_savedir = "exports" + "/";
21 21
22 private List<string> SerialiseRegion(Scene scene) 22 public List<string> SerialiseRegion(Scene scene, string saveDir)
23 { 23 {
24 List<string> results = new List<string>(); 24 List<string> results = new List<string>();
25 25
26 string saveDir = m_savedir + scene.RegionInfo.RegionID.ToString() + "/";
27
28 if (!Directory.Exists(saveDir)) 26 if (!Directory.Exists(saveDir))
29 { 27 {
30 Directory.CreateDirectory(saveDir); 28 Directory.CreateDirectory(saveDir);
@@ -62,6 +60,7 @@ namespace OpenSim.Region.Environment.Modules.ExportSerialiser
62 { 60 {
63 scene.RegisterModuleCommander("Export", m_commander); 61 scene.RegisterModuleCommander("Export", m_commander);
64 scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; 62 scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
63 scene.RegisterModuleInterface<IRegionSerialiser>(this);
65 64
66 lock (m_regions) 65 lock (m_regions)
67 { 66 {
@@ -88,7 +87,7 @@ namespace OpenSim.Region.Environment.Modules.ExportSerialiser
88 { 87 {
89 if (region.RegionInfo.RegionName == (string)args[0]) 88 if (region.RegionInfo.RegionName == (string)args[0])
90 { 89 {
91 List<string> results = SerialiseRegion(region); 90 List<string> results = SerialiseRegion(region, m_savedir + region.RegionInfo.RegionID.ToString() + "/");
92 } 91 }
93 } 92 }
94 } 93 }
@@ -97,7 +96,7 @@ namespace OpenSim.Region.Environment.Modules.ExportSerialiser
97 { 96 {
98 foreach (Scene region in m_regions) 97 foreach (Scene region in m_regions)
99 { 98 {
100 List<string> results = SerialiseRegion(region); 99 List<string> results = SerialiseRegion(region, m_savedir + region.RegionInfo.RegionID.ToString() + "/");
101 } 100 }
102 } 101 }
103 102