aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Server/Handlers')
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs10
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs34
2 files changed, 3 insertions, 41 deletions
diff --git a/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs
index 940ec7a..c73b110 100644
--- a/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs
@@ -51,8 +51,6 @@ namespace OpenSim.Server.Handlers.Hypergrid
51 get { return m_GatekeeperService; } 51 get { return m_GatekeeperService; }
52 } 52 }
53 53
54 private IHypergridService m_HypergridService;
55
56 public GatekeeperServiceInConnector(IConfigSource config, IHttpServer server, ISimulationService simService) : 54 public GatekeeperServiceInConnector(IConfigSource config, IHttpServer server, ISimulationService simService) :
57 base(config, server, String.Empty) 55 base(config, server, String.Empty)
58 { 56 {
@@ -63,16 +61,12 @@ namespace OpenSim.Server.Handlers.Hypergrid
63 Object[] args = new Object[] { config, simService }; 61 Object[] args = new Object[] { config, simService };
64 m_GatekeeperService = ServerUtils.LoadPlugin<IGatekeeperService>(serviceDll, args); 62 m_GatekeeperService = ServerUtils.LoadPlugin<IGatekeeperService>(serviceDll, args);
65 63
66 serviceDll = gridConfig.GetString("HypergridService", string.Empty);
67 m_HypergridService = ServerUtils.LoadPlugin<IHypergridService>(serviceDll, args);
68
69 } 64 }
70 if (m_GatekeeperService == null || m_HypergridService == null) 65 if (m_GatekeeperService == null)
71 throw new Exception("Gatekeeper server connector cannot proceed because of missing service"); 66 throw new Exception("Gatekeeper server connector cannot proceed because of missing service");
72 67
73 HypergridHandlers hghandlers = new HypergridHandlers(m_GatekeeperService, m_HypergridService); 68 HypergridHandlers hghandlers = new HypergridHandlers(m_GatekeeperService);
74 server.AddXmlRPCHandler("link_region", hghandlers.LinkRegionRequest, false); 69 server.AddXmlRPCHandler("link_region", hghandlers.LinkRegionRequest, false);
75 server.AddXmlRPCHandler("link_region_by_desc", hghandlers.LinkRegionByDescRequest, false);
76 server.AddXmlRPCHandler("get_region", hghandlers.GetRegion, false); 70 server.AddXmlRPCHandler("get_region", hghandlers.GetRegion, false);
77 server.AddXmlRPCHandler("get_home_region", hghandlers.GetHomeRegion, false); 71 server.AddXmlRPCHandler("get_home_region", hghandlers.GetHomeRegion, false);
78 72
diff --git a/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs
index 1d711a8..846d1c2 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs
@@ -44,12 +44,10 @@ namespace OpenSim.Server.Handlers.Hypergrid
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 45
46 private IGatekeeperService m_GatekeeperService; 46 private IGatekeeperService m_GatekeeperService;
47 private IHypergridService m_HypergridService;
48 47
49 public HypergridHandlers(IGatekeeperService gatekeeper, IHypergridService hyper) 48 public HypergridHandlers(IGatekeeperService gatekeeper)
50 { 49 {
51 m_GatekeeperService = gatekeeper; 50 m_GatekeeperService = gatekeeper;
52 m_HypergridService = hyper;
53 } 51 }
54 52
55 /// <summary> 53 /// <summary>
@@ -82,36 +80,6 @@ namespace OpenSim.Server.Handlers.Hypergrid
82 return response; 80 return response;
83 } 81 }
84 82
85 /// <summary>
86 /// A local region wants to establish a grid-wide hyperlink to another region
87 /// </summary>
88 /// <param name="request"></param>
89 /// <returns></returns>
90 public XmlRpcResponse LinkRegionByDescRequest(XmlRpcRequest request, IPEndPoint remoteClient)
91 {
92 Hashtable requestData = (Hashtable)request.Params[0];
93 //string host = (string)requestData["host"];
94 //string portstr = (string)requestData["port"];
95 string descriptor = (string)requestData["region_desc"];
96
97 UUID regionID = UUID.Zero;
98 string imageURL = string.Empty;
99 ulong regionHandle = 0;
100 string reason = string.Empty;
101
102 bool success = m_HypergridService.LinkRegion(descriptor, out regionID, out regionHandle, out imageURL, out reason);
103
104 Hashtable hash = new Hashtable();
105 hash["result"] = success.ToString();
106 hash["uuid"] = regionID.ToString();
107 hash["handle"] = regionHandle.ToString();
108 hash["region_image"] = imageURL;
109
110 XmlRpcResponse response = new XmlRpcResponse();
111 response.Value = hash;
112 return response;
113 }
114
115 public XmlRpcResponse GetRegion(XmlRpcRequest request, IPEndPoint remoteClient) 83 public XmlRpcResponse GetRegion(XmlRpcRequest request, IPEndPoint remoteClient)
116 { 84 {
117 Hashtable requestData = (Hashtable)request.Params[0]; 85 Hashtable requestData = (Hashtable)request.Params[0];