aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/DataSnapshot/SnapshotStore.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/DataSnapshot/SnapshotStore.cs')
-rw-r--r--OpenSim/Region/DataSnapshot/SnapshotStore.cs20
1 files changed, 14 insertions, 6 deletions
diff --git a/OpenSim/Region/DataSnapshot/SnapshotStore.cs b/OpenSim/Region/DataSnapshot/SnapshotStore.cs
index 3977394..aa3d2ff 100644
--- a/OpenSim/Region/DataSnapshot/SnapshotStore.cs
+++ b/OpenSim/Region/DataSnapshot/SnapshotStore.cs
@@ -99,13 +99,21 @@ namespace OpenSim.Region.DataSnapshot
99 { 99 {
100 String path = DataFileNameFragment(provider.GetParentScene, provider.Name); 100 String path = DataFileNameFragment(provider.GetParentScene, provider.Name);
101 101
102 using (XmlTextWriter snapXWriter = new XmlTextWriter(path, Encoding.Default)) 102 try
103 { 103 {
104 snapXWriter.Formatting = Formatting.Indented; 104 using (XmlTextWriter snapXWriter = new XmlTextWriter(path, Encoding.Default))
105 snapXWriter.WriteStartDocument(); 105 {
106 data.WriteTo(snapXWriter); 106 snapXWriter.Formatting = Formatting.Indented;
107 snapXWriter.WriteEndDocument(); 107 snapXWriter.WriteStartDocument();
108 data.WriteTo(snapXWriter);
109 snapXWriter.WriteEndDocument();
110 }
108 } 111 }
112 catch (Exception e)
113 {
114 m_log.WarnFormat("[DATASNAPSHOT]: Exception on writing to file {0}: {1}", path, e.Message);
115 }
116
109 } 117 }
110 118
111 //mark provider as not stale, parent scene as stale 119 //mark provider as not stale, parent scene as stale
@@ -214,7 +222,7 @@ namespace OpenSim.Region.DataSnapshot
214 #region Helpers 222 #region Helpers
215 private string DataFileNameFragment(Scene scene, String fragmentName) 223 private string DataFileNameFragment(Scene scene, String fragmentName)
216 { 224 {
217 return Path.Combine(m_directory, Path.ChangeExtension(Sanitize(scene.RegionInfo.RegionName) + "_" + fragmentName, "xml")); 225 return Path.Combine(m_directory, Path.ChangeExtension(Sanitize(scene.RegionInfo.RegionName + "_" + fragmentName), "xml"));
218 } 226 }
219 227
220 private string DataFileNameScene(Scene scene) 228 private string DataFileNameScene(Scene scene)