SimulationServiceConnector.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  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.Generic;
  29. using System.IO;
  30. using System.Net;
  31. using System.Reflection;
  32. using System.Text;
  33. using OpenSim.Framework;
  34. using OpenSim.Services.Interfaces;
  35. using GridRegion = OpenSim.Services.Interfaces.GridRegion;
  36. using OpenMetaverse;
  37. using OpenMetaverse.StructuredData;
  38. using log4net;
  39. using Nini.Config;
  40. namespace OpenSim.Services.Connectors.Simulation
  41. {
  42. public class SimulationServiceConnector : ISimulationService
  43. {
  44. private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
  45. //private GridRegion m_Region;
  46. public SimulationServiceConnector()
  47. {
  48. }
  49. public SimulationServiceConnector(IConfigSource config)
  50. {
  51. //m_Region = region;
  52. }
  53. public IScene GetScene(ulong regionHandle)
  54. {
  55. return null;
  56. }
  57. public ISimulationService GetInnerService()
  58. {
  59. return null;
  60. }
  61. #region Agents
  62. protected virtual string AgentPath()
  63. {
  64. return "/agent/";
  65. }
  66. public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason)
  67. {
  68. HttpWebRequest AgentCreateRequest = null;
  69. reason = String.Empty;
  70. if (SendRequest(destination, aCircuit, flags, out reason, out AgentCreateRequest))
  71. {
  72. string response = GetResponse(AgentCreateRequest, out reason);
  73. bool success = true;
  74. UnpackResponse(response, out success, out reason);
  75. return success;
  76. }
  77. return false;
  78. }
  79. protected bool SendRequest(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason, out HttpWebRequest AgentCreateRequest)
  80. {
  81. reason = String.Empty;
  82. AgentCreateRequest = null;
  83. if (destination == null)
  84. {
  85. reason = "Destination is null";
  86. m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Given destination is null");
  87. return false;
  88. }
  89. string uri = string.Empty;
  90. // HACK -- Simian grid make it work!!!
  91. if (destination.ServerURI != null && destination.ServerURI != string.Empty && !destination.ServerURI.StartsWith("http:"))
  92. uri = "http://" + destination.ServerURI + AgentPath() + aCircuit.AgentID + "/";
  93. else
  94. {
  95. try
  96. {
  97. uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + aCircuit.AgentID + "/";
  98. }
  99. catch (Exception e)
  100. {
  101. m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message);
  102. reason = e.Message;
  103. return false;
  104. }
  105. }
  106. //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri);
  107. AgentCreateRequest = (HttpWebRequest)WebRequest.Create(uri);
  108. AgentCreateRequest.Method = "POST";
  109. AgentCreateRequest.ContentType = "application/json";
  110. AgentCreateRequest.Timeout = 10000;
  111. //AgentCreateRequest.KeepAlive = false;
  112. //AgentCreateRequest.Headers.Add("Authorization", authKey);
  113. // Fill it in
  114. OSDMap args = PackCreateAgentArguments(aCircuit, destination, flags);
  115. if (args == null)
  116. return false;
  117. string strBuffer = "";
  118. byte[] buffer = new byte[1];
  119. try
  120. {
  121. strBuffer = OSDParser.SerializeJsonString(args);
  122. Encoding str = Util.UTF8;
  123. buffer = str.GetBytes(strBuffer);
  124. }
  125. catch (Exception e)
  126. {
  127. m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: Exception thrown on serialization of ChildCreate: {0}", e.Message);
  128. // ignore. buffer will be empty, caller should check.
  129. }
  130. Stream os = null;
  131. try
  132. { // send the Post
  133. AgentCreateRequest.ContentLength = buffer.Length; //Count bytes to send
  134. os = AgentCreateRequest.GetRequestStream();
  135. os.Write(buffer, 0, strBuffer.Length); //Send it
  136. m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Posted CreateAgent request to remote sim {0}, region {1}, x={2} y={3}",
  137. uri, destination.RegionName, destination.RegionLocX, destination.RegionLocY);
  138. }
  139. //catch (WebException ex)
  140. catch
  141. {
  142. //m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Bad send on ChildAgentUpdate {0}", ex.Message);
  143. reason = "cannot contact remote region";
  144. return false;
  145. }
  146. finally
  147. {
  148. if (os != null)
  149. os.Close();
  150. }
  151. return true;
  152. }
  153. protected string GetResponse(HttpWebRequest AgentCreateRequest, out string reason)
  154. {
  155. // Let's wait for the response
  156. //m_log.Info("[REMOTE SIMULATION CONNECTOR]: Waiting for a reply after DoCreateChildAgentCall");
  157. reason = string.Empty;
  158. WebResponse webResponse = null;
  159. StreamReader sr = null;
  160. string response = string.Empty;
  161. try
  162. {
  163. webResponse = AgentCreateRequest.GetResponse();
  164. if (webResponse == null)
  165. {
  166. m_log.Info("[REMOTE SIMULATION CONNECTOR]: Null reply on DoCreateChildAgentCall post");
  167. }
  168. else
  169. {
  170. sr = new StreamReader(webResponse.GetResponseStream());
  171. response = sr.ReadToEnd().Trim();
  172. m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: DoCreateChildAgentCall reply was {0} ", response);
  173. }
  174. }
  175. catch (WebException ex)
  176. {
  177. m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of DoCreateChildAgentCall {0}", ex.Message);
  178. reason = "Destination did not reply";
  179. return string.Empty;
  180. }
  181. finally
  182. {
  183. if (sr != null)
  184. sr.Close();
  185. }
  186. return response;
  187. }
  188. protected void UnpackResponse(string response, out bool result, out string reason)
  189. {
  190. result = true;
  191. reason = string.Empty;
  192. if (!String.IsNullOrEmpty(response))
  193. {
  194. try
  195. {
  196. // we assume we got an OSDMap back
  197. OSDMap r = Util.GetOSDMap(response);
  198. result = r["success"].AsBoolean();
  199. reason = r["reason"].AsString();
  200. }
  201. catch (NullReferenceException e)
  202. {
  203. m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of DoCreateChildAgentCall {0}", e.Message);
  204. // check for old style response
  205. if (response.ToLower().StartsWith("true"))
  206. result = true;
  207. result = false;
  208. }
  209. }
  210. }
  211. protected virtual OSDMap PackCreateAgentArguments(AgentCircuitData aCircuit, GridRegion destination, uint flags)
  212. {
  213. OSDMap args = null;
  214. try
  215. {
  216. args = aCircuit.PackAgentCircuitData();
  217. }
  218. catch (Exception e)
  219. {
  220. m_log.Debug("[REMOTE SIMULATION CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message);
  221. return null;
  222. }
  223. // Add the input arguments
  224. args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString());
  225. args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());
  226. args["destination_name"] = OSD.FromString(destination.RegionName);
  227. args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
  228. args["teleport_flags"] = OSD.FromString(flags.ToString());
  229. return args;
  230. }
  231. public bool UpdateAgent(GridRegion destination, AgentData data)
  232. {
  233. return UpdateAgent(destination, (IAgentData)data);
  234. }
  235. public bool UpdateAgent(GridRegion destination, AgentPosition data)
  236. {
  237. return UpdateAgent(destination, (IAgentData)data);
  238. }
  239. private bool UpdateAgent(GridRegion destination, IAgentData cAgentData)
  240. {
  241. // Eventually, we want to use a caps url instead of the agentID
  242. string uri = string.Empty;
  243. try
  244. {
  245. uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + cAgentData.AgentID + "/";
  246. }
  247. catch (Exception e)
  248. {
  249. m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent update. Reason: " + e.Message);
  250. return false;
  251. }
  252. //Console.WriteLine(" >>> DoAgentUpdateCall <<< " + uri);
  253. HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri);
  254. ChildUpdateRequest.Method = "PUT";
  255. ChildUpdateRequest.ContentType = "application/json";
  256. ChildUpdateRequest.Timeout = 30000;
  257. //ChildUpdateRequest.KeepAlive = false;
  258. // Fill it in
  259. OSDMap args = null;
  260. try
  261. {
  262. args = cAgentData.Pack();
  263. }
  264. catch (Exception e)
  265. {
  266. m_log.Debug("[REMOTE SIMULATION CONNECTOR]: PackUpdateMessage failed with exception: " + e.Message);
  267. }
  268. // Add the input arguments
  269. args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString());
  270. args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());
  271. args["destination_name"] = OSD.FromString(destination.RegionName);
  272. args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
  273. string strBuffer = "";
  274. byte[] buffer = new byte[1];
  275. try
  276. {
  277. strBuffer = OSDParser.SerializeJsonString(args);
  278. Encoding str = Util.UTF8;
  279. buffer = str.GetBytes(strBuffer);
  280. }
  281. catch (Exception e)
  282. {
  283. m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: Exception thrown on serialization of ChildUpdate: {0}", e.Message);
  284. // ignore. buffer will be empty, caller should check.
  285. }
  286. Stream os = null;
  287. try
  288. { // send the Post
  289. ChildUpdateRequest.ContentLength = buffer.Length; //Count bytes to send
  290. os = ChildUpdateRequest.GetRequestStream();
  291. os.Write(buffer, 0, strBuffer.Length); //Send it
  292. //m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Posted AgentUpdate request to remote sim {0}", uri);
  293. }
  294. catch (WebException ex)
  295. //catch
  296. {
  297. m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Bad send on AgentUpdate {0}", ex.Message);
  298. return false;
  299. }
  300. finally
  301. {
  302. if (os != null)
  303. os.Close();
  304. }
  305. // Let's wait for the response
  306. //m_log.Info("[REMOTE SIMULATION CONNECTOR]: Waiting for a reply after ChildAgentUpdate");
  307. WebResponse webResponse = null;
  308. StreamReader sr = null;
  309. try
  310. {
  311. webResponse = ChildUpdateRequest.GetResponse();
  312. if (webResponse == null)
  313. {
  314. m_log.Info("[REMOTE SIMULATION CONNECTOR]: Null reply on ChilAgentUpdate post");
  315. }
  316. sr = new StreamReader(webResponse.GetResponseStream());
  317. //reply = sr.ReadToEnd().Trim();
  318. sr.ReadToEnd().Trim();
  319. sr.Close();
  320. //m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: ChilAgentUpdate reply was {0} ", reply);
  321. }
  322. catch (WebException ex)
  323. {
  324. m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of ChilAgentUpdate from {0}: {1}", uri, ex.Message);
  325. // ignore, really
  326. }
  327. finally
  328. {
  329. if (sr != null)
  330. sr.Close();
  331. }
  332. return true;
  333. }
  334. public bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent)
  335. {
  336. agent = null;
  337. // Eventually, we want to use a caps url instead of the agentID
  338. string uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
  339. //Console.WriteLine(" >>> DoRetrieveRootAgentCall <<< " + uri);
  340. HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
  341. request.Method = "GET";
  342. request.Timeout = 10000;
  343. //request.Headers.Add("authorization", ""); // coming soon
  344. HttpWebResponse webResponse = null;
  345. string reply = string.Empty;
  346. StreamReader sr = null;
  347. try
  348. {
  349. webResponse = (HttpWebResponse)request.GetResponse();
  350. if (webResponse == null)
  351. {
  352. m_log.Info("[REMOTE SIMULATION CONNECTOR]: Null reply on agent get ");
  353. }
  354. sr = new StreamReader(webResponse.GetResponseStream());
  355. reply = sr.ReadToEnd().Trim();
  356. //Console.WriteLine("[REMOTE SIMULATION CONNECTOR]: ChilAgentUpdate reply was " + reply);
  357. }
  358. catch (WebException ex)
  359. {
  360. m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of agent get {0}", ex.Message);
  361. // ignore, really
  362. return false;
  363. }
  364. finally
  365. {
  366. if (sr != null)
  367. sr.Close();
  368. }
  369. if (webResponse.StatusCode == HttpStatusCode.OK)
  370. {
  371. // we know it's jason
  372. OSDMap args = Util.GetOSDMap(reply);
  373. if (args == null)
  374. {
  375. //Console.WriteLine("[REMOTE SIMULATION CONNECTOR]: Error getting OSDMap from reply");
  376. return false;
  377. }
  378. agent = new CompleteAgentData();
  379. agent.Unpack(args);
  380. return true;
  381. }
  382. //Console.WriteLine("[REMOTE SIMULATION CONNECTOR]: DoRetrieveRootAgentCall returned status " + webResponse.StatusCode);
  383. return false;
  384. }
  385. public bool ReleaseAgent(UUID origin, UUID id, string uri)
  386. {
  387. WebRequest request = WebRequest.Create(uri);
  388. request.Method = "DELETE";
  389. request.Timeout = 10000;
  390. StreamReader sr = null;
  391. try
  392. {
  393. WebResponse webResponse = request.GetResponse();
  394. if (webResponse == null)
  395. {
  396. m_log.Info("[REMOTE SIMULATION CONNECTOR]: Null reply on ReleaseAgent");
  397. }
  398. sr = new StreamReader(webResponse.GetResponseStream());
  399. //reply = sr.ReadToEnd().Trim();
  400. sr.ReadToEnd().Trim();
  401. sr.Close();
  402. //m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: ChilAgentUpdate reply was {0} ", reply);
  403. }
  404. catch (WebException ex)
  405. {
  406. m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of ReleaseAgent {0}", ex.Message);
  407. return false;
  408. }
  409. finally
  410. {
  411. if (sr != null)
  412. sr.Close();
  413. }
  414. return true;
  415. }
  416. public bool CloseAgent(GridRegion destination, UUID id)
  417. {
  418. string uri = string.Empty;
  419. try
  420. {
  421. uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
  422. }
  423. catch (Exception e)
  424. {
  425. m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent close. Reason: " + e.Message);
  426. return false;
  427. }
  428. //Console.WriteLine(" >>> DoCloseAgentCall <<< " + uri);
  429. WebRequest request = WebRequest.Create(uri);
  430. request.Method = "DELETE";
  431. request.Timeout = 10000;
  432. StreamReader sr = null;
  433. try
  434. {
  435. WebResponse webResponse = request.GetResponse();
  436. if (webResponse == null)
  437. {
  438. m_log.Info("[REMOTE SIMULATION CONNECTOR]: Null reply on agent delete ");
  439. }
  440. sr = new StreamReader(webResponse.GetResponseStream());
  441. //reply = sr.ReadToEnd().Trim();
  442. sr.ReadToEnd().Trim();
  443. sr.Close();
  444. //m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: ChilAgentUpdate reply was {0} ", reply);
  445. }
  446. catch (WebException ex)
  447. {
  448. m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of agent delete from {0}: {1}", destination.RegionName, ex.Message);
  449. return false;
  450. }
  451. finally
  452. {
  453. if (sr != null)
  454. sr.Close();
  455. }
  456. return true;
  457. }
  458. #endregion Agents
  459. #region Objects
  460. protected virtual string ObjectPath()
  461. {
  462. return "/object/";
  463. }
  464. public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall)
  465. {
  466. string uri
  467. = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + ObjectPath() + sog.UUID + "/";
  468. //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri);
  469. WebRequest ObjectCreateRequest = WebRequest.Create(uri);
  470. ObjectCreateRequest.Method = "POST";
  471. ObjectCreateRequest.ContentType = "application/json";
  472. ObjectCreateRequest.Timeout = 10000;
  473. OSDMap args = new OSDMap(2);
  474. args["sog"] = OSD.FromString(sog.ToXml2());
  475. args["extra"] = OSD.FromString(sog.ExtraToXmlString());
  476. string state = sog.GetStateSnapshot();
  477. if (state.Length > 0)
  478. args["state"] = OSD.FromString(state);
  479. // Add the input general arguments
  480. args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString());
  481. args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());
  482. args["destination_name"] = OSD.FromString(destination.RegionName);
  483. args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
  484. string strBuffer = "";
  485. byte[] buffer = new byte[1];
  486. try
  487. {
  488. strBuffer = OSDParser.SerializeJsonString(args);
  489. Encoding str = Util.UTF8;
  490. buffer = str.GetBytes(strBuffer);
  491. }
  492. catch (Exception e)
  493. {
  494. m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: Exception thrown on serialization of CreateObject: {0}", e.Message);
  495. // ignore. buffer will be empty, caller should check.
  496. }
  497. Stream os = null;
  498. try
  499. { // send the Post
  500. ObjectCreateRequest.ContentLength = buffer.Length; //Count bytes to send
  501. os = ObjectCreateRequest.GetRequestStream();
  502. os.Write(buffer, 0, strBuffer.Length); //Send it
  503. m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Posted CreateObject request to remote sim {0}", uri);
  504. }
  505. catch (WebException ex)
  506. {
  507. m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Bad send on CreateObject {0}", ex.Message);
  508. return false;
  509. }
  510. finally
  511. {
  512. if (os != null)
  513. os.Close();
  514. }
  515. // Let's wait for the response
  516. //m_log.Info("[REMOTE SIMULATION CONNECTOR]: Waiting for a reply after DoCreateChildAgentCall");
  517. StreamReader sr = null;
  518. try
  519. {
  520. WebResponse webResponse = ObjectCreateRequest.GetResponse();
  521. if (webResponse == null)
  522. {
  523. m_log.Info("[REMOTE SIMULATION CONNECTOR]: Null reply on CreateObject post");
  524. return false;
  525. }
  526. sr = new StreamReader(webResponse.GetResponseStream());
  527. //reply = sr.ReadToEnd().Trim();
  528. sr.ReadToEnd().Trim();
  529. //m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: DoCreateChildAgentCall reply was {0} ", reply);
  530. }
  531. catch (WebException ex)
  532. {
  533. m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of CreateObject {0}", ex.Message);
  534. return false;
  535. }
  536. finally
  537. {
  538. if (sr != null)
  539. sr.Close();
  540. }
  541. return true;
  542. }
  543. public bool CreateObject(GridRegion destination, UUID userID, UUID itemID)
  544. {
  545. // TODO, not that urgent
  546. return false;
  547. }
  548. #endregion Objects
  549. }
  550. }