diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Hypergrid/HGHyperlink.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Hypergrid/HGHyperlink.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGHyperlink.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGHyperlink.cs index ad98273..e05b001 100644 --- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGHyperlink.cs +++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGHyperlink.cs | |||
@@ -149,6 +149,48 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid | |||
149 | return true; | 149 | return true; |
150 | } | 150 | } |
151 | 151 | ||
152 | public static bool TryUnlinkRegion(Scene m_scene, string mapName) | ||
153 | { | ||
154 | RegionInfo regInfo = null; | ||
155 | if (mapName.Contains(":")) | ||
156 | { | ||
157 | string host = "127.0.0.1"; | ||
158 | string portstr; | ||
159 | string regionName = ""; | ||
160 | uint port = 9000; | ||
161 | string[] parts = mapName.Split(new char[] { ':' }); | ||
162 | if (parts.Length >= 1) | ||
163 | { | ||
164 | host = parts[0]; | ||
165 | } | ||
166 | if (parts.Length >= 2) | ||
167 | { | ||
168 | portstr = parts[1]; | ||
169 | if (!UInt32.TryParse(portstr, out port)) | ||
170 | regionName = parts[1]; | ||
171 | } | ||
172 | // always take the last one | ||
173 | if (parts.Length >= 3) | ||
174 | { | ||
175 | regionName = parts[2]; | ||
176 | } | ||
177 | regInfo = m_scene.CommsManager.GridService.RequestNeighbourInfo(host, port); | ||
178 | } | ||
179 | else | ||
180 | { | ||
181 | regInfo = m_scene.CommsManager.GridService.RequestNeighbourInfo(mapName); | ||
182 | } | ||
183 | if (regInfo != null) | ||
184 | { | ||
185 | return m_scene.CommsManager.GridService.DeregisterRegion(regInfo); | ||
186 | } | ||
187 | else | ||
188 | { | ||
189 | m_log.InfoFormat("[HGrid]: Region {0} not found", mapName); | ||
190 | return false; | ||
191 | } | ||
192 | } | ||
193 | |||
152 | /// <summary> | 194 | /// <summary> |
153 | /// Cope with this viewer limitation. | 195 | /// Cope with this viewer limitation. |
154 | /// </summary> | 196 | /// </summary> |