diff options
Added support for a "excludeList" as part of the hypergrid xml link file loading. So that certain links in the file will be ignored. See the wiki's hypergrid page for details (in about a hour).
-rw-r--r-- | OpenSim/Region/Application/HGOpenSimNode.cs | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/OpenSim/Region/Application/HGOpenSimNode.cs b/OpenSim/Region/Application/HGOpenSimNode.cs index 11bdbbc..dcb8c15 100644 --- a/OpenSim/Region/Application/HGOpenSimNode.cs +++ b/OpenSim/Region/Application/HGOpenSimNode.cs | |||
@@ -145,19 +145,49 @@ namespace OpenSim | |||
145 | // link-region <Xloc> <Yloc> <HostName> <HttpPort> <LocalName> | 145 | // link-region <Xloc> <Yloc> <HostName> <HttpPort> <LocalName> |
146 | if (cmdparams.Length < 4) | 146 | if (cmdparams.Length < 4) |
147 | { | 147 | { |
148 | if (cmdparams.Length == 1) | 148 | if ((cmdparams.Length == 1) || (cmdparams.Length ==2)) |
149 | { | 149 | { |
150 | try | 150 | try |
151 | { | 151 | { |
152 | XmlReader r = XmlReader.Create(cmdparams[0]); | 152 | XmlReader r = XmlReader.Create(cmdparams[0]); |
153 | XmlConfigSource cs = new XmlConfigSource(r); | 153 | XmlConfigSource cs = new XmlConfigSource(r); |
154 | string[] excludeSections = null; | ||
155 | |||
156 | if (cmdparams.Length == 2) | ||
157 | { | ||
158 | if (cmdparams[1].StartsWith("excludeList:")) | ||
159 | { | ||
160 | string excludeString = cmdparams[1]; | ||
161 | excludeString = excludeString.Remove(0, 12); | ||
162 | char[] splitter = { ';' }; | ||
163 | |||
164 | excludeSections = excludeString.Split(splitter); | ||
165 | } | ||
166 | } | ||
167 | |||
154 | for (int i = 0; i < cs.Configs.Count; i++) | 168 | for (int i = 0; i < cs.Configs.Count; i++) |
155 | { | 169 | { |
156 | ReadLinkFromConfig(cs.Configs[i]); | 170 | bool skip = false; |
171 | if ((excludeSections != null) &&(excludeSections.Length > 0 )) | ||
172 | { | ||
173 | for (int n = 0; n < excludeSections.Length; n++) | ||
174 | { | ||
175 | if (excludeSections[n] == cs.Configs[i].Name) | ||
176 | { | ||
177 | skip = true; | ||
178 | break; | ||
179 | } | ||
180 | } | ||
181 | } | ||
182 | if (!skip) | ||
183 | { | ||
184 | ReadLinkFromConfig(cs.Configs[i]); | ||
185 | } | ||
157 | } | 186 | } |
158 | } | 187 | } |
159 | catch (Exception) | 188 | catch (Exception e) |
160 | { | 189 | { |
190 | Console.WriteLine(e.ToString()); | ||
161 | } | 191 | } |
162 | } | 192 | } |
163 | else | 193 | else |