aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Hypergrid
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/Connectors/Hypergrid')
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs272
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs397
2 files changed, 669 insertions, 0 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
new file mode 100644
index 0000000..c426bba
--- /dev/null
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -0,0 +1,272 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections;
30using System.Collections.Generic;
31using System.Drawing;
32using System.Net;
33using System.Reflection;
34
35using OpenSim.Framework;
36using OpenSim.Services.Interfaces;
37using GridRegion = OpenSim.Services.Interfaces.GridRegion;
38
39using OpenMetaverse;
40using OpenMetaverse.Imaging;
41using Nwc.XmlRpc;
42using log4net;
43
44using OpenSim.Services.Connectors.Simulation;
45
46namespace OpenSim.Services.Connectors.Hypergrid
47{
48 public class GatekeeperServiceConnector : SimulationServiceConnector
49 {
50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
51
52 private static UUID m_HGMapImage = new UUID("00000000-0000-1111-9999-000000000013");
53
54 private IAssetService m_AssetService;
55
56 public GatekeeperServiceConnector() : base()
57 {
58 }
59
60 public GatekeeperServiceConnector(IAssetService assService)
61 {
62 m_AssetService = assService;
63 }
64
65 protected override string AgentPath()
66 {
67 return "/foreignagent/";
68 }
69
70 protected override string ObjectPath()
71 {
72 return "/foreignobject/";
73 }
74
75 public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle, out string externalName, out string imageURL, out string reason)
76 {
77 regionID = UUID.Zero;
78 imageURL = string.Empty;
79 realHandle = 0;
80 externalName = string.Empty;
81 reason = string.Empty;
82
83 Hashtable hash = new Hashtable();
84 hash["region_name"] = info.RegionName;
85
86 IList paramList = new ArrayList();
87 paramList.Add(hash);
88
89 XmlRpcRequest request = new XmlRpcRequest("link_region", paramList);
90 string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/";
91 //m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri);
92 XmlRpcResponse response = null;
93 try
94 {
95 response = request.Send(uri, 10000);
96 }
97 catch (Exception e)
98 {
99 m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Exception " + e.Message);
100 reason = "Error contacting remote server";
101 return false;
102 }
103
104 if (response.IsFault)
105 {
106 reason = response.FaultString;
107 m_log.ErrorFormat("[GATEKEEPER SERVICE CONNECTOR]: remote call returned an error: {0}", response.FaultString);
108 return false;
109 }
110
111 hash = (Hashtable)response.Value;
112 //foreach (Object o in hash)
113 // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
114 try
115 {
116 bool success = false;
117 Boolean.TryParse((string)hash["result"], out success);
118 if (success)
119 {
120 UUID.TryParse((string)hash["uuid"], out regionID);
121 //m_log.Debug(">> HERE, uuid: " + uuid);
122 if ((string)hash["handle"] != null)
123 {
124 realHandle = Convert.ToUInt64((string)hash["handle"]);
125 //m_log.Debug(">> HERE, realHandle: " + realHandle);
126 }
127 if (hash["region_image"] != null)
128 imageURL = (string)hash["region_image"];
129 if (hash["external_name"] != null)
130 externalName = (string)hash["external_name"];
131 }
132
133 }
134 catch (Exception e)
135 {
136 reason = "Error parsing return arguments";
137 m_log.Error("[GATEKEEPER SERVICE CONNECTOR]: Got exception while parsing hyperlink response " + e.StackTrace);
138 return false;
139 }
140
141 return true;
142 }
143
144 UUID m_MissingTexture = new UUID("5748decc-f629-461c-9a36-a35a221fe21f");
145
146 public UUID GetMapImage(UUID regionID, string imageURL)
147 {
148 if (m_AssetService == null)
149 return m_MissingTexture;
150
151 try
152 {
153
154 WebClient c = new WebClient();
155 //m_log.Debug("JPEG: " + imageURL);
156 string filename = regionID.ToString();
157 c.DownloadFile(imageURL, filename + ".jpg");
158 Bitmap m = new Bitmap(filename + ".jpg");
159 //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width);
160 byte[] imageData = OpenJPEG.EncodeFromImage(m, true);
161 AssetBase ass = new AssetBase(UUID.Random(), "region " + filename, (sbyte)AssetType.Texture, regionID.ToString());
162
163 // !!! for now
164 //info.RegionSettings.TerrainImageID = ass.FullID;
165
166 ass.Temporary = true;
167 ass.Local = true;
168 ass.Data = imageData;
169
170 m_AssetService.Store(ass);
171
172 // finally
173 return ass.FullID;
174
175 }
176 catch // LEGIT: Catching problems caused by OpenJPEG p/invoke
177 {
178 m_log.Warn("[GATEKEEPER SERVICE CONNECTOR]: Failed getting/storing map image, because it is probably already in the cache");
179 }
180 return UUID.Zero;
181 }
182
183 public GridRegion GetHyperlinkRegion(GridRegion gatekeeper, UUID regionID)
184 {
185 Hashtable hash = new Hashtable();
186 hash["region_uuid"] = regionID.ToString();
187
188 IList paramList = new ArrayList();
189 paramList.Add(hash);
190
191 XmlRpcRequest request = new XmlRpcRequest("get_region", paramList);
192 string uri = "http://" + gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/";
193 m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + uri);
194 XmlRpcResponse response = null;
195 try
196 {
197 response = request.Send(uri, 10000);
198 }
199 catch (Exception e)
200 {
201 m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Exception " + e.Message);
202 return null;
203 }
204
205 if (response.IsFault)
206 {
207 m_log.ErrorFormat("[GATEKEEPER SERVICE CONNECTOR]: remote call returned an error: {0}", response.FaultString);
208 return null;
209 }
210
211 hash = (Hashtable)response.Value;
212 //foreach (Object o in hash)
213 // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
214 try
215 {
216 bool success = false;
217 Boolean.TryParse((string)hash["result"], out success);
218 if (success)
219 {
220 GridRegion region = new GridRegion();
221
222 UUID.TryParse((string)hash["uuid"], out region.RegionID);
223 //m_log.Debug(">> HERE, uuid: " + region.RegionID);
224 int n = 0;
225 if (hash["x"] != null)
226 {
227 Int32.TryParse((string)hash["x"], out n);
228 region.RegionLocX = n;
229 //m_log.Debug(">> HERE, x: " + region.RegionLocX);
230 }
231 if (hash["y"] != null)
232 {
233 Int32.TryParse((string)hash["y"], out n);
234 region.RegionLocY = n;
235 //m_log.Debug(">> HERE, y: " + region.RegionLocY);
236 }
237 if (hash["region_name"] != null)
238 {
239 region.RegionName = (string)hash["region_name"];
240 //m_log.Debug(">> HERE, name: " + region.RegionName);
241 }
242 if (hash["hostname"] != null)
243 region.ExternalHostName = (string)hash["hostname"];
244 if (hash["http_port"] != null)
245 {
246 uint p = 0;
247 UInt32.TryParse((string)hash["http_port"], out p);
248 region.HttpPort = p;
249 }
250 if (hash["internal_port"] != null)
251 {
252 int p = 0;
253 Int32.TryParse((string)hash["internal_port"], out p);
254 region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p);
255 }
256
257 // Successful return
258 return region;
259 }
260
261 }
262 catch (Exception e)
263 {
264 m_log.Error("[GATEKEEPER SERVICE CONNECTOR]: Got exception while parsing hyperlink response " + e.StackTrace);
265 return null;
266 }
267
268 return null;
269 }
270
271 }
272}
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
new file mode 100644
index 0000000..3e91e3a
--- /dev/null
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -0,0 +1,397 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections;
30using System.Collections.Generic;
31using System.IO;
32using System.Net;
33using System.Reflection;
34using System.Text;
35
36using OpenSim.Framework;
37using OpenSim.Services.Interfaces;
38using OpenSim.Services.Connectors.Simulation;
39using GridRegion = OpenSim.Services.Interfaces.GridRegion;
40
41using OpenMetaverse;
42using OpenMetaverse.StructuredData;
43using log4net;
44using Nwc.XmlRpc;
45using Nini.Config;
46
47namespace OpenSim.Services.Connectors.Hypergrid
48{
49 public class UserAgentServiceConnector : IUserAgentService
50 {
51 private static readonly ILog m_log =
52 LogManager.GetLogger(
53 MethodBase.GetCurrentMethod().DeclaringType);
54
55 string m_ServerURL;
56 public UserAgentServiceConnector(string url)
57 {
58 m_ServerURL = url;
59 }
60
61 public UserAgentServiceConnector(IConfigSource config)
62 {
63 }
64
65 public bool LoginAgentToGrid(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, out string reason)
66 {
67 reason = String.Empty;
68
69 if (destination == null)
70 {
71 reason = "Destination is null";
72 m_log.Debug("[USER AGENT CONNECTOR]: Given destination is null");
73 return false;
74 }
75
76 string uri = m_ServerURL + "/homeagent/" + aCircuit.AgentID + "/";
77
78 Console.WriteLine(" >>> LoginAgentToGrid <<< " + uri);
79
80 HttpWebRequest AgentCreateRequest = (HttpWebRequest)WebRequest.Create(uri);
81 AgentCreateRequest.Method = "POST";
82 AgentCreateRequest.ContentType = "application/json";
83 AgentCreateRequest.Timeout = 10000;
84 //AgentCreateRequest.KeepAlive = false;
85 //AgentCreateRequest.Headers.Add("Authorization", authKey);
86
87 // Fill it in
88 OSDMap args = PackCreateAgentArguments(aCircuit, gatekeeper, destination);
89
90 string strBuffer = "";
91 byte[] buffer = new byte[1];
92 try
93 {
94 strBuffer = OSDParser.SerializeJsonString(args);
95 Encoding str = Util.UTF8;
96 buffer = str.GetBytes(strBuffer);
97
98 }
99 catch (Exception e)
100 {
101 m_log.WarnFormat("[USER AGENT CONNECTOR]: Exception thrown on serialization of ChildCreate: {0}", e.Message);
102 // ignore. buffer will be empty, caller should check.
103 }
104
105 Stream os = null;
106 try
107 { // send the Post
108 AgentCreateRequest.ContentLength = buffer.Length; //Count bytes to send
109 os = AgentCreateRequest.GetRequestStream();
110 os.Write(buffer, 0, strBuffer.Length); //Send it
111 m_log.InfoFormat("[USER AGENT CONNECTOR]: Posted CreateAgent request to remote sim {0}, region {1}, x={2} y={3}",
112 uri, destination.RegionName, destination.RegionLocX, destination.RegionLocY);
113 }
114 //catch (WebException ex)
115 catch
116 {
117 //m_log.InfoFormat("[USER AGENT CONNECTOR]: Bad send on ChildAgentUpdate {0}", ex.Message);
118 reason = "cannot contact remote region";
119 return false;
120 }
121 finally
122 {
123 if (os != null)
124 os.Close();
125 }
126
127 // Let's wait for the response
128 //m_log.Info("[USER AGENT CONNECTOR]: Waiting for a reply after DoCreateChildAgentCall");
129
130 WebResponse webResponse = null;
131 StreamReader sr = null;
132 try
133 {
134 webResponse = AgentCreateRequest.GetResponse();
135 if (webResponse == null)
136 {
137 m_log.Info("[USER AGENT CONNECTOR]: Null reply on DoCreateChildAgentCall post");
138 }
139 else
140 {
141
142 sr = new StreamReader(webResponse.GetResponseStream());
143 string response = sr.ReadToEnd().Trim();
144 m_log.InfoFormat("[USER AGENT CONNECTOR]: DoCreateChildAgentCall reply was {0} ", response);
145
146 if (!String.IsNullOrEmpty(response))
147 {
148 try
149 {
150 // we assume we got an OSDMap back
151 OSDMap r = Util.GetOSDMap(response);
152 bool success = r["success"].AsBoolean();
153 reason = r["reason"].AsString();
154 return success;
155 }
156 catch (NullReferenceException e)
157 {
158 m_log.InfoFormat("[USER AGENT CONNECTOR]: exception on reply of DoCreateChildAgentCall {0}", e.Message);
159
160 // check for old style response
161 if (response.ToLower().StartsWith("true"))
162 return true;
163
164 return false;
165 }
166 }
167 }
168 }
169 catch (WebException ex)
170 {
171 m_log.InfoFormat("[USER AGENT CONNECTOR]: exception on reply of DoCreateChildAgentCall {0}", ex.Message);
172 reason = "Destination did not reply";
173 return false;
174 }
175 finally
176 {
177 if (sr != null)
178 sr.Close();
179 }
180
181 return true;
182
183 }
184
185 protected OSDMap PackCreateAgentArguments(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination)
186 {
187 OSDMap args = null;
188 try
189 {
190 args = aCircuit.PackAgentCircuitData();
191 }
192 catch (Exception e)
193 {
194 m_log.Debug("[USER AGENT CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message);
195 }
196 // Add the input arguments
197 args["gatekeeper_host"] = OSD.FromString(gatekeeper.ExternalHostName);
198 args["gatekeeper_port"] = OSD.FromString(gatekeeper.HttpPort.ToString());
199 args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString());
200 args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());
201 args["destination_name"] = OSD.FromString(destination.RegionName);
202 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
203
204 return args;
205 }
206
207 public GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt)
208 {
209 position = Vector3.UnitY; lookAt = Vector3.UnitY;
210
211 Hashtable hash = new Hashtable();
212 hash["userID"] = userID.ToString();
213
214 IList paramList = new ArrayList();
215 paramList.Add(hash);
216
217 XmlRpcRequest request = new XmlRpcRequest("get_home_region", paramList);
218 XmlRpcResponse response = null;
219 try
220 {
221 response = request.Send(m_ServerURL, 10000);
222 }
223 catch (Exception e)
224 {
225 return null;
226 }
227
228 if (response.IsFault)
229 {
230 return null;
231 }
232
233 hash = (Hashtable)response.Value;
234 //foreach (Object o in hash)
235 // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
236 try
237 {
238 bool success = false;
239 Boolean.TryParse((string)hash["result"], out success);
240 if (success)
241 {
242 GridRegion region = new GridRegion();
243
244 UUID.TryParse((string)hash["uuid"], out region.RegionID);
245 //m_log.Debug(">> HERE, uuid: " + region.RegionID);
246 int n = 0;
247 if (hash["x"] != null)
248 {
249 Int32.TryParse((string)hash["x"], out n);
250 region.RegionLocX = n;
251 //m_log.Debug(">> HERE, x: " + region.RegionLocX);
252 }
253 if (hash["y"] != null)
254 {
255 Int32.TryParse((string)hash["y"], out n);
256 region.RegionLocY = n;
257 //m_log.Debug(">> HERE, y: " + region.RegionLocY);
258 }
259 if (hash["region_name"] != null)
260 {
261 region.RegionName = (string)hash["region_name"];
262 //m_log.Debug(">> HERE, name: " + region.RegionName);
263 }
264 if (hash["hostname"] != null)
265 region.ExternalHostName = (string)hash["hostname"];
266 if (hash["http_port"] != null)
267 {
268 uint p = 0;
269 UInt32.TryParse((string)hash["http_port"], out p);
270 region.HttpPort = p;
271 }
272 if (hash["internal_port"] != null)
273 {
274 int p = 0;
275 Int32.TryParse((string)hash["internal_port"], out p);
276 region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p);
277 }
278 if (hash["position"] != null)
279 Vector3.TryParse((string)hash["position"], out position);
280 if (hash["lookAt"] != null)
281 Vector3.TryParse((string)hash["lookAt"], out lookAt);
282
283 // Successful return
284 return region;
285 }
286
287 }
288 catch (Exception e)
289 {
290 return null;
291 }
292
293 return null;
294
295 }
296
297 public bool AgentIsComingHome(UUID sessionID, string thisGridExternalName)
298 {
299 Hashtable hash = new Hashtable();
300 hash["sessionID"] = sessionID.ToString();
301 hash["externalName"] = thisGridExternalName;
302
303 IList paramList = new ArrayList();
304 paramList.Add(hash);
305
306 XmlRpcRequest request = new XmlRpcRequest("agent_is_coming_home", paramList);
307 string reason = string.Empty;
308 return GetBoolResponse(request, out reason);
309 }
310
311 public bool VerifyAgent(UUID sessionID, string token)
312 {
313 Hashtable hash = new Hashtable();
314 hash["sessionID"] = sessionID.ToString();
315 hash["token"] = token;
316
317 IList paramList = new ArrayList();
318 paramList.Add(hash);
319
320 XmlRpcRequest request = new XmlRpcRequest("verify_agent", paramList);
321 string reason = string.Empty;
322 return GetBoolResponse(request, out reason);
323 }
324
325 public bool VerifyClient(UUID sessionID, string token)
326 {
327 Hashtable hash = new Hashtable();
328 hash["sessionID"] = sessionID.ToString();
329 hash["token"] = token;
330
331 IList paramList = new ArrayList();
332 paramList.Add(hash);
333
334 XmlRpcRequest request = new XmlRpcRequest("verify_client", paramList);
335 string reason = string.Empty;
336 return GetBoolResponse(request, out reason);
337 }
338
339 public void LogoutAgent(UUID userID, UUID sessionID)
340 {
341 Hashtable hash = new Hashtable();
342 hash["sessionID"] = sessionID.ToString();
343 hash["userID"] = userID.ToString();
344
345 IList paramList = new ArrayList();
346 paramList.Add(hash);
347
348 XmlRpcRequest request = new XmlRpcRequest("logout_agent", paramList);
349 string reason = string.Empty;
350 GetBoolResponse(request, out reason);
351 }
352
353
354 private bool GetBoolResponse(XmlRpcRequest request, out string reason)
355 {
356 //m_log.Debug("[HGrid]: Linking to " + uri);
357 XmlRpcResponse response = null;
358 try
359 {
360 response = request.Send(m_ServerURL, 10000);
361 }
362 catch (Exception e)
363 {
364 m_log.Debug("[USER AGENT CONNECTOR]: Unable to contact remote server ");
365 reason = "Exception: " + e.Message;
366 return false;
367 }
368
369 if (response.IsFault)
370 {
371 m_log.ErrorFormat("[HGrid]: remote call returned an error: {0}", response.FaultString);
372 reason = "XMLRPC Fault";
373 return false;
374 }
375
376 Hashtable hash = (Hashtable)response.Value;
377 //foreach (Object o in hash)
378 // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
379 try
380 {
381 bool success = false;
382 reason = string.Empty;
383 Boolean.TryParse((string)hash["result"], out success);
384
385 return success;
386 }
387 catch (Exception e)
388 {
389 m_log.Error("[HGrid]: Got exception while parsing GetEndPoint response " + e.StackTrace);
390 reason = "Exception: " + e.Message;
391 return false;
392 }
393
394 }
395
396 }
397}