More on mantis #4985

0.7.0.2-release
Diva Canto 2010-08-26 14:48:29 -07:00
parent e41958ead9
commit 711747dd2c
1 changed files with 14 additions and 6 deletions

View File

@ -99,13 +99,21 @@ namespace OpenSim.Region.DataSnapshot
{ {
String path = DataFileNameFragment(provider.GetParentScene, provider.Name); String path = DataFileNameFragment(provider.GetParentScene, provider.Name);
using (XmlTextWriter snapXWriter = new XmlTextWriter(path, Encoding.Default)) try
{ {
snapXWriter.Formatting = Formatting.Indented; using (XmlTextWriter snapXWriter = new XmlTextWriter(path, Encoding.Default))
snapXWriter.WriteStartDocument(); {
data.WriteTo(snapXWriter); snapXWriter.Formatting = Formatting.Indented;
snapXWriter.WriteEndDocument(); snapXWriter.WriteStartDocument();
data.WriteTo(snapXWriter);
snapXWriter.WriteEndDocument();
}
} }
catch (Exception e)
{
m_log.WarnFormat("[DATASNAPSHOT]: Exception on writing to file {0}: {1}", path, e.Message);
}
} }
//mark provider as not stale, parent scene as stale //mark provider as not stale, parent scene as stale
@ -214,7 +222,7 @@ namespace OpenSim.Region.DataSnapshot
#region Helpers #region Helpers
private string DataFileNameFragment(Scene scene, String fragmentName) private string DataFileNameFragment(Scene scene, String fragmentName)
{ {
return Path.Combine(m_directory, Path.ChangeExtension(Sanitize(scene.RegionInfo.RegionName) + "_" + fragmentName, "xml")); return Path.Combine(m_directory, Path.ChangeExtension(Sanitize(scene.RegionInfo.RegionName + "_" + fragmentName), "xml"));
} }
private string DataFileNameScene(Scene scene) private string DataFileNameScene(Scene scene)