diff options
author | MW | 2007-02-03 21:09:54 +0000 |
---|---|---|
committer | MW | 2007-02-03 21:09:54 +0000 |
commit | dc2316de9c7a7168263e7a367b4c69189f9bc232 (patch) | |
tree | 57b639a77d585f5ded98f283d24a02617faf5b1a /InventoryManager.cs | |
parent | (no commit message) (diff) | |
download | opensim-SC-dc2316de9c7a7168263e7a367b4c69189f9bc232.zip opensim-SC-dc2316de9c7a7168263e7a367b4c69189f9bc232.tar.gz opensim-SC-dc2316de9c7a7168263e7a367b4c69189f9bc232.tar.bz2 opensim-SC-dc2316de9c7a7168263e7a367b4c69189f9bc232.tar.xz |
Basic Inventory support and clean up
Diffstat (limited to 'InventoryManager.cs')
-rw-r--r-- | InventoryManager.cs | 56 |
1 files changed, 29 insertions, 27 deletions
diff --git a/InventoryManager.cs b/InventoryManager.cs index bbc340e..72c9607 100644 --- a/InventoryManager.cs +++ b/InventoryManager.cs | |||
@@ -43,6 +43,8 @@ namespace OpenSim | |||
43 | public Dictionary<LLUUID, InventoryItem> Items; | 43 | public Dictionary<LLUUID, InventoryItem> Items; |
44 | private Server server; | 44 | private Server server; |
45 | 45 | ||
46 | private const uint FULL_MASK_PERMISSIONS = 2147483647; | ||
47 | |||
46 | /// <summary> | 48 | /// <summary> |
47 | /// | 49 | /// |
48 | /// </summary> | 50 | /// </summary> |
@@ -118,8 +120,8 @@ namespace OpenSim | |||
118 | InventoryFolder Folder=this.Folders[FetchDescend.InventoryData.FolderID]; | 120 | InventoryFolder Folder=this.Folders[FetchDescend.InventoryData.FolderID]; |
119 | InventoryDescendentsPacket Descend=new InventoryDescendentsPacket(); | 121 | InventoryDescendentsPacket Descend=new InventoryDescendentsPacket(); |
120 | Descend.AgentData.AgentID=User_info.AgentID; | 122 | Descend.AgentData.AgentID=User_info.AgentID; |
121 | Descend.AgentData.OwnerID=Folder.OwnerID;//User_info.AgentID; | 123 | Descend.AgentData.OwnerID=Folder.OwnerID; |
122 | Descend.AgentData.FolderID=FetchDescend.InventoryData.FolderID;//Folder.FolderID;//new LLUUID("4fb2dab6-a987-da66-05ee-96ca82bccbf1"); | 124 | Descend.AgentData.FolderID=FetchDescend.InventoryData.FolderID; |
123 | Descend.AgentData.Descendents=Folder.Items.Count; | 125 | Descend.AgentData.Descendents=Folder.Items.Count; |
124 | Descend.AgentData.Version=Folder.Items.Count; | 126 | Descend.AgentData.Version=Folder.Items.Count; |
125 | 127 | ||
@@ -129,26 +131,26 @@ namespace OpenSim | |||
129 | 131 | ||
130 | InventoryItem Item=Folder.Items[i]; | 132 | InventoryItem Item=Folder.Items[i]; |
131 | Descend.ItemData[i]=new InventoryDescendentsPacket.ItemDataBlock(); | 133 | Descend.ItemData[i]=new InventoryDescendentsPacket.ItemDataBlock(); |
132 | Descend.ItemData[i].ItemID=Item.ItemID;//new LLUUID("b7878441893b094917f791174bc8401c"); | 134 | Descend.ItemData[i].ItemID=Item.ItemID; |
133 | Descend.ItemData[i].AssetID=Item.AssetID;//new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); | 135 | Descend.ItemData[i].AssetID=Item.AssetID; |
134 | Descend.ItemData[i].CreatorID=Item.CreatorID;//User_info.AgentID; | 136 | Descend.ItemData[i].CreatorID=Item.CreatorID; |
135 | Descend.ItemData[i].BaseMask=2147483647; | 137 | Descend.ItemData[i].BaseMask=FULL_MASK_PERMISSIONS; |
136 | Descend.ItemData[i].CreationDate=1000; | 138 | Descend.ItemData[i].CreationDate=1000; |
137 | Descend.ItemData[i].Description=enc.GetBytes(Item.Description+"\0"); | 139 | Descend.ItemData[i].Description=enc.GetBytes(Item.Description+"\0"); |
138 | Descend.ItemData[i].EveryoneMask=2147483647;; | 140 | Descend.ItemData[i].EveryoneMask=FULL_MASK_PERMISSIONS; |
139 | Descend.ItemData[i].Flags=1; | 141 | Descend.ItemData[i].Flags=1; |
140 | Descend.ItemData[i].FolderID=Item.FolderID;//new LLUUID("4fb2dab6-a987-da66-05ee-96ca82bccbf1"); | 142 | Descend.ItemData[i].FolderID=Item.FolderID; |
141 | Descend.ItemData[i].GroupID=new LLUUID("00000000-0000-0000-0000-000000000000"); | 143 | Descend.ItemData[i].GroupID=new LLUUID("00000000-0000-0000-0000-000000000000"); |
142 | Descend.ItemData[i].GroupMask=2147483647; | 144 | Descend.ItemData[i].GroupMask=FULL_MASK_PERMISSIONS; |
143 | Descend.ItemData[i].InvType=Item.InvType; | 145 | Descend.ItemData[i].InvType=Item.InvType; |
144 | Descend.ItemData[i].Name=enc.GetBytes(Item.Name+"\0"); | 146 | Descend.ItemData[i].Name=enc.GetBytes(Item.Name+"\0"); |
145 | Descend.ItemData[i].NextOwnerMask=2147483647; | 147 | Descend.ItemData[i].NextOwnerMask=FULL_MASK_PERMISSIONS; |
146 | Descend.ItemData[i].OwnerID=Item.OwnerID;//User_info.AgentID; | 148 | Descend.ItemData[i].OwnerID=Item.OwnerID; |
147 | Descend.ItemData[i].OwnerMask=2147483647;; | 149 | Descend.ItemData[i].OwnerMask=FULL_MASK_PERMISSIONS; |
148 | Descend.ItemData[i].SalePrice=100; | 150 | Descend.ItemData[i].SalePrice=100; |
149 | Descend.ItemData[i].SaleType=0; | 151 | Descend.ItemData[i].SaleType=0; |
150 | Descend.ItemData[i].Type=Item.Type;//libsecondlife.AssetSystem.Asset.ASSET_TYPE_WEARABLE_BODY; | 152 | Descend.ItemData[i].Type=Item.Type; |
151 | Descend.ItemData[i].CRC=libsecondlife.Helpers.InventoryCRC(1000,0,Descend.ItemData[i].InvType,Descend.ItemData[i].Type,Descend.ItemData[i].AssetID ,Descend.ItemData[i].GroupID,100,Descend.ItemData[i].OwnerID,Descend.ItemData[i].CreatorID,Descend.ItemData[i].ItemID,Descend.ItemData[i].FolderID,2147483647,1,2147483647,2147483647,2147483647); | 153 | Descend.ItemData[i].CRC=libsecondlife.Helpers.InventoryCRC(1000,0,Descend.ItemData[i].InvType,Descend.ItemData[i].Type,Descend.ItemData[i].AssetID ,Descend.ItemData[i].GroupID,100,Descend.ItemData[i].OwnerID,Descend.ItemData[i].CreatorID,Descend.ItemData[i].ItemID,Descend.ItemData[i].FolderID,FULL_MASK_PERMISSIONS,1,FULL_MASK_PERMISSIONS,FULL_MASK_PERMISSIONS,FULL_MASK_PERMISSIONS); |
152 | } | 154 | } |
153 | server.SendPacket(Descend,true,User_info); | 155 | server.SendPacket(Descend,true,User_info); |
154 | 156 | ||
@@ -177,26 +179,26 @@ namespace OpenSim | |||
177 | InventoryReply.AgentData.AgentID=User_info.AgentID; | 179 | InventoryReply.AgentData.AgentID=User_info.AgentID; |
178 | InventoryReply.InventoryData=new FetchInventoryReplyPacket.InventoryDataBlock[1]; | 180 | InventoryReply.InventoryData=new FetchInventoryReplyPacket.InventoryDataBlock[1]; |
179 | InventoryReply.InventoryData[0]=new FetchInventoryReplyPacket.InventoryDataBlock(); | 181 | InventoryReply.InventoryData[0]=new FetchInventoryReplyPacket.InventoryDataBlock(); |
180 | InventoryReply.InventoryData[0].ItemID=Item.ItemID;//new LLUUID("b7878441893b094917f791174bc8401c"); | 182 | InventoryReply.InventoryData[0].ItemID=Item.ItemID; |
181 | InventoryReply.InventoryData[0].AssetID=Item.AssetID;//new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); | 183 | InventoryReply.InventoryData[0].AssetID=Item.AssetID; |
182 | InventoryReply.InventoryData[0].CreatorID=Item.CreatorID;//User_info.AgentID; | 184 | InventoryReply.InventoryData[0].CreatorID=Item.CreatorID; |
183 | InventoryReply.InventoryData[0].BaseMask=2147483647; | 185 | InventoryReply.InventoryData[0].BaseMask=FULL_MASK_PERMISSIONS; |
184 | InventoryReply.InventoryData[0].CreationDate=1000; | 186 | InventoryReply.InventoryData[0].CreationDate=1000; |
185 | InventoryReply.InventoryData[0].Description=enc.GetBytes( Item.Description+"\0"); | 187 | InventoryReply.InventoryData[0].Description=enc.GetBytes( Item.Description+"\0"); |
186 | InventoryReply.InventoryData[0].EveryoneMask=2147483647;; | 188 | InventoryReply.InventoryData[0].EveryoneMask=FULL_MASK_PERMISSIONS; |
187 | InventoryReply.InventoryData[0].Flags=1; | 189 | InventoryReply.InventoryData[0].Flags=1; |
188 | InventoryReply.InventoryData[0].FolderID=Item.FolderID;//new LLUUID("4fb2dab6-a987-da66-05ee-96ca82bccbf1"); | 190 | InventoryReply.InventoryData[0].FolderID=Item.FolderID; |
189 | InventoryReply.InventoryData[0].GroupID=new LLUUID("00000000-0000-0000-0000-000000000000"); | 191 | InventoryReply.InventoryData[0].GroupID=new LLUUID("00000000-0000-0000-0000-000000000000"); |
190 | InventoryReply.InventoryData[0].GroupMask=2147483647; | 192 | InventoryReply.InventoryData[0].GroupMask=FULL_MASK_PERMISSIONS; |
191 | InventoryReply.InventoryData[0].InvType=Item.InvType; | 193 | InventoryReply.InventoryData[0].InvType=Item.InvType; |
192 | InventoryReply.InventoryData[0].Name=enc.GetBytes(Item.Name+"\0"); | 194 | InventoryReply.InventoryData[0].Name=enc.GetBytes(Item.Name+"\0"); |
193 | InventoryReply.InventoryData[0].NextOwnerMask=2147483647; | 195 | InventoryReply.InventoryData[0].NextOwnerMask=FULL_MASK_PERMISSIONS; |
194 | InventoryReply.InventoryData[0].OwnerID=Item.OwnerID;//User_info.AgentID; | 196 | InventoryReply.InventoryData[0].OwnerID=Item.OwnerID; |
195 | InventoryReply.InventoryData[0].OwnerMask=2147483647;; | 197 | InventoryReply.InventoryData[0].OwnerMask=FULL_MASK_PERMISSIONS; |
196 | InventoryReply.InventoryData[0].SalePrice=100; | 198 | InventoryReply.InventoryData[0].SalePrice=100; |
197 | InventoryReply.InventoryData[0].SaleType=0; | 199 | InventoryReply.InventoryData[0].SaleType=0; |
198 | InventoryReply.InventoryData[0].Type=Item.Type;//libsecondlife.AssetSystem.Asset.ASSET_TYPE_WEARABLE_BODY; | 200 | InventoryReply.InventoryData[0].Type=Item.Type; |
199 | InventoryReply.InventoryData[0].CRC=libsecondlife.Helpers.InventoryCRC(1000,0,InventoryReply.InventoryData[0].InvType,InventoryReply.InventoryData[0].Type,InventoryReply.InventoryData[0].AssetID ,InventoryReply.InventoryData[0].GroupID,100,InventoryReply.InventoryData[0].OwnerID,InventoryReply.InventoryData[0].CreatorID,InventoryReply.InventoryData[0].ItemID,InventoryReply.InventoryData[0].FolderID,2147483647,1,2147483647,2147483647,2147483647); | 201 | InventoryReply.InventoryData[0].CRC=libsecondlife.Helpers.InventoryCRC(1000,0,InventoryReply.InventoryData[0].InvType,InventoryReply.InventoryData[0].Type,InventoryReply.InventoryData[0].AssetID ,InventoryReply.InventoryData[0].GroupID,100,InventoryReply.InventoryData[0].OwnerID,InventoryReply.InventoryData[0].CreatorID,InventoryReply.InventoryData[0].ItemID,InventoryReply.InventoryData[0].FolderID,FULL_MASK_PERMISSIONS,1,FULL_MASK_PERMISSIONS,FULL_MASK_PERMISSIONS,FULL_MASK_PERMISSIONS); |
200 | server.SendPacket(InventoryReply,true,User_info); | 202 | server.SendPacket(InventoryReply,true,User_info); |
201 | } | 203 | } |
202 | } | 204 | } |
@@ -226,7 +228,7 @@ namespace OpenSim | |||
226 | public LLUUID OwnerID; | 228 | public LLUUID OwnerID; |
227 | public LLUUID ItemID; | 229 | public LLUUID ItemID; |
228 | public LLUUID AssetID; | 230 | public LLUUID AssetID; |
229 | public LLUUID CreatorID=LLUUID.Zero;//new LLUUID("3d924400-038e-6ad9-920b-cfbb9b40585c"); | 231 | public LLUUID CreatorID=LLUUID.Zero; |
230 | public sbyte InvType; | 232 | public sbyte InvType; |
231 | public sbyte Type; | 233 | public sbyte Type; |
232 | public string Name; | 234 | public string Name; |