Another attempt at fixing the disappearing estate_settings.xml file.

afrisby
Brian McBee 2007-09-11 21:41:26 +00:00
parent 71f94d8421
commit b521e5d219
1 changed files with 24 additions and 25 deletions

View File

@ -60,28 +60,31 @@ namespace OpenSim.Framework.Configuration
}
public void LoadData()
{
doc = new XmlDocument();
if (File.Exists(fileName))
lock (this)
{
XmlTextReader reader = new XmlTextReader(fileName);
reader.WhitespaceHandling = WhitespaceHandling.None;
doc.Load(reader);
reader.Close();
}
else
{
createdFile = true;
rootNode = doc.CreateNode(XmlNodeType.Element, "Root", "");
doc.AppendChild(rootNode);
configNode = doc.CreateNode(XmlNodeType.Element, "Config", "");
rootNode.AppendChild(configNode);
}
doc = new XmlDocument();
if (File.Exists(fileName))
{
XmlTextReader reader = new XmlTextReader(fileName);
reader.WhitespaceHandling = WhitespaceHandling.None;
doc.Load(reader);
reader.Close();
}
else
{
createdFile = true;
rootNode = doc.CreateNode(XmlNodeType.Element, "Root", "");
doc.AppendChild(rootNode);
configNode = doc.CreateNode(XmlNodeType.Element, "Config", "");
rootNode.AppendChild(configNode);
}
LoadDataToClass();
LoadDataToClass();
if (createdFile)
{
this.Commit();
if (createdFile)
{
this.Commit();
}
}
}
@ -123,12 +126,8 @@ namespace OpenSim.Framework.Configuration
if (!Directory.Exists(Util.configDir()))
{
Directory.CreateDirectory(Util.configDir());
}
lock(this)
{
doc.Save(fileName);
}
}
doc.Save(fileName);
}
public void Close()