Permalink
Browse files

Revert "Revert "Implement bulk inventory update over CAPS (not recurs…

…ive by design,""

This reverts commit a90b0e3.

Sorry, accidentally reverted this completely by mistake, reverting the revert.
  • Loading branch information...
1 parent 737e177 commit ab71779221d580410e8b1c07e94f89ca933f9855 @justincc justincc committed Apr 27, 2012
Showing with 47 additions and 1 deletion.
  1. +47 −1 OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -12296,7 +12296,7 @@ public void SendRemoveInventoryItems(UUID[] items)
ItemData.Add(ItemDataMap);
}
- llsd.Add("ItemData", ItemData);
+ llsd.Add("InventoryData", ItemData);
eq.Enqueue(BuildEvent("RemoveInventoryItem",
llsd), AgentId);
@@ -12340,6 +12340,14 @@ public void SendRemoveInventoryFolders(UUID[] folders)
llsd), AgentId);
}
+ private byte[] EncodeU32(uint val)
+ {
+ byte[] ret = BitConverter.GetBytes(val);
+ if (BitConverter.IsLittleEndian)
+ Array.Reverse(ret);
+ return ret;
+ }
+
public void SendBulkUpdateInventory(InventoryFolderBase[] folders, InventoryItemBase[] items)
{
IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>();
@@ -12355,6 +12363,7 @@ public void SendBulkUpdateInventory(InventoryFolderBase[] folders, InventoryItem
OSDMap AgentDataMap = new OSDMap(1);
AgentDataMap.Add("AgentID", OSD.FromUUID(AgentId));
AgentDataMap.Add("SessionID", OSD.FromUUID(SessionId));
+ AgentDataMap.Add("TransactionID", OSD.FromUUID(UUID.Random()));
OSDArray AgentData = new OSDArray(1);
AgentData.Add(AgentDataMap);
@@ -12382,10 +12391,47 @@ public void SendBulkUpdateInventory(InventoryFolderBase[] folders, InventoryItem
foreach (InventoryItemBase item in items)
{
OSDMap ItemDataMap = new OSDMap();
+
+ ItemDataMap.Add("ItemID", OSD.FromUUID(item.ID));
+ ItemDataMap.Add("FolderID", OSD.FromUUID(item.Folder));
+
+ ItemDataMap.Add("CreatorID", OSD.FromUUID(item.CreatorIdAsUuid));
+ ItemDataMap.Add("OwnerID", OSD.FromUUID(item.Owner));
+ ItemDataMap.Add("GroupID", OSD.FromUUID(item.GroupID));
+ ItemDataMap.Add("BaseMask", OSD.FromBinary(EncodeU32((uint)item.BasePermissions)));
+ ItemDataMap.Add("OwnerMask", OSD.FromBinary(EncodeU32((uint)item.CurrentPermissions)));
+ ItemDataMap.Add("GroupMask", OSD.FromBinary(EncodeU32((uint)item.GroupPermissions)));
+ ItemDataMap.Add("EveryoneMask", OSD.FromBinary(EncodeU32((uint)item.EveryOnePermissions)));
+ ItemDataMap.Add("NextOwnerMask", OSD.FromBinary(EncodeU32((uint)item.NextPermissions)));
+ ItemDataMap.Add("GroupOwned", OSD.FromBoolean(item.GroupOwned));
+ ItemDataMap.Add("AssetID", OSD.FromUUID(item.AssetID));
+ ItemDataMap.Add("Type", OSD.FromInteger(item.AssetType));
+ ItemDataMap.Add("InvType", OSD.FromInteger(item.InvType));
+ ItemDataMap.Add("Flags", OSD.FromBinary(EncodeU32((uint)item.Flags)));
+ ItemDataMap.Add("SaleType", OSD.FromInteger((byte)item.SaleType));
+ ItemDataMap.Add("SalePrice", OSD.FromInteger(item.SalePrice));
+ ItemDataMap.Add("Name", OSD.FromString(item.Name));
+ ItemDataMap.Add("Description", OSD.FromString(item.Description));
+ ItemDataMap.Add("CreationDate", OSD.FromInteger(item.CreationDate));
+
+ ItemDataMap.Add("CRC", OSD.FromBinary(EncodeU32(
+ Helpers.InventoryCRC(1000, 0, (sbyte)item.InvType,
+ (sbyte)item.AssetType, item.AssetID,
+ item.GroupID, 100,
+ item.Owner, item.CreatorIdAsUuid,
+ item.ID, item.Folder,
+ (uint)PermissionMask.All, 1, (uint)PermissionMask.All, (uint)PermissionMask.All,
+ (uint)PermissionMask.All)
+ )));
+ ItemDataMap.Add("CallbackID", 0);
+
ItemData.Add(ItemDataMap);
}
llsd.Add("ItemData", ItemData);
+
+ eq.Enqueue(BuildEvent("BulkUpdateInventory",
+ llsd), AgentId);
}
}
}

0 comments on commit ab71779

Please sign in to comment.