LoginServiceTests.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  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.Net;
  31. using System.Text.RegularExpressions;
  32. using NUnit.Framework;
  33. using NUnit.Framework.SyntaxHelpers;
  34. using Nwc.XmlRpc;
  35. using OpenSim.Framework.Communications.Cache;
  36. using OpenSim.Framework.Communications.Services;
  37. using OpenSim.Region.Communications.Local;
  38. using OpenSim.Tests.Common.Setup;
  39. using OpenSim.Tests.Common.Mock;
  40. using OpenSim.Client.Linden;
  41. using OpenSim.Tests.Common;
  42. using OpenSim.Services.Interfaces;
  43. using OpenMetaverse;
  44. namespace OpenSim.Framework.Communications.Tests
  45. {
  46. /// <summary>
  47. /// Test the login service. For now, most of this will be done through the LocalLoginService as LoginService
  48. /// is abstract
  49. /// </summary>
  50. [TestFixture]
  51. public class LoginServiceTests
  52. {
  53. private string m_firstName = "Adam";
  54. private string m_lastName = "West";
  55. private string m_regionExternalName = "localhost";
  56. private IPEndPoint m_capsEndPoint;
  57. private TestCommunicationsManager m_commsManager;
  58. private TestLoginToRegionConnector m_regionConnector;
  59. private LocalUserServices m_localUserServices;
  60. private LoginService m_loginService;
  61. private UserProfileData m_userProfileData;
  62. private TestScene m_testScene;
  63. [SetUp]
  64. public void SetUpLoginEnviroment()
  65. {
  66. m_capsEndPoint = new IPEndPoint(IPAddress.Loopback, 9123);
  67. m_commsManager = new TestCommunicationsManager(new NetworkServersInfo(42, 43));
  68. m_regionConnector = new TestLoginToRegionConnector();
  69. m_testScene = SceneSetupHelpers.SetupScene(m_commsManager, "");
  70. m_regionConnector.AddRegion(new RegionInfo(42, 43, m_capsEndPoint, m_regionExternalName));
  71. //IInventoryService m_inventoryService = new TestInventoryService();
  72. m_localUserServices = (LocalUserServices) m_commsManager.UserService;
  73. m_localUserServices.AddUser(m_firstName,m_lastName,"boingboing","[email protected]",42,43);
  74. m_loginService = new LLStandaloneLoginService((UserManagerBase) m_localUserServices, "Hello folks", m_testScene.InventoryService,
  75. m_commsManager.NetworkServersInfo, true, new LibraryRootFolder(String.Empty), m_regionConnector);
  76. m_userProfileData = m_localUserServices.GetUserProfile(m_firstName, m_lastName);
  77. }
  78. /// <summary>
  79. /// Test the normal response to a login. Does not test authentication.
  80. /// </summary>
  81. [Test]
  82. public void T010_TestUnauthenticatedLogin()
  83. {
  84. TestHelper.InMethod();
  85. // We want to use our own LoginService for this test, one that
  86. // doesn't require authentication.
  87. new LLStandaloneLoginService((UserManagerBase)m_commsManager.UserService, "Hello folks", new TestInventoryService(),
  88. m_commsManager.NetworkServersInfo, false, new LibraryRootFolder(String.Empty), m_regionConnector);
  89. Hashtable loginParams = new Hashtable();
  90. loginParams["first"] = m_firstName;
  91. loginParams["last"] = m_lastName;
  92. loginParams["passwd"] = "boingboing";
  93. ArrayList sendParams = new ArrayList();
  94. sendParams.Add(loginParams);
  95. sendParams.Add(m_capsEndPoint); // is this parameter correct?
  96. sendParams.Add(new Uri("http://localhost:8002/")); // is this parameter correct?
  97. XmlRpcRequest request = new XmlRpcRequest("login_to_simulator", sendParams);
  98. IPAddress tmpLocal = Util.GetLocalHost();
  99. IPEndPoint tmpEnd = new IPEndPoint(tmpLocal, 80);
  100. XmlRpcResponse response = m_loginService.XmlRpcLoginMethod(request, tmpEnd);
  101. Hashtable responseData = (Hashtable)response.Value;
  102. Assert.That(responseData["first_name"], Is.EqualTo(m_firstName));
  103. Assert.That(responseData["last_name"], Is.EqualTo(m_lastName));
  104. Assert.That(
  105. responseData["circuit_code"], Is.GreaterThanOrEqualTo(0) & Is.LessThanOrEqualTo(Int32.MaxValue));
  106. Regex capsSeedPattern
  107. = new Regex("^http://"
  108. + NetworkUtil.GetHostFor(tmpLocal, m_regionExternalName)
  109. + ":9000/CAPS/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}0000/$");
  110. Assert.That(capsSeedPattern.IsMatch((string)responseData["seed_capability"]), Is.True);
  111. }
  112. [Test]
  113. public void T011_TestAuthenticatedLoginSuccess()
  114. {
  115. TestHelper.InMethod();
  116. // TODO: Not check inventory part of response yet.
  117. // TODO: Not checking all of login response thoroughly yet.
  118. // 1) Test for positive authentication
  119. Hashtable loginParams = new Hashtable();
  120. loginParams["first"] = m_firstName;
  121. loginParams["last"] = m_lastName;
  122. loginParams["passwd"] = "boingboing";
  123. ArrayList sendParams = new ArrayList();
  124. sendParams.Add(loginParams);
  125. sendParams.Add(m_capsEndPoint); // is this parameter correct?
  126. sendParams.Add(new Uri("http://localhost:8002/")); // is this parameter correct?
  127. XmlRpcRequest request = new XmlRpcRequest("login_to_simulator", sendParams);
  128. IPAddress tmpLocal = Util.GetLocalHost();
  129. IPEndPoint tmpEnd = new IPEndPoint(tmpLocal, 80);
  130. XmlRpcResponse response = m_loginService.XmlRpcLoginMethod(request, tmpEnd);
  131. Hashtable responseData = (Hashtable)response.Value;
  132. UserAgentData uagent = m_userProfileData.CurrentAgent;
  133. Assert.That(uagent,Is.Not.Null);
  134. Assert.That(responseData["first_name"], Is.Not.Null);
  135. Assert.That(responseData["first_name"], Is.EqualTo(m_firstName));
  136. Assert.That(responseData["last_name"], Is.EqualTo(m_lastName));
  137. Assert.That(responseData["agent_id"], Is.EqualTo(uagent.ProfileID.ToString()));
  138. Assert.That(responseData["session_id"], Is.EqualTo(uagent.SessionID.ToString()));
  139. Assert.That(responseData["secure_session_id"], Is.EqualTo(uagent.SecureSessionID.ToString()));
  140. ArrayList invlibroot = (ArrayList) responseData["inventory-lib-root"];
  141. Hashtable invlibroothash = (Hashtable) invlibroot[0];
  142. Assert.That(invlibroothash["folder_id"],Is.EqualTo("00000112-000f-0000-0000-000100bba000"));
  143. Assert.That(
  144. responseData["circuit_code"], Is.GreaterThanOrEqualTo(0) & Is.LessThanOrEqualTo(Int32.MaxValue));
  145. Assert.That(responseData["message"], Is.EqualTo("Hello folks"));
  146. Assert.That(responseData["buddy-list"], Is.Empty);
  147. Assert.That(responseData["start_location"], Is.EqualTo("last"));
  148. Regex capsSeedPattern
  149. = new Regex("^http://"
  150. + NetworkUtil.GetHostFor(tmpLocal, m_regionExternalName)
  151. + ":9000/CAPS/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}0000/$");
  152. Assert.That(capsSeedPattern.IsMatch((string)responseData["seed_capability"]), Is.True);
  153. }
  154. [Test]
  155. public void T012_TestAuthenticatedLoginForBuddies()
  156. {
  157. TestHelper.InMethod();
  158. // 1.1) Test for budddies!
  159. m_localUserServices.AddUser("Friend","Number1","boingboing","[email protected]",42,43);
  160. m_localUserServices.AddUser("Friend","Number2","boingboing","[email protected]",42,43);
  161. UserProfileData friend1 = m_localUserServices.GetUserProfile("Friend","Number1");
  162. UserProfileData friend2 = m_localUserServices.GetUserProfile("Friend","Number2");
  163. m_localUserServices.AddNewUserFriend(friend1.ID,m_userProfileData.ID,1);
  164. m_localUserServices.AddNewUserFriend(friend1.ID,friend2.ID,2);
  165. Hashtable loginParams = new Hashtable();
  166. loginParams["first"] = "Friend";
  167. loginParams["last"] = "Number1";
  168. loginParams["passwd"] = "boingboing";
  169. ArrayList sendParams = new ArrayList();
  170. sendParams.Add(loginParams);
  171. sendParams.Add(m_capsEndPoint); // is this parameter correct?
  172. sendParams.Add(new Uri("http://localhost:8002/")); // is this parameter correct?
  173. XmlRpcRequest request = new XmlRpcRequest("login_to_simulator", sendParams);
  174. IPAddress tmpLocal = Util.GetLocalHost();
  175. IPEndPoint tmpEnd = new IPEndPoint(tmpLocal, 80);
  176. XmlRpcResponse response = m_loginService.XmlRpcLoginMethod(request, tmpEnd);
  177. Hashtable responseData = (Hashtable)response.Value;
  178. ArrayList friendslist = (ArrayList) responseData["buddy-list"];
  179. Assert.That(friendslist,Is.Not.Null);
  180. Hashtable buddy1 = (Hashtable) friendslist[0];
  181. Hashtable buddy2 = (Hashtable) friendslist[1];
  182. Assert.That(friendslist.Count, Is.EqualTo(2));
  183. Assert.That(m_userProfileData.ID.ToString(), Is.EqualTo(buddy1["buddy_id"]) | Is.EqualTo(buddy2["buddy_id"]));
  184. Assert.That(friend2.ID.ToString(), Is.EqualTo(buddy1["buddy_id"]) | Is.EqualTo(buddy2["buddy_id"]));
  185. }
  186. [Test]
  187. public void T020_TestAuthenticatedLoginBadUsername()
  188. {
  189. TestHelper.InMethod();
  190. // 2) Test for negative authentication
  191. //
  192. string error_auth_message = "Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist.";
  193. //string error_region_unavailable = "The region you are attempting to log into is not responding. Please select another region and try again.";
  194. // 2.1) Test for wrong user name
  195. Hashtable loginParams = new Hashtable();
  196. loginParams["first"] = m_lastName;
  197. loginParams["last"] = m_firstName;
  198. loginParams["passwd"] = "boingboing";
  199. ArrayList sendParams = new ArrayList();
  200. sendParams.Add(loginParams);
  201. sendParams.Add(m_capsEndPoint); // is this parameter correct?
  202. sendParams.Add(new Uri("http://localhost:8002/")); // is this parameter correct?
  203. XmlRpcRequest request = new XmlRpcRequest("login_to_simulator", sendParams);
  204. IPAddress tmpLocal = Util.GetLocalHost();
  205. IPEndPoint tmpEnd = new IPEndPoint(tmpLocal, 80);
  206. XmlRpcResponse response = m_loginService.XmlRpcLoginMethod(request, tmpEnd);
  207. Hashtable responseData = (Hashtable)response.Value;
  208. Assert.That(responseData["message"], Is.EqualTo(error_auth_message));
  209. }
  210. [Test]
  211. public void T021_TestAuthenticatedLoginBadPassword()
  212. {
  213. TestHelper.InMethod();
  214. string error_auth_message = "Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist.";
  215. // 2.2) Test for wrong password
  216. Hashtable loginParams = new Hashtable();
  217. loginParams["first"] = "Friend";
  218. loginParams["last"] = "Number2";
  219. loginParams["passwd"] = "boing";
  220. ArrayList sendParams = new ArrayList();
  221. sendParams.Add(loginParams);
  222. sendParams.Add(m_capsEndPoint); // is this parameter correct?
  223. sendParams.Add(new Uri("http://localhost:8002/")); // is this parameter correct?
  224. XmlRpcRequest request = new XmlRpcRequest("login_to_simulator", sendParams);
  225. IPAddress tmpLocal = Util.GetLocalHost();
  226. IPEndPoint tmpEnd = new IPEndPoint(tmpLocal, 80);
  227. XmlRpcResponse response = m_loginService.XmlRpcLoginMethod(request, tmpEnd);
  228. Hashtable responseData = (Hashtable)response.Value;
  229. Assert.That(responseData["message"], Is.EqualTo(error_auth_message));
  230. }
  231. [Test]
  232. public void T022_TestAuthenticatedLoginBadXml()
  233. {
  234. TestHelper.InMethod();
  235. string error_xml_message = "Error connecting to grid. Could not percieve credentials from login XML.";
  236. // 2.3) Bad XML
  237. Hashtable loginParams = new Hashtable();
  238. loginParams["first"] = "Friend";
  239. loginParams["banana"] = "Banana";
  240. loginParams["passwd"] = "boingboing";
  241. ArrayList sendParams = new ArrayList();
  242. sendParams.Add(loginParams);
  243. sendParams.Add(m_capsEndPoint); // is this parameter correct?
  244. sendParams.Add(new Uri("http://localhost:8002/")); // is this parameter correct?
  245. XmlRpcRequest request = new XmlRpcRequest("login_to_simulator", sendParams);
  246. IPAddress tmpLocal = Util.GetLocalHost();
  247. IPEndPoint tmpEnd = new IPEndPoint(tmpLocal, 80);
  248. XmlRpcResponse response = m_loginService.XmlRpcLoginMethod(request, tmpEnd);
  249. Hashtable responseData = (Hashtable)response.Value;
  250. Assert.That(responseData["message"], Is.EqualTo(error_xml_message));
  251. }
  252. // [Test]
  253. // Commenting out test now that LLStandAloneLoginService no longer replies with message in this case.
  254. // Kept the code for future test with grid mode, which will keep this behavior.
  255. public void T023_TestAuthenticatedLoginAlreadyLoggedIn()
  256. {
  257. TestHelper.InMethod();
  258. //Console.WriteLine("Starting T023_TestAuthenticatedLoginAlreadyLoggedIn()");
  259. //log4net.Config.XmlConfigurator.Configure();
  260. string error_already_logged = "You appear to be already logged in. " +
  261. "If this is not the case please wait for your session to timeout. " +
  262. "If this takes longer than a few minutes please contact the grid owner. " +
  263. "Please wait 5 minutes if you are going to connect to a region nearby to the region you were at previously.";
  264. // 2.4) Already logged in and sucessfull post login
  265. Hashtable loginParams = new Hashtable();
  266. loginParams["first"] = "Adam";
  267. loginParams["last"] = "West";
  268. loginParams["passwd"] = "boingboing";
  269. ArrayList sendParams = new ArrayList();
  270. sendParams.Add(loginParams);
  271. sendParams.Add(m_capsEndPoint); // is this parameter correct?
  272. sendParams.Add(new Uri("http://localhost:8002/")); // is this parameter correct?
  273. // First we log in.
  274. XmlRpcRequest request = new XmlRpcRequest("login_to_simulator", sendParams);
  275. IPAddress tmpLocal = Util.GetLocalHost();
  276. IPEndPoint tmpEnd = new IPEndPoint(tmpLocal, 80);
  277. XmlRpcResponse response = m_loginService.XmlRpcLoginMethod(request, tmpEnd);
  278. Hashtable responseData = (Hashtable)response.Value;
  279. Assert.That(responseData["message"], Is.EqualTo("Hello folks"));
  280. // Then we try again, this time expecting failure.
  281. request = new XmlRpcRequest("login_to_simulator", sendParams);
  282. response = m_loginService.XmlRpcLoginMethod(request, tmpEnd);
  283. responseData = (Hashtable)response.Value;
  284. Assert.That(responseData["message"], Is.EqualTo(error_already_logged));
  285. // Finally the third time we should be able to get right back in.
  286. request = new XmlRpcRequest("login_to_simulator", sendParams);
  287. response = m_loginService.XmlRpcLoginMethod(request, tmpEnd);
  288. responseData = (Hashtable)response.Value;
  289. Assert.That(responseData["message"], Is.EqualTo("Hello folks"));
  290. //Console.WriteLine("Finished T023_TestAuthenticatedLoginAlreadyLoggedIn()");
  291. }
  292. public class TestLoginToRegionConnector : ILoginServiceToRegionsConnector
  293. {
  294. private List<RegionInfo> m_regionsList = new List<RegionInfo>();
  295. public void AddRegion(RegionInfo regionInfo)
  296. {
  297. lock (m_regionsList)
  298. {
  299. if (!m_regionsList.Contains(regionInfo))
  300. {
  301. m_regionsList.Add(regionInfo);
  302. }
  303. }
  304. }
  305. #region ILoginRegionsConnector Members
  306. public bool RegionLoginsEnabled
  307. {
  308. get { return true; }
  309. }
  310. public void LogOffUserFromGrid(ulong regionHandle, OpenMetaverse.UUID AvatarID, OpenMetaverse.UUID RegionSecret, string message)
  311. {
  312. }
  313. public bool NewUserConnection(ulong regionHandle, AgentCircuitData agent, out string reason)
  314. {
  315. reason = String.Empty;
  316. lock (m_regionsList)
  317. {
  318. foreach (RegionInfo regInfo in m_regionsList)
  319. {
  320. if (regInfo.RegionHandle == regionHandle)
  321. return true;
  322. }
  323. }
  324. reason = "Region not found";
  325. return false;
  326. }
  327. public RegionInfo RequestClosestRegion(string region)
  328. {
  329. lock (m_regionsList)
  330. {
  331. foreach (RegionInfo regInfo in m_regionsList)
  332. {
  333. if (regInfo.RegionName == region)
  334. return regInfo;
  335. }
  336. }
  337. return null;
  338. }
  339. public RegionInfo RequestNeighbourInfo(OpenMetaverse.UUID regionID)
  340. {
  341. lock (m_regionsList)
  342. {
  343. foreach (RegionInfo regInfo in m_regionsList)
  344. {
  345. if (regInfo.RegionID == regionID)
  346. return regInfo;
  347. }
  348. }
  349. return null;
  350. }
  351. public RegionInfo RequestNeighbourInfo(ulong regionHandle)
  352. {
  353. lock (m_regionsList)
  354. {
  355. foreach (RegionInfo regInfo in m_regionsList)
  356. {
  357. if (regInfo.RegionHandle == regionHandle)
  358. return regInfo;
  359. }
  360. }
  361. return null;
  362. }
  363. #endregion
  364. }
  365. }
  366. class TestInventoryService : IInventoryService
  367. {
  368. public TestInventoryService()
  369. {
  370. }
  371. /// <summary>
  372. /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/>
  373. /// </summary>
  374. /// <param name="userId"></param>
  375. /// <returns></returns>
  376. public bool CreateUserInventory(UUID userId)
  377. {
  378. return false;
  379. }
  380. /// <summary>
  381. /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/>
  382. /// </summary>
  383. /// <param name="userId"></param>
  384. /// <returns></returns>
  385. public List<InventoryFolderBase> GetInventorySkeleton(UUID userId)
  386. {
  387. List<InventoryFolderBase> folders = new List<InventoryFolderBase>();
  388. InventoryFolderBase folder = new InventoryFolderBase();
  389. folder.ID = UUID.Random();
  390. folder.Owner = userId;
  391. folders.Add(folder);
  392. return folders;
  393. }
  394. /// <summary>
  395. /// Returns a list of all the active gestures in a user's inventory.
  396. /// </summary>
  397. /// <param name="userId">
  398. /// The <see cref="UUID"/> of the user
  399. /// </param>
  400. /// <returns>
  401. /// A flat list of the gesture items.
  402. /// </returns>
  403. public List<InventoryItemBase> GetActiveGestures(UUID userId)
  404. {
  405. return null;
  406. }
  407. public InventoryCollection GetUserInventory(UUID userID)
  408. {
  409. return null;
  410. }
  411. public void GetUserInventory(UUID userID, OpenSim.Services.Interfaces.InventoryReceiptCallback callback)
  412. {
  413. }
  414. public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
  415. {
  416. return null;
  417. }
  418. public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
  419. {
  420. return null;
  421. }
  422. public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
  423. {
  424. return null;
  425. }
  426. public bool AddFolder(InventoryFolderBase folder)
  427. {
  428. return false;
  429. }
  430. public bool UpdateFolder(InventoryFolderBase folder)
  431. {
  432. return false;
  433. }
  434. public bool MoveFolder(InventoryFolderBase folder)
  435. {
  436. return false;
  437. }
  438. public bool PurgeFolder(InventoryFolderBase folder)
  439. {
  440. return false;
  441. }
  442. public bool AddItem(InventoryItemBase item)
  443. {
  444. return false;
  445. }
  446. public bool UpdateItem(InventoryItemBase item)
  447. {
  448. return false;
  449. }
  450. public bool DeleteItem(InventoryItemBase item)
  451. {
  452. return false;
  453. }
  454. public InventoryItemBase QueryItem(InventoryItemBase item)
  455. {
  456. return null;
  457. }
  458. public InventoryFolderBase QueryFolder(InventoryFolderBase folder)
  459. {
  460. return null;
  461. }
  462. public bool HasInventoryForUser(UUID userID)
  463. {
  464. return false;
  465. }
  466. public InventoryFolderBase GetRootFolder(UUID userID)
  467. {
  468. InventoryFolderBase root = new InventoryFolderBase();
  469. root.ID = UUID.Random();
  470. root.Owner = userID;
  471. root.ParentID = UUID.Zero;
  472. return root;
  473. }
  474. }
  475. }