InventoryManager.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. * Copyright (c) OpenSim project, http://sim.opensecondlife.org/
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. * * Redistributions of source code must retain the above copyright
  7. * notice, this list of conditions and the following disclaimer.
  8. * * Redistributions in binary form must reproduce the above copyright
  9. * notice, this list of conditions and the following disclaimer in the
  10. * documentation and/or other materials provided with the distribution.
  11. * * Neither the name of the <organization> nor the
  12. * names of its contributors may be used to endorse or promote products
  13. * derived from this software without specific prior written permission.
  14. *
  15. * THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
  16. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  17. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  18. * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
  19. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  20. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  21. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  22. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  23. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  24. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. *
  26. */
  27. using System;
  28. using System.Collections.Generic;
  29. using libsecondlife;
  30. namespace OpenSim
  31. {
  32. /// <summary>
  33. /// Local cache of Inventories
  34. /// </summary>
  35. public class InventoryManager
  36. {
  37. private List<AgentInventory> _agentsInventory;
  38. private List<UserServerRequest> _serverRequests; //list of requests made to user server.
  39. public InventoryManager()
  40. {
  41. _agentsInventory = new List<AgentInventory>();
  42. _serverRequests = new List<UserServerRequest>();
  43. }
  44. }
  45. public class AgentInventory
  46. {
  47. //Holds the local copy of Inventory info for a agent
  48. public List<InventoryFolder> Folders;
  49. public int LastCached; //time this was last stored/compared to user server
  50. public LLUUID AgentID;
  51. public AvatarWearable[] Wearables;
  52. public AgentInventory()
  53. {
  54. Folders = new List<InventoryFolder>();
  55. Wearables = new AvatarWearable[2];
  56. for(int i = 0; i < 2; i++)
  57. {
  58. Wearables[i] = new AvatarWearable();
  59. }
  60. }
  61. }
  62. public class InventoryFolder
  63. {
  64. public List<InventoryItem> Items;
  65. //public List<InventoryFolder> Subfolders;
  66. public LLUUID FolderID;
  67. public LLUUID OwnerID;
  68. public LLUUID ParentID;
  69. public string Name;
  70. public byte Type;
  71. public InventoryFolder()
  72. {
  73. Items = new List<InventoryItem>();
  74. //Subfolders = new List<InventoryFolder>();
  75. }
  76. }
  77. public class InventoryItem
  78. {
  79. public LLUUID FolderID;
  80. public LLUUID OwnerID;
  81. public LLUUID ItemID;
  82. public LLUUID AssetID;
  83. public LLUUID CreatorID;
  84. public sbyte InvType;
  85. public sbyte Type;
  86. public string Name;
  87. public string Description;
  88. public InventoryItem()
  89. {
  90. this.CreatorID = LLUUID.Zero;
  91. }
  92. }
  93. public class UserServerRequest
  94. {
  95. public UserServerRequest()
  96. {
  97. }
  98. }
  99. }