diff options
author | Melanie | 2012-03-31 01:34:39 +0200 |
---|---|---|
committer | Melanie | 2012-03-31 02:32:47 +0100 |
commit | 6e7f13a72d4e43f8ca564247e0b56bf5706bbdb1 (patch) | |
tree | a41a404eacd16328eeed8243e1cf27e2e5e0ce64 /OpenSim | |
parent | refactor: Rename SOG.GetChildPart() to GetPart() since it can also return the... (diff) | |
download | opensim-SC_OLD-6e7f13a72d4e43f8ca564247e0b56bf5706bbdb1.zip opensim-SC_OLD-6e7f13a72d4e43f8ca564247e0b56bf5706bbdb1.tar.gz opensim-SC_OLD-6e7f13a72d4e43f8ca564247e0b56bf5706bbdb1.tar.bz2 opensim-SC_OLD-6e7f13a72d4e43f8ca564247e0b56bf5706bbdb1.tar.xz |
Implement bulk inventory update over CAPS (not recursive by design,
do NOT CHANGE THIS, needed for HG 2.0)
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index f79597e..3470fa9 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -12295,7 +12295,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
12295 | ItemData.Add(ItemDataMap); | 12295 | ItemData.Add(ItemDataMap); |
12296 | } | 12296 | } |
12297 | 12297 | ||
12298 | llsd.Add("ItemData", ItemData); | 12298 | llsd.Add("InventoryData", ItemData); |
12299 | 12299 | ||
12300 | eq.Enqueue(BuildEvent("RemoveInventoryItem", | 12300 | eq.Enqueue(BuildEvent("RemoveInventoryItem", |
12301 | llsd), AgentId); | 12301 | llsd), AgentId); |
@@ -12339,6 +12339,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
12339 | llsd), AgentId); | 12339 | llsd), AgentId); |
12340 | } | 12340 | } |
12341 | 12341 | ||
12342 | private byte[] EncodeU32(uint val) | ||
12343 | { | ||
12344 | byte[] ret = BitConverter.GetBytes(val); | ||
12345 | if (BitConverter.IsLittleEndian) | ||
12346 | Array.Reverse(ret); | ||
12347 | return ret; | ||
12348 | } | ||
12349 | |||
12342 | public void SendBulkUpdateInventory(InventoryFolderBase[] folders, InventoryItemBase[] items) | 12350 | public void SendBulkUpdateInventory(InventoryFolderBase[] folders, InventoryItemBase[] items) |
12343 | { | 12351 | { |
12344 | IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>(); | 12352 | IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>(); |
@@ -12354,6 +12362,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
12354 | OSDMap AgentDataMap = new OSDMap(1); | 12362 | OSDMap AgentDataMap = new OSDMap(1); |
12355 | AgentDataMap.Add("AgentID", OSD.FromUUID(AgentId)); | 12363 | AgentDataMap.Add("AgentID", OSD.FromUUID(AgentId)); |
12356 | AgentDataMap.Add("SessionID", OSD.FromUUID(SessionId)); | 12364 | AgentDataMap.Add("SessionID", OSD.FromUUID(SessionId)); |
12365 | AgentDataMap.Add("TransactionID", OSD.FromUUID(UUID.Random())); | ||
12357 | 12366 | ||
12358 | OSDArray AgentData = new OSDArray(1); | 12367 | OSDArray AgentData = new OSDArray(1); |
12359 | AgentData.Add(AgentDataMap); | 12368 | AgentData.Add(AgentDataMap); |
@@ -12381,10 +12390,47 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
12381 | foreach (InventoryItemBase item in items) | 12390 | foreach (InventoryItemBase item in items) |
12382 | { | 12391 | { |
12383 | OSDMap ItemDataMap = new OSDMap(); | 12392 | OSDMap ItemDataMap = new OSDMap(); |
12393 | |||
12394 | ItemDataMap.Add("ItemID", OSD.FromUUID(item.ID)); | ||
12395 | ItemDataMap.Add("FolderID", OSD.FromUUID(item.Folder)); | ||
12396 | |||
12397 | ItemDataMap.Add("CreatorID", OSD.FromUUID(item.CreatorIdAsUuid)); | ||
12398 | ItemDataMap.Add("OwnerID", OSD.FromUUID(item.Owner)); | ||
12399 | ItemDataMap.Add("GroupID", OSD.FromUUID(item.GroupID)); | ||
12400 | ItemDataMap.Add("BaseMask", OSD.FromBinary(EncodeU32((uint)item.BasePermissions))); | ||
12401 | ItemDataMap.Add("OwnerMask", OSD.FromBinary(EncodeU32((uint)item.CurrentPermissions))); | ||
12402 | ItemDataMap.Add("GroupMask", OSD.FromBinary(EncodeU32((uint)item.GroupPermissions))); | ||
12403 | ItemDataMap.Add("EveryoneMask", OSD.FromBinary(EncodeU32((uint)item.EveryOnePermissions))); | ||
12404 | ItemDataMap.Add("NextOwnerMask", OSD.FromBinary(EncodeU32((uint)item.NextPermissions))); | ||
12405 | ItemDataMap.Add("GroupOwned", OSD.FromBoolean(item.GroupOwned)); | ||
12406 | ItemDataMap.Add("AssetID", OSD.FromUUID(item.AssetID)); | ||
12407 | ItemDataMap.Add("Type", OSD.FromInteger(item.AssetType)); | ||
12408 | ItemDataMap.Add("InvType", OSD.FromInteger(item.InvType)); | ||
12409 | ItemDataMap.Add("Flags", OSD.FromBinary(EncodeU32((uint)item.Flags))); | ||
12410 | ItemDataMap.Add("SaleType", OSD.FromInteger((byte)item.SaleType)); | ||
12411 | ItemDataMap.Add("SalePrice", OSD.FromInteger(item.SalePrice)); | ||
12412 | ItemDataMap.Add("Name", OSD.FromString(item.Name)); | ||
12413 | ItemDataMap.Add("Description", OSD.FromString(item.Description)); | ||
12414 | ItemDataMap.Add("CreationDate", OSD.FromInteger(item.CreationDate)); | ||
12415 | |||
12416 | ItemDataMap.Add("CRC", OSD.FromBinary(EncodeU32( | ||
12417 | Helpers.InventoryCRC(1000, 0, (sbyte)item.InvType, | ||
12418 | (sbyte)item.AssetType, item.AssetID, | ||
12419 | item.GroupID, 100, | ||
12420 | item.Owner, item.CreatorIdAsUuid, | ||
12421 | item.ID, item.Folder, | ||
12422 | (uint)PermissionMask.All, 1, (uint)PermissionMask.All, (uint)PermissionMask.All, | ||
12423 | (uint)PermissionMask.All) | ||
12424 | ))); | ||
12425 | ItemDataMap.Add("CallbackID", 0); | ||
12426 | |||
12384 | ItemData.Add(ItemDataMap); | 12427 | ItemData.Add(ItemDataMap); |
12385 | } | 12428 | } |
12386 | 12429 | ||
12387 | llsd.Add("ItemData", ItemData); | 12430 | llsd.Add("ItemData", ItemData); |
12431 | |||
12432 | eq.Enqueue(BuildEvent("BulkUpdateInventory", | ||
12433 | llsd), AgentId); | ||
12388 | } | 12434 | } |
12389 | } | 12435 | } |
12390 | } | 12436 | } |