From 9fbcceb1db84e62eedb75b2bd43f5e59142ec6c8 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 18 Jan 2010 20:35:59 -0800 Subject: * Towards enabling hyperlinks at grid-level. * Updated grid configs --- .../Server/Handlers/Hypergrid/HypergridHandlers.cs | 34 +++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs') diff --git a/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs index 846d1c2..1d711a8 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs @@ -44,10 +44,12 @@ namespace OpenSim.Server.Handlers.Hypergrid private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private IGatekeeperService m_GatekeeperService; + private IHypergridService m_HypergridService; - public HypergridHandlers(IGatekeeperService gatekeeper) + public HypergridHandlers(IGatekeeperService gatekeeper, IHypergridService hyper) { m_GatekeeperService = gatekeeper; + m_HypergridService = hyper; } /// @@ -80,6 +82,36 @@ namespace OpenSim.Server.Handlers.Hypergrid return response; } + /// + /// A local region wants to establish a grid-wide hyperlink to another region + /// + /// + /// + public XmlRpcResponse LinkRegionByDescRequest(XmlRpcRequest request, IPEndPoint remoteClient) + { + Hashtable requestData = (Hashtable)request.Params[0]; + //string host = (string)requestData["host"]; + //string portstr = (string)requestData["port"]; + string descriptor = (string)requestData["region_desc"]; + + UUID regionID = UUID.Zero; + string imageURL = string.Empty; + ulong regionHandle = 0; + string reason = string.Empty; + + bool success = m_HypergridService.LinkRegion(descriptor, out regionID, out regionHandle, out imageURL, out reason); + + Hashtable hash = new Hashtable(); + hash["result"] = success.ToString(); + hash["uuid"] = regionID.ToString(); + hash["handle"] = regionHandle.ToString(); + hash["region_image"] = imageURL; + + XmlRpcResponse response = new XmlRpcResponse(); + response.Value = hash; + return response; + } + public XmlRpcResponse GetRegion(XmlRpcRequest request, IPEndPoint remoteClient) { Hashtable requestData = (Hashtable)request.Params[0]; -- cgit v1.1