diff --git a/OpenSim/Region/Application/HGOpenSimNode.cs b/OpenSim/Region/Application/HGOpenSimNode.cs index dcb8c15485..f46c9e373e 100644 --- a/OpenSim/Region/Application/HGOpenSimNode.cs +++ b/OpenSim/Region/Application/HGOpenSimNode.cs @@ -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;