mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
Small bit of refactoring related to the hypergrid link loading from xml files.
This commit is contained in:
@@ -147,48 +147,7 @@ namespace OpenSim
|
||||
{
|
||||
if ((cmdparams.Length == 1) || (cmdparams.Length ==2))
|
||||
{
|
||||
try
|
||||
{
|
||||
XmlReader r = XmlReader.Create(cmdparams[0]);
|
||||
XmlConfigSource cs = new XmlConfigSource(r);
|
||||
string[] excludeSections = null;
|
||||
|
||||
if (cmdparams.Length == 2)
|
||||
{
|
||||
if (cmdparams[1].StartsWith("excludeList:"))
|
||||
{
|
||||
string excludeString = cmdparams[1];
|
||||
excludeString = excludeString.Remove(0, 12);
|
||||
char[] splitter = { ';' };
|
||||
|
||||
excludeSections = excludeString.Split(splitter);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < cs.Configs.Count; i++)
|
||||
{
|
||||
bool skip = false;
|
||||
if ((excludeSections != null) &&(excludeSections.Length > 0 ))
|
||||
{
|
||||
for (int n = 0; n < excludeSections.Length; n++)
|
||||
{
|
||||
if (excludeSections[n] == cs.Configs[i].Name)
|
||||
{
|
||||
skip = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!skip)
|
||||
{
|
||||
ReadLinkFromConfig(cs.Configs[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
}
|
||||
LoadXmlLinkFile(cmdparams);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -234,6 +193,52 @@ namespace OpenSim
|
||||
|
||||
}
|
||||
|
||||
private void LoadXmlLinkFile(string[] cmdparams)
|
||||
{
|
||||
try
|
||||
{
|
||||
XmlReader r = XmlReader.Create(cmdparams[0]);
|
||||
XmlConfigSource cs = new XmlConfigSource(r);
|
||||
string[] excludeSections = null;
|
||||
|
||||
if (cmdparams.Length == 2)
|
||||
{
|
||||
if (cmdparams[1].StartsWith("excludeList:"))
|
||||
{
|
||||
string excludeString = cmdparams[1];
|
||||
excludeString = excludeString.Remove(0, 12);
|
||||
char[] splitter = { ';' };
|
||||
|
||||
excludeSections = excludeString.Split(splitter);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < cs.Configs.Count; i++)
|
||||
{
|
||||
bool skip = false;
|
||||
if ((excludeSections != null) && (excludeSections.Length > 0))
|
||||
{
|
||||
for (int n = 0; n < excludeSections.Length; n++)
|
||||
{
|
||||
if (excludeSections[n] == cs.Configs[i].Name)
|
||||
{
|
||||
skip = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!skip)
|
||||
{
|
||||
ReadLinkFromConfig(cs.Configs[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void ReadLinkFromConfig(IConfig config)
|
||||
{
|
||||
RegionInfo regInfo;
|
||||
|
||||
Reference in New Issue
Block a user