mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
*Added configuration plugin (OpenSim.Framework.Configuration.HTTP.dll) that fetches a file from a remote server
*Right now, values are not saved back to the remote server, but that will be changed *Removed some warnings from invalid references that were not used anyways
This commit is contained in:
@@ -47,10 +47,19 @@ namespace OpenSim.Framework.Configuration
|
||||
fileName = file;
|
||||
}
|
||||
|
||||
private void LoadDataToClass()
|
||||
{
|
||||
rootNode = doc.FirstChild;
|
||||
if (rootNode.Name != "Root")
|
||||
throw new Exception("Error: Invalid .xml File. Missing <Root>");
|
||||
|
||||
configNode = rootNode.FirstChild;
|
||||
if (configNode.Name != "Config")
|
||||
throw new Exception("Error: Invalid .xml File. <Root> first child should be <Config>");
|
||||
}
|
||||
public void LoadData()
|
||||
{
|
||||
doc = new XmlDocument();
|
||||
|
||||
if (File.Exists(fileName))
|
||||
{
|
||||
XmlTextReader reader = new XmlTextReader(fileName);
|
||||
@@ -67,14 +76,7 @@ namespace OpenSim.Framework.Configuration
|
||||
rootNode.AppendChild(configNode);
|
||||
}
|
||||
|
||||
|
||||
rootNode = doc.FirstChild;
|
||||
if (rootNode.Name != "Root")
|
||||
throw new Exception("Error: Invalid .xml File. Missing <Root>");
|
||||
|
||||
configNode = rootNode.FirstChild;
|
||||
if (configNode.Name != "Config")
|
||||
throw new Exception("Error: Invalid .xml File. <Root> first child should be <Config>");
|
||||
LoadDataToClass();
|
||||
|
||||
if (createdFile)
|
||||
{
|
||||
@@ -82,6 +84,13 @@ namespace OpenSim.Framework.Configuration
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadDataFromString(string data)
|
||||
{
|
||||
doc = new XmlDocument();
|
||||
doc.LoadXml(data);
|
||||
|
||||
LoadDataToClass();
|
||||
}
|
||||
public string GetAttribute(string attributeName)
|
||||
{
|
||||
string result = null;
|
||||
|
||||
Reference in New Issue
Block a user