diff options
Diffstat (limited to 'OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs')
-rw-r--r-- | OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index 70bafda..479a80e 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs | |||
@@ -63,12 +63,12 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
63 | 63 | ||
64 | protected override string AgentPath() | 64 | protected override string AgentPath() |
65 | { | 65 | { |
66 | return "foreignagent/"; | 66 | return "/foreignagent/"; |
67 | } | 67 | } |
68 | 68 | ||
69 | protected override string ObjectPath() | 69 | protected override string ObjectPath() |
70 | { | 70 | { |
71 | return "foreignobject/"; | 71 | return "/foreignobject/"; |
72 | } | 72 | } |
73 | 73 | ||
74 | public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle, out string externalName, out string imageURL, out string reason) | 74 | public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle, out string externalName, out string imageURL, out string reason) |
@@ -86,11 +86,12 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
86 | paramList.Add(hash); | 86 | paramList.Add(hash); |
87 | 87 | ||
88 | XmlRpcRequest request = new XmlRpcRequest("link_region", paramList); | 88 | XmlRpcRequest request = new XmlRpcRequest("link_region", paramList); |
89 | m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + info.ServerURI); | 89 | string uri = "http://" + ((info.ServerURI != null && info.ServerURI != string.Empty && !info.ServerURI.StartsWith("http:")) ? info.ServerURI : info.ExternalEndPoint.Address + ":" + info.HttpPort + "/"); |
90 | m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri); | ||
90 | XmlRpcResponse response = null; | 91 | XmlRpcResponse response = null; |
91 | try | 92 | try |
92 | { | 93 | { |
93 | response = request.Send(info.ServerURI, 10000); | 94 | response = request.Send(uri, 10000); |
94 | } | 95 | } |
95 | catch (Exception e) | 96 | catch (Exception e) |
96 | { | 97 | { |
@@ -107,8 +108,8 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
107 | } | 108 | } |
108 | 109 | ||
109 | hash = (Hashtable)response.Value; | 110 | hash = (Hashtable)response.Value; |
110 | foreach (Object o in hash) | 111 | //foreach (Object o in hash) |
111 | m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); | 112 | // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); |
112 | try | 113 | try |
113 | { | 114 | { |
114 | bool success = false; | 115 | bool success = false; |
@@ -116,20 +117,16 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
116 | if (success) | 117 | if (success) |
117 | { | 118 | { |
118 | UUID.TryParse((string)hash["uuid"], out regionID); | 119 | UUID.TryParse((string)hash["uuid"], out regionID); |
119 | m_log.Debug(">> HERE, uuid: " + regionID); | 120 | //m_log.Debug(">> HERE, uuid: " + uuid); |
120 | if ((string)hash["handle"] != null) | 121 | if ((string)hash["handle"] != null) |
121 | { | 122 | { |
122 | realHandle = Convert.ToUInt64((string)hash["handle"]); | 123 | realHandle = Convert.ToUInt64((string)hash["handle"]); |
123 | m_log.Debug(">> HERE, realHandle: " + realHandle); | 124 | //m_log.Debug(">> HERE, realHandle: " + realHandle); |
124 | } | 125 | } |
125 | if (hash["region_image"] != null) { | 126 | if (hash["region_image"] != null) |
126 | imageURL = (string)hash["region_image"]; | 127 | imageURL = (string)hash["region_image"]; |
127 | m_log.Debug(">> HERE, imageURL: " + imageURL); | 128 | if (hash["external_name"] != null) |
128 | } | ||
129 | if (hash["external_name"] != null) { | ||
130 | externalName = (string)hash["external_name"]; | 129 | externalName = (string)hash["external_name"]; |
131 | m_log.Debug(">> HERE, externalName: " + externalName); | ||
132 | } | ||
133 | } | 130 | } |
134 | 131 | ||
135 | } | 132 | } |
@@ -191,11 +188,12 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
191 | paramList.Add(hash); | 188 | paramList.Add(hash); |
192 | 189 | ||
193 | XmlRpcRequest request = new XmlRpcRequest("get_region", paramList); | 190 | XmlRpcRequest request = new XmlRpcRequest("get_region", paramList); |
194 | m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + gatekeeper.ServerURI); | 191 | string uri = "http://" + ((gatekeeper.ServerURI != null && gatekeeper.ServerURI != string.Empty && !gatekeeper.ServerURI.StartsWith("http:")) ? gatekeeper.ServerURI : gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/"); |
192 | m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + uri); | ||
195 | XmlRpcResponse response = null; | 193 | XmlRpcResponse response = null; |
196 | try | 194 | try |
197 | { | 195 | { |
198 | response = request.Send(gatekeeper.ServerURI, 10000); | 196 | response = request.Send(uri, 10000); |
199 | } | 197 | } |
200 | catch (Exception e) | 198 | catch (Exception e) |
201 | { | 199 | { |
@@ -221,48 +219,38 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
221 | GridRegion region = new GridRegion(); | 219 | GridRegion region = new GridRegion(); |
222 | 220 | ||
223 | UUID.TryParse((string)hash["uuid"], out region.RegionID); | 221 | UUID.TryParse((string)hash["uuid"], out region.RegionID); |
224 | m_log.Debug(">> HERE, uuid: " + region.RegionID); | 222 | //m_log.Debug(">> HERE, uuid: " + region.RegionID); |
225 | int n = 0; | 223 | int n = 0; |
226 | if (hash["x"] != null) | 224 | if (hash["x"] != null) |
227 | { | 225 | { |
228 | Int32.TryParse((string)hash["x"], out n); | 226 | Int32.TryParse((string)hash["x"], out n); |
229 | region.RegionLocX = n; | 227 | region.RegionLocX = n; |
230 | m_log.Debug(">> HERE, x: " + region.RegionLocX); | 228 | //m_log.Debug(">> HERE, x: " + region.RegionLocX); |
231 | } | 229 | } |
232 | if (hash["y"] != null) | 230 | if (hash["y"] != null) |
233 | { | 231 | { |
234 | Int32.TryParse((string)hash["y"], out n); | 232 | Int32.TryParse((string)hash["y"], out n); |
235 | region.RegionLocY = n; | 233 | region.RegionLocY = n; |
236 | m_log.Debug(">> HERE, y: " + region.RegionLocY); | 234 | //m_log.Debug(">> HERE, y: " + region.RegionLocY); |
237 | } | 235 | } |
238 | if (hash["region_name"] != null) | 236 | if (hash["region_name"] != null) |
239 | { | 237 | { |
240 | region.RegionName = (string)hash["region_name"]; | 238 | region.RegionName = (string)hash["region_name"]; |
241 | m_log.Debug(">> HERE, region_name: " + region.RegionName); | 239 | //m_log.Debug(">> HERE, name: " + region.RegionName); |
242 | } | 240 | } |
243 | if (hash["hostname"] != null) { | 241 | if (hash["hostname"] != null) |
244 | region.ExternalHostName = (string)hash["hostname"]; | 242 | region.ExternalHostName = (string)hash["hostname"]; |
245 | m_log.Debug(">> HERE, hostname: " + region.ExternalHostName); | ||
246 | } | ||
247 | if (hash["http_port"] != null) | 243 | if (hash["http_port"] != null) |
248 | { | 244 | { |
249 | uint p = 0; | 245 | uint p = 0; |
250 | UInt32.TryParse((string)hash["http_port"], out p); | 246 | UInt32.TryParse((string)hash["http_port"], out p); |
251 | region.HttpPort = p; | 247 | region.HttpPort = p; |
252 | m_log.Debug(">> HERE, http_port: " + region.HttpPort); | ||
253 | } | 248 | } |
254 | if (hash["internal_port"] != null) | 249 | if (hash["internal_port"] != null) |
255 | { | 250 | { |
256 | int p = 0; | 251 | int p = 0; |
257 | Int32.TryParse((string)hash["internal_port"], out p); | 252 | Int32.TryParse((string)hash["internal_port"], out p); |
258 | region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p); | 253 | region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p); |
259 | m_log.Debug(">> HERE, internal_port: " + region.InternalEndPoint); | ||
260 | } | ||
261 | |||
262 | if (hash["server_uri"] != null) | ||
263 | { | ||
264 | region.ServerURI = (string) hash["server_uri"]; | ||
265 | m_log.Debug(">> HERE, server_uri: " + region.ServerURI); | ||
266 | } | 254 | } |
267 | 255 | ||
268 | // Successful return | 256 | // Successful return |