UserAgentServiceConnector.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  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. using System;
  28. using System.Collections;
  29. using System.Collections.Generic;
  30. using System.IO;
  31. using System.Net;
  32. using System.Reflection;
  33. using System.Text;
  34. using OpenSim.Framework;
  35. using OpenSim.Services.Interfaces;
  36. using OpenSim.Services.Connectors.Simulation;
  37. using GridRegion = OpenSim.Services.Interfaces.GridRegion;
  38. using OpenMetaverse;
  39. using OpenMetaverse.StructuredData;
  40. using log4net;
  41. using Nwc.XmlRpc;
  42. using Nini.Config;
  43. namespace OpenSim.Services.Connectors.Hypergrid
  44. {
  45. public class UserAgentServiceConnector : SimulationServiceConnector, IUserAgentService
  46. {
  47. private static readonly ILog m_log =
  48. LogManager.GetLogger(
  49. MethodBase.GetCurrentMethod().DeclaringType);
  50. private string m_ServerURLHost;
  51. private string m_ServerURL;
  52. private GridRegion m_Gatekeeper;
  53. public UserAgentServiceConnector(string url) : this(url, true)
  54. {
  55. }
  56. public UserAgentServiceConnector(string url, bool dnsLookup)
  57. {
  58. m_ServerURL = m_ServerURLHost = url;
  59. if (dnsLookup)
  60. {
  61. // Doing this here, because XML-RPC or mono have some strong ideas about
  62. // caching DNS translations.
  63. try
  64. {
  65. Uri m_Uri = new Uri(m_ServerURL);
  66. IPAddress ip = Util.GetHostFromDNS(m_Uri.Host);
  67. if(ip != null)
  68. {
  69. m_ServerURL = m_ServerURL.Replace(m_Uri.Host, ip.ToString());
  70. if (!m_ServerURL.EndsWith("/"))
  71. m_ServerURL += "/";
  72. }
  73. else
  74. m_log.DebugFormat("[USER AGENT CONNECTOR]: Failed to resolv address of {0}", url);
  75. }
  76. catch (Exception e)
  77. {
  78. m_log.DebugFormat("[USER AGENT CONNECTOR]: Malformed Uri {0}: {1}", url, e.Message);
  79. }
  80. }
  81. //m_log.DebugFormat("[USER AGENT CONNECTOR]: new connector to {0} ({1})", url, m_ServerURL);
  82. }
  83. public UserAgentServiceConnector(IConfigSource config)
  84. {
  85. IConfig serviceConfig = config.Configs["UserAgentService"];
  86. if (serviceConfig == null)
  87. {
  88. m_log.Error("[USER AGENT CONNECTOR]: UserAgentService missing from ini");
  89. throw new Exception("UserAgent connector init error");
  90. }
  91. string serviceURI = serviceConfig.GetString("UserAgentServerURI",
  92. String.Empty);
  93. if (serviceURI == String.Empty)
  94. {
  95. m_log.Error("[USER AGENT CONNECTOR]: No Server URI named in section UserAgentService");
  96. throw new Exception("UserAgent connector init error");
  97. }
  98. m_ServerURL = m_ServerURLHost = serviceURI;
  99. if (!m_ServerURL.EndsWith("/"))
  100. m_ServerURL += "/";
  101. //m_log.DebugFormat("[USER AGENT CONNECTOR]: new connector to {0}", m_ServerURL);
  102. }
  103. protected override string AgentPath()
  104. {
  105. return "homeagent/";
  106. }
  107. // The Login service calls this interface with fromLogin=true
  108. // Sims call it with fromLogin=false
  109. // Either way, this is verified by the handler
  110. public bool LoginAgentToGrid(GridRegion source, AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, bool fromLogin, out string reason)
  111. {
  112. reason = String.Empty;
  113. if (destination == null)
  114. {
  115. reason = "Destination is null";
  116. m_log.Debug("[USER AGENT CONNECTOR]: Given destination is null");
  117. return false;
  118. }
  119. GridRegion home = new GridRegion();
  120. home.ServerURI = m_ServerURL;
  121. home.RegionID = destination.RegionID;
  122. home.RegionLocX = destination.RegionLocX;
  123. home.RegionLocY = destination.RegionLocY;
  124. m_Gatekeeper = gatekeeper;
  125. Console.WriteLine(" >>> LoginAgentToGrid <<< " + home.ServerURI);
  126. uint flags = fromLogin ? (uint)TeleportFlags.ViaLogin : (uint)TeleportFlags.ViaHome;
  127. EntityTransferContext ctx = new EntityTransferContext();
  128. return CreateAgent(source, home, aCircuit, flags, ctx, out reason);
  129. }
  130. // The simulators call this interface
  131. public bool LoginAgentToGrid(GridRegion source, AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, out string reason)
  132. {
  133. return LoginAgentToGrid(source, aCircuit, gatekeeper, destination, false, out reason);
  134. }
  135. protected override void PackData(OSDMap args, GridRegion source, AgentCircuitData aCircuit, GridRegion destination, uint flags)
  136. {
  137. base.PackData(args, source, aCircuit, destination, flags);
  138. args["gatekeeper_serveruri"] = OSD.FromString(m_Gatekeeper.ServerURI);
  139. args["gatekeeper_host"] = OSD.FromString(m_Gatekeeper.ExternalHostName);
  140. args["gatekeeper_port"] = OSD.FromString(m_Gatekeeper.HttpPort.ToString());
  141. args["destination_serveruri"] = OSD.FromString(destination.ServerURI);
  142. }
  143. public void SetClientToken(UUID sessionID, string token)
  144. {
  145. // no-op
  146. }
  147. private Hashtable CallServer(string methodName, Hashtable hash)
  148. {
  149. IList paramList = new ArrayList();
  150. paramList.Add(hash);
  151. XmlRpcRequest request = new XmlRpcRequest(methodName, paramList);
  152. // Send and get reply
  153. XmlRpcResponse response = null;
  154. try
  155. {
  156. response = request.Send(m_ServerURL, 10000);
  157. }
  158. catch (Exception e)
  159. {
  160. m_log.DebugFormat("[USER AGENT CONNECTOR]: {0} call to {1} failed: {2}", methodName, m_ServerURLHost, e.Message);
  161. throw;
  162. }
  163. if (response.IsFault)
  164. {
  165. throw new Exception(string.Format("[USER AGENT CONNECTOR]: {0} call to {1} returned an error: {2}", methodName, m_ServerURLHost, response.FaultString));
  166. }
  167. hash = (Hashtable)response.Value;
  168. if (hash == null)
  169. {
  170. throw new Exception(string.Format("[USER AGENT CONNECTOR]: {0} call to {1} returned null", methodName, m_ServerURLHost));
  171. }
  172. return hash;
  173. }
  174. public GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt)
  175. {
  176. position = Vector3.UnitY; lookAt = Vector3.UnitY;
  177. Hashtable hash = new Hashtable();
  178. hash["userID"] = userID.ToString();
  179. hash = CallServer("get_home_region", hash);
  180. bool success;
  181. if (!Boolean.TryParse((string)hash["result"], out success) || !success)
  182. return null;
  183. GridRegion region = new GridRegion();
  184. UUID.TryParse((string)hash["uuid"], out region.RegionID);
  185. //m_log.Debug(">> HERE, uuid: " + region.RegionID);
  186. int n = 0;
  187. if (hash["x"] != null)
  188. {
  189. Int32.TryParse((string)hash["x"], out n);
  190. region.RegionLocX = n;
  191. //m_log.Debug(">> HERE, x: " + region.RegionLocX);
  192. }
  193. if (hash["y"] != null)
  194. {
  195. Int32.TryParse((string)hash["y"], out n);
  196. region.RegionLocY = n;
  197. //m_log.Debug(">> HERE, y: " + region.RegionLocY);
  198. }
  199. if (hash["size_x"] != null)
  200. {
  201. Int32.TryParse((string)hash["size_x"], out n);
  202. region.RegionSizeX = n;
  203. //m_log.Debug(">> HERE, x: " + region.RegionLocX);
  204. }
  205. if (hash["size_y"] != null)
  206. {
  207. Int32.TryParse((string)hash["size_y"], out n);
  208. region.RegionSizeY = n;
  209. //m_log.Debug(">> HERE, y: " + region.RegionLocY);
  210. }
  211. if (hash["region_name"] != null)
  212. {
  213. region.RegionName = (string)hash["region_name"];
  214. //m_log.Debug(">> HERE, name: " + region.RegionName);
  215. }
  216. if (hash["hostname"] != null)
  217. region.ExternalHostName = (string)hash["hostname"];
  218. if (hash["http_port"] != null)
  219. {
  220. uint p = 0;
  221. UInt32.TryParse((string)hash["http_port"], out p);
  222. region.HttpPort = p;
  223. }
  224. if (hash.ContainsKey("server_uri") && hash["server_uri"] != null)
  225. region.ServerURI = (string)hash["server_uri"];
  226. if (hash["internal_port"] != null)
  227. {
  228. int p = 0;
  229. Int32.TryParse((string)hash["internal_port"], out p);
  230. region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p);
  231. }
  232. if (hash["position"] != null)
  233. Vector3.TryParse((string)hash["position"], out position);
  234. if (hash["lookAt"] != null)
  235. Vector3.TryParse((string)hash["lookAt"], out lookAt);
  236. // Successful return
  237. return region;
  238. }
  239. public bool IsAgentComingHome(UUID sessionID, string thisGridExternalName)
  240. {
  241. Hashtable hash = new Hashtable();
  242. hash["sessionID"] = sessionID.ToString();
  243. hash["externalName"] = thisGridExternalName;
  244. IList paramList = new ArrayList();
  245. paramList.Add(hash);
  246. XmlRpcRequest request = new XmlRpcRequest("agent_is_coming_home", paramList);
  247. string reason = string.Empty;
  248. return GetBoolResponse(request, out reason);
  249. }
  250. public bool VerifyAgent(UUID sessionID, string token)
  251. {
  252. Hashtable hash = new Hashtable();
  253. hash["sessionID"] = sessionID.ToString();
  254. hash["token"] = token;
  255. IList paramList = new ArrayList();
  256. paramList.Add(hash);
  257. XmlRpcRequest request = new XmlRpcRequest("verify_agent", paramList);
  258. string reason = string.Empty;
  259. return GetBoolResponse(request, out reason);
  260. }
  261. public bool VerifyClient(UUID sessionID, string token)
  262. {
  263. Hashtable hash = new Hashtable();
  264. hash["sessionID"] = sessionID.ToString();
  265. hash["token"] = token;
  266. IList paramList = new ArrayList();
  267. paramList.Add(hash);
  268. XmlRpcRequest request = new XmlRpcRequest("verify_client", paramList);
  269. string reason = string.Empty;
  270. return GetBoolResponse(request, out reason);
  271. }
  272. public void LogoutAgent(UUID userID, UUID sessionID)
  273. {
  274. Hashtable hash = new Hashtable();
  275. hash["sessionID"] = sessionID.ToString();
  276. hash["userID"] = userID.ToString();
  277. IList paramList = new ArrayList();
  278. paramList.Add(hash);
  279. XmlRpcRequest request = new XmlRpcRequest("logout_agent", paramList);
  280. string reason = string.Empty;
  281. GetBoolResponse(request, out reason);
  282. }
  283. [Obsolete]
  284. public List<UUID> StatusNotification(List<string> friends, UUID userID, bool online)
  285. {
  286. Hashtable hash = new Hashtable();
  287. hash["userID"] = userID.ToString();
  288. hash["online"] = online.ToString();
  289. int i = 0;
  290. foreach (string s in friends)
  291. {
  292. hash["friend_" + i.ToString()] = s;
  293. i++;
  294. }
  295. IList paramList = new ArrayList();
  296. paramList.Add(hash);
  297. XmlRpcRequest request = new XmlRpcRequest("status_notification", paramList);
  298. // string reason = string.Empty;
  299. // Send and get reply
  300. List<UUID> friendsOnline = new List<UUID>();
  301. XmlRpcResponse response = null;
  302. try
  303. {
  304. response = request.Send(m_ServerURL, 6000);
  305. }
  306. catch
  307. {
  308. m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for StatusNotification", m_ServerURLHost);
  309. // reason = "Exception: " + e.Message;
  310. return friendsOnline;
  311. }
  312. if (response.IsFault)
  313. {
  314. m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for StatusNotification returned an error: {1}", m_ServerURLHost, response.FaultString);
  315. // reason = "XMLRPC Fault";
  316. return friendsOnline;
  317. }
  318. hash = (Hashtable)response.Value;
  319. //foreach (Object o in hash)
  320. // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
  321. try
  322. {
  323. if (hash == null)
  324. {
  325. m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetOnlineFriends Got null response from {0}! THIS IS BAAAAD", m_ServerURLHost);
  326. // reason = "Internal error 1";
  327. return friendsOnline;
  328. }
  329. // Here is the actual response
  330. foreach (object key in hash.Keys)
  331. {
  332. if (key is string && ((string)key).StartsWith("friend_") && hash[key] != null)
  333. {
  334. UUID uuid;
  335. if (UUID.TryParse(hash[key].ToString(), out uuid))
  336. friendsOnline.Add(uuid);
  337. }
  338. }
  339. }
  340. catch
  341. {
  342. m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetOnlineFriends response.");
  343. // reason = "Exception: " + e.Message;
  344. }
  345. return friendsOnline;
  346. }
  347. [Obsolete]
  348. public List<UUID> GetOnlineFriends(UUID userID, List<string> friends)
  349. {
  350. Hashtable hash = new Hashtable();
  351. hash["userID"] = userID.ToString();
  352. int i = 0;
  353. foreach (string s in friends)
  354. {
  355. hash["friend_" + i.ToString()] = s;
  356. i++;
  357. }
  358. IList paramList = new ArrayList();
  359. paramList.Add(hash);
  360. XmlRpcRequest request = new XmlRpcRequest("get_online_friends", paramList);
  361. // string reason = string.Empty;
  362. // Send and get reply
  363. List<UUID> online = new List<UUID>();
  364. XmlRpcResponse response = null;
  365. try
  366. {
  367. response = request.Send(m_ServerURL, 10000);
  368. }
  369. catch
  370. {
  371. m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetOnlineFriends", m_ServerURLHost);
  372. // reason = "Exception: " + e.Message;
  373. return online;
  374. }
  375. if (response.IsFault)
  376. {
  377. m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetOnlineFriends returned an error: {1}", m_ServerURLHost, response.FaultString);
  378. // reason = "XMLRPC Fault";
  379. return online;
  380. }
  381. hash = (Hashtable)response.Value;
  382. //foreach (Object o in hash)
  383. // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
  384. try
  385. {
  386. if (hash == null)
  387. {
  388. m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetOnlineFriends Got null response from {0}! THIS IS BAAAAD", m_ServerURLHost);
  389. // reason = "Internal error 1";
  390. return online;
  391. }
  392. // Here is the actual response
  393. foreach (object key in hash.Keys)
  394. {
  395. if (key is string && ((string)key).StartsWith("friend_") && hash[key] != null)
  396. {
  397. UUID uuid;
  398. if (UUID.TryParse(hash[key].ToString(), out uuid))
  399. online.Add(uuid);
  400. }
  401. }
  402. }
  403. catch
  404. {
  405. m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetOnlineFriends response.");
  406. // reason = "Exception: " + e.Message;
  407. }
  408. return online;
  409. }
  410. public Dictionary<string,object> GetUserInfo (UUID userID)
  411. {
  412. Hashtable hash = new Hashtable();
  413. hash["userID"] = userID.ToString();
  414. hash = CallServer("get_user_info", hash);
  415. Dictionary<string, object> info = new Dictionary<string, object>();
  416. foreach (object key in hash.Keys)
  417. {
  418. if (hash[key] != null)
  419. {
  420. info.Add(key.ToString(), hash[key]);
  421. }
  422. }
  423. return info;
  424. }
  425. public Dictionary<string, object> GetServerURLs(UUID userID)
  426. {
  427. Hashtable hash = new Hashtable();
  428. hash["userID"] = userID.ToString();
  429. hash = CallServer("get_server_urls", hash);
  430. Dictionary<string, object> serverURLs = new Dictionary<string, object>();
  431. foreach (object key in hash.Keys)
  432. {
  433. if (key is string && ((string)key).StartsWith("SRV_") && hash[key] != null)
  434. {
  435. string serverType = key.ToString().Substring(4); // remove "SRV_"
  436. serverURLs.Add(serverType, hash[key].ToString());
  437. }
  438. }
  439. return serverURLs;
  440. }
  441. public string LocateUser(UUID userID)
  442. {
  443. Hashtable hash = new Hashtable();
  444. hash["userID"] = userID.ToString();
  445. hash = CallServer("locate_user", hash);
  446. string url = string.Empty;
  447. // Here's the actual response
  448. if (hash.ContainsKey("URL"))
  449. url = hash["URL"].ToString();
  450. return url;
  451. }
  452. public string GetUUI(UUID userID, UUID targetUserID)
  453. {
  454. Hashtable hash = new Hashtable();
  455. hash["userID"] = userID.ToString();
  456. hash["targetUserID"] = targetUserID.ToString();
  457. hash = CallServer("get_uui", hash);
  458. string uui = string.Empty;
  459. // Here's the actual response
  460. if (hash.ContainsKey("UUI"))
  461. uui = hash["UUI"].ToString();
  462. return uui;
  463. }
  464. public UUID GetUUID(String first, String last)
  465. {
  466. Hashtable hash = new Hashtable();
  467. hash["first"] = first;
  468. hash["last"] = last;
  469. hash = CallServer("get_uuid", hash);
  470. if (!hash.ContainsKey("UUID"))
  471. {
  472. throw new Exception(string.Format("[USER AGENT CONNECTOR]: get_uuid call to {0} didn't return a UUID", m_ServerURLHost));
  473. }
  474. UUID uuid;
  475. if (!UUID.TryParse(hash["UUID"].ToString(), out uuid))
  476. {
  477. throw new Exception(string.Format("[USER AGENT CONNECTOR]: get_uuid call to {0} returned an invalid UUID: {1}", m_ServerURLHost, hash["UUID"].ToString()));
  478. }
  479. return uuid;
  480. }
  481. private bool GetBoolResponse(XmlRpcRequest request, out string reason)
  482. {
  483. //m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURLHost);
  484. XmlRpcResponse response = null;
  485. try
  486. {
  487. // We can not use m_ServerURL here anymore because it causes
  488. // the HTTP request to be built without a host name. This messes
  489. // with OSGrid's NGINX and can make OSGrid avatars unable to TP
  490. // to other grids running recent mono.
  491. response = request.Send(m_ServerURLHost, 10000);
  492. }
  493. catch (Exception e)
  494. {
  495. m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetBoolResponse", m_ServerURLHost);
  496. reason = "Exception: " + e.Message;
  497. return false;
  498. }
  499. if (response.IsFault)
  500. {
  501. m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetBoolResponse returned an error: {1}", m_ServerURLHost, response.FaultString);
  502. reason = "XMLRPC Fault";
  503. return false;
  504. }
  505. Hashtable hash = (Hashtable)response.Value;
  506. //foreach (Object o in hash)
  507. // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
  508. try
  509. {
  510. if (hash == null)
  511. {
  512. m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got null response from {0}! THIS IS BAAAAD", m_ServerURLHost);
  513. reason = "Internal error 1";
  514. return false;
  515. }
  516. bool success = false;
  517. reason = string.Empty;
  518. if (hash.ContainsKey("result"))
  519. Boolean.TryParse((string)hash["result"], out success);
  520. else
  521. {
  522. reason = "Internal error 2";
  523. m_log.WarnFormat("[USER AGENT CONNECTOR]: response from {0} does not have expected key 'result'", m_ServerURLHost);
  524. }
  525. return success;
  526. }
  527. catch (Exception e)
  528. {
  529. m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetBoolResponse response.");
  530. if (hash.ContainsKey("result") && hash["result"] != null)
  531. m_log.ErrorFormat("Reply was ", (string)hash["result"]);
  532. reason = "Exception: " + e.Message;
  533. return false;
  534. }
  535. }
  536. }
  537. }