aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorMelanie2010-09-26 20:03:00 +0100
committerMelanie2010-09-26 20:03:00 +0100
commitdc49057c8a1cf99590aa3df25d4888d6dea54eaa (patch)
tree2ee56fee19a9bf4591989e840c253eaf4d6fbd6e /OpenSim/Region/CoreModules
parentAnother typo fix (diff)
downloadopensim-SC-dc49057c8a1cf99590aa3df25d4888d6dea54eaa.zip
opensim-SC-dc49057c8a1cf99590aa3df25d4888d6dea54eaa.tar.gz
opensim-SC-dc49057c8a1cf99590aa3df25d4888d6dea54eaa.tar.bz2
opensim-SC-dc49057c8a1cf99590aa3df25d4888d6dea54eaa.tar.xz
Consistency patch: use Path.Combine() instead of + and eliminate the need
for a trailing slash on exports/
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/World/Serialiser/SerialiseObjects.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Serialiser/SerialiseTerrain.cs5
-rw-r--r--OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs10
3 files changed, 9 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/SerialiseObjects.cs b/OpenSim/Region/CoreModules/World/Serialiser/SerialiseObjects.cs
index 5067ebd..328fbf0 100644
--- a/OpenSim/Region/CoreModules/World/Serialiser/SerialiseObjects.cs
+++ b/OpenSim/Region/CoreModules/World/Serialiser/SerialiseObjects.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser
41 41
42 public string WriteToFile(Scene scene, string dir) 42 public string WriteToFile(Scene scene, string dir)
43 { 43 {
44 string targetFileName = dir + "objects.xml"; 44 string targetFileName = Path.Combine(dir, "objects.xml");
45 45
46 SaveSerialisedToFile(targetFileName, scene); 46 SaveSerialisedToFile(targetFileName, scene);
47 47
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/SerialiseTerrain.cs b/OpenSim/Region/CoreModules/World/Serialiser/SerialiseTerrain.cs
index 5cbe66b..c04753d 100644
--- a/OpenSim/Region/CoreModules/World/Serialiser/SerialiseTerrain.cs
+++ b/OpenSim/Region/CoreModules/World/Serialiser/SerialiseTerrain.cs
@@ -28,6 +28,7 @@
28using OpenSim.Region.CoreModules.World.Terrain; 28using OpenSim.Region.CoreModules.World.Terrain;
29using OpenSim.Region.CoreModules.World.Terrain.FileLoaders; 29using OpenSim.Region.CoreModules.World.Terrain.FileLoaders;
30using OpenSim.Region.Framework.Scenes; 30using OpenSim.Region.Framework.Scenes;
31using System.IO;
31 32
32namespace OpenSim.Region.CoreModules.World.Serialiser 33namespace OpenSim.Region.CoreModules.World.Serialiser
33{ 34{
@@ -38,7 +39,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser
38 public string WriteToFile(Scene scene, string dir) 39 public string WriteToFile(Scene scene, string dir)
39 { 40 {
40 ITerrainLoader fileSystemExporter = new RAW32(); 41 ITerrainLoader fileSystemExporter = new RAW32();
41 string targetFileName = dir + "heightmap.r32"; 42 string targetFileName = Path.Combine(dir, "heightmap.r32");
42 43
43 lock (scene.Heightmap) 44 lock (scene.Heightmap)
44 { 45 {
@@ -50,4 +51,4 @@ namespace OpenSim.Region.CoreModules.World.Serialiser
50 51
51 #endregion 52 #endregion
52 } 53 }
53} \ No newline at end of file 54}
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs b/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs
index 98fe493..04062b0 100644
--- a/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs
+++ b/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs
@@ -48,7 +48,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser
48 48
49 private Commander m_commander = new Commander("export"); 49 private Commander m_commander = new Commander("export");
50 private List<Scene> m_regions = new List<Scene>(); 50 private List<Scene> m_regions = new List<Scene>();
51 private string m_savedir = "exports" + "/"; 51 private string m_savedir = "exports";
52 private List<IFileSerialiser> m_serialisers = new List<IFileSerialiser>(); 52 private List<IFileSerialiser> m_serialisers = new List<IFileSerialiser>();
53 53
54 #region ISharedRegionModule Members 54 #region ISharedRegionModule Members
@@ -192,14 +192,14 @@ namespace OpenSim.Region.CoreModules.World.Serialiser
192 } 192 }
193 } 193 }
194 194
195 TextWriter regionInfoWriter = new StreamWriter(saveDir + "README.TXT"); 195 TextWriter regionInfoWriter = new StreamWriter(Path.Combine(saveDir, "README.TXT"));
196 regionInfoWriter.WriteLine("Region Name: " + scene.RegionInfo.RegionName); 196 regionInfoWriter.WriteLine("Region Name: " + scene.RegionInfo.RegionName);
197 regionInfoWriter.WriteLine("Region ID: " + scene.RegionInfo.RegionID.ToString()); 197 regionInfoWriter.WriteLine("Region ID: " + scene.RegionInfo.RegionID.ToString());
198 regionInfoWriter.WriteLine("Backup Time: UTC " + DateTime.UtcNow.ToString()); 198 regionInfoWriter.WriteLine("Backup Time: UTC " + DateTime.UtcNow.ToString());
199 regionInfoWriter.WriteLine("Serialise Version: 0.1"); 199 regionInfoWriter.WriteLine("Serialise Version: 0.1");
200 regionInfoWriter.Close(); 200 regionInfoWriter.Close();
201 201
202 TextWriter manifestWriter = new StreamWriter(saveDir + "region.manifest"); 202 TextWriter manifestWriter = new StreamWriter(Path.Combine(saveDir, "region.manifest"));
203 foreach (string line in results) 203 foreach (string line in results)
204 { 204 {
205 manifestWriter.WriteLine(line); 205 manifestWriter.WriteLine(line);
@@ -231,7 +231,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser
231 if (region.RegionInfo.RegionName == (string) args[0]) 231 if (region.RegionInfo.RegionName == (string) args[0])
232 { 232 {
233 // List<string> results = SerialiseRegion(region, m_savedir + region.RegionInfo.RegionID.ToString() + "/"); 233 // List<string> results = SerialiseRegion(region, m_savedir + region.RegionInfo.RegionID.ToString() + "/");
234 SerialiseRegion(region, m_savedir + region.RegionInfo.RegionID.ToString() + "/"); 234 SerialiseRegion(region, Path.Combine(m_savedir, region.RegionInfo.RegionID.ToString()));
235 } 235 }
236 } 236 }
237 } 237 }
@@ -241,7 +241,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser
241 foreach (Scene region in m_regions) 241 foreach (Scene region in m_regions)
242 { 242 {
243 // List<string> results = SerialiseRegion(region, m_savedir + region.RegionInfo.RegionID.ToString() + "/"); 243 // List<string> results = SerialiseRegion(region, m_savedir + region.RegionInfo.RegionID.ToString() + "/");
244 SerialiseRegion(region, m_savedir + region.RegionInfo.RegionID.ToString() + "/"); 244 SerialiseRegion(region, Path.Combine(m_savedir, region.RegionInfo.RegionID.ToString()));
245 } 245 }
246 } 246 }
247 247