From a7d610ffcca8d707c7f9e9fdd7ad1477981ec2a9 Mon Sep 17 00:00:00 2001 From: diva Date: Wed, 18 Mar 2009 16:37:26 +0000 Subject: Adds support for unlink-region command in hypergrid. --- .../Framework/Scenes/Hypergrid/HGHyperlink.cs | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/Hypergrid') 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 return true; } + public static bool TryUnlinkRegion(Scene m_scene, string mapName) + { + RegionInfo regInfo = null; + if (mapName.Contains(":")) + { + string host = "127.0.0.1"; + string portstr; + string regionName = ""; + uint port = 9000; + string[] parts = mapName.Split(new char[] { ':' }); + if (parts.Length >= 1) + { + host = parts[0]; + } + if (parts.Length >= 2) + { + portstr = parts[1]; + if (!UInt32.TryParse(portstr, out port)) + regionName = parts[1]; + } + // always take the last one + if (parts.Length >= 3) + { + regionName = parts[2]; + } + regInfo = m_scene.CommsManager.GridService.RequestNeighbourInfo(host, port); + } + else + { + regInfo = m_scene.CommsManager.GridService.RequestNeighbourInfo(mapName); + } + if (regInfo != null) + { + return m_scene.CommsManager.GridService.DeregisterRegion(regInfo); + } + else + { + m_log.InfoFormat("[HGrid]: Region {0} not found", mapName); + return false; + } + } + /// /// Cope with this viewer limitation. /// -- cgit v1.1