diff options
Some work on Inventory (not yet finished or enabled)
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.API.cs | 46 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs | 40 |
2 files changed, 64 insertions, 22 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index 8a5e631..084f7e0 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs | |||
@@ -81,6 +81,10 @@ namespace OpenSim.Region.ClientStack | |||
81 | public event RequestMapBlocks OnRequestMapBlocks; | 81 | public event RequestMapBlocks OnRequestMapBlocks; |
82 | public event TeleportLocationRequest OnTeleportLocationRequest; | 82 | public event TeleportLocationRequest OnTeleportLocationRequest; |
83 | 83 | ||
84 | public event CreateInventoryFolder OnCreateNewInventoryFolder; | ||
85 | public event FetchInventoryDescendents OnFetchInventoryDescendents; | ||
86 | public event RequestTaskInventory OnRequestTaskInventory; | ||
87 | |||
84 | public event UUIDNameRequest OnNameFromUUIDRequest; | 88 | public event UUIDNameRequest OnNameFromUUIDRequest; |
85 | 89 | ||
86 | public event ParcelPropertiesRequest OnParcelPropertiesRequest; | 90 | public event ParcelPropertiesRequest OnParcelPropertiesRequest; |
@@ -577,6 +581,48 @@ namespace OpenSim.Region.ClientStack | |||
577 | this.OutPacket(inventoryReply); | 581 | this.OutPacket(inventoryReply); |
578 | } | 582 | } |
579 | 583 | ||
584 | public void SendInventoryItemUpdate(InventoryItemBase Item) | ||
585 | { | ||
586 | Encoding enc = Encoding.ASCII; | ||
587 | uint FULL_MASK_PERMISSIONS = 2147483647; | ||
588 | UpdateCreateInventoryItemPacket InventoryReply = new UpdateCreateInventoryItemPacket(); | ||
589 | InventoryReply.AgentData.AgentID = this.AgentID; | ||
590 | InventoryReply.AgentData.SimApproved = true; | ||
591 | InventoryReply.InventoryData = new UpdateCreateInventoryItemPacket.InventoryDataBlock[1]; | ||
592 | InventoryReply.InventoryData[0] = new UpdateCreateInventoryItemPacket.InventoryDataBlock(); | ||
593 | InventoryReply.InventoryData[0].ItemID = Item.inventoryID; | ||
594 | InventoryReply.InventoryData[0].AssetID = Item.assetID; | ||
595 | InventoryReply.InventoryData[0].CreatorID = Item.creatorsID; | ||
596 | InventoryReply.InventoryData[0].BaseMask = FULL_MASK_PERMISSIONS; | ||
597 | InventoryReply.InventoryData[0].CreationDate = 1000; | ||
598 | InventoryReply.InventoryData[0].Description = enc.GetBytes(Item.inventoryDescription + "\0"); | ||
599 | InventoryReply.InventoryData[0].EveryoneMask = FULL_MASK_PERMISSIONS; | ||
600 | InventoryReply.InventoryData[0].Flags = 0; | ||
601 | InventoryReply.InventoryData[0].FolderID = Item.parentFolderID; | ||
602 | InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); | ||
603 | InventoryReply.InventoryData[0].GroupMask = FULL_MASK_PERMISSIONS; | ||
604 | InventoryReply.InventoryData[0].InvType =(sbyte) Item.type; | ||
605 | InventoryReply.InventoryData[0].Name = enc.GetBytes(Item.inventoryName + "\0"); | ||
606 | InventoryReply.InventoryData[0].NextOwnerMask = FULL_MASK_PERMISSIONS; | ||
607 | InventoryReply.InventoryData[0].OwnerID = Item.avatarID; | ||
608 | InventoryReply.InventoryData[0].OwnerMask = FULL_MASK_PERMISSIONS; | ||
609 | InventoryReply.InventoryData[0].SalePrice = 100; | ||
610 | InventoryReply.InventoryData[0].SaleType = 0; | ||
611 | InventoryReply.InventoryData[0].Type =(sbyte) Item.type; | ||
612 | InventoryReply.InventoryData[0].CRC = 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); | ||
613 | |||
614 | OutPacket(InventoryReply); | ||
615 | } | ||
616 | |||
617 | public void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName) | ||
618 | { | ||
619 | ReplyTaskInventoryPacket replytask = new ReplyTaskInventoryPacket(); | ||
620 | replytask.InventoryData.TaskID = taskID; | ||
621 | replytask.InventoryData.Serial = serial; | ||
622 | replytask.InventoryData.Filename = fileName; | ||
623 | OutPacket(replytask); | ||
624 | } | ||
625 | |||
580 | /// <summary> | 626 | /// <summary> |
581 | /// | 627 | /// |
582 | /// </summary> | 628 | /// </summary> |
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs index c248b29..267e7ee 100644 --- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs +++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs | |||
@@ -373,7 +373,8 @@ namespace OpenSim.Region.ClientStack | |||
373 | break; | 373 | break; |
374 | case PacketType.AssetUploadRequest: | 374 | case PacketType.AssetUploadRequest: |
375 | AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; | 375 | AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; |
376 | this.UploadAssets.HandleUploadPacket(request, request.AssetBlock.TransactionID.Combine(this.SecureSessionID)); | 376 | // Console.WriteLine(request.ToString()); |
377 | //this.UploadAssets.HandleUploadPacket(request, request.AssetBlock.TransactionID.Combine(this.SecureSessionID)); | ||
377 | break; | 378 | break; |
378 | case PacketType.RequestXfer: | 379 | case PacketType.RequestXfer: |
379 | //Console.WriteLine(Pack.ToString()); | 380 | //Console.WriteLine(Pack.ToString()); |
@@ -382,9 +383,12 @@ namespace OpenSim.Region.ClientStack | |||
382 | this.UploadAssets.HandleXferPacket((SendXferPacketPacket)Pack); | 383 | this.UploadAssets.HandleXferPacket((SendXferPacketPacket)Pack); |
383 | break; | 384 | break; |
384 | case PacketType.CreateInventoryFolder: | 385 | case PacketType.CreateInventoryFolder: |
385 | CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack; | 386 | if (this.OnCreateNewInventoryFolder != null) |
386 | m_inventoryCache.CreateNewInventoryFolder(this, invFolder.FolderData.FolderID, (ushort)invFolder.FolderData.Type, Util.FieldToString(invFolder.FolderData.Name), invFolder.FolderData.ParentID); | 387 | { |
387 | //Console.WriteLine(Pack.ToString()); | 388 | CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack; |
389 | this.OnCreateNewInventoryFolder(this, invFolder.FolderData.FolderID, (ushort)invFolder.FolderData.Type, Util.FieldToString(invFolder.FolderData.Name), invFolder.FolderData.ParentID); | ||
390 | //m_inventoryCache.CreateNewInventoryFolder(this, invFolder.FolderData.FolderID, (ushort)invFolder.FolderData.Type, Util.FieldToString(invFolder.FolderData.Name), invFolder.FolderData.ParentID); | ||
391 | } | ||
388 | break; | 392 | break; |
389 | case PacketType.CreateInventoryItem: | 393 | case PacketType.CreateInventoryItem: |
390 | //Console.WriteLine(Pack.ToString()); | 394 | //Console.WriteLine(Pack.ToString()); |
@@ -405,8 +409,12 @@ namespace OpenSim.Region.ClientStack | |||
405 | m_inventoryCache.FetchInventory(this, FetchInventory); | 409 | m_inventoryCache.FetchInventory(this, FetchInventory); |
406 | break; | 410 | break; |
407 | case PacketType.FetchInventoryDescendents: | 411 | case PacketType.FetchInventoryDescendents: |
408 | FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack; | 412 | if (this.OnFetchInventoryDescendents != null) |
409 | m_inventoryCache.FetchInventoryDescendents(this, Fetch); | 413 | { |
414 | FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack; | ||
415 | // m_inventoryCache.FetchInventoryDescendents(this, Fetch); | ||
416 | this.OnFetchInventoryDescendents(this, Fetch.InventoryData.FolderID, Fetch.InventoryData.OwnerID, Fetch.InventoryData.FetchFolders, Fetch.InventoryData.FetchItems, Fetch.InventoryData.SortOrder); | ||
417 | } | ||
410 | break; | 418 | break; |
411 | case PacketType.UpdateInventoryItem: | 419 | case PacketType.UpdateInventoryItem: |
412 | UpdateInventoryItemPacket update = (UpdateInventoryItemPacket)Pack; | 420 | UpdateInventoryItemPacket update = (UpdateInventoryItemPacket)Pack; |
@@ -444,22 +452,10 @@ namespace OpenSim.Region.ClientStack | |||
444 | case PacketType.RequestTaskInventory: | 452 | case PacketType.RequestTaskInventory: |
445 | // Console.WriteLine(Pack.ToString()); | 453 | // Console.WriteLine(Pack.ToString()); |
446 | RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack; | 454 | RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack; |
447 | ReplyTaskInventoryPacket replytask = new ReplyTaskInventoryPacket(); | 455 | if (this.OnRequestTaskInventory != null) |
448 | //bool foundent = false; | 456 | { |
449 | /* foreach (Entity ent in m_world.Entities.Values) | 457 | this.OnRequestTaskInventory(this, requesttask.InventoryData.LocalID); |
450 | { | 458 | } |
451 | if (ent.localid == requesttask.InventoryData.LocalID) | ||
452 | { | ||
453 | replytask.InventoryData.TaskID = ent.uuid; | ||
454 | replytask.InventoryData.Serial = 0; | ||
455 | replytask.InventoryData.Filename = new byte[0]; | ||
456 | foundent = true; | ||
457 | } | ||
458 | } | ||
459 | if (foundent) | ||
460 | { | ||
461 | this.OutPacket(replytask); | ||
462 | }*/ | ||
463 | break; | 459 | break; |
464 | case PacketType.UpdateTaskInventory: | 460 | case PacketType.UpdateTaskInventory: |
465 | // Console.WriteLine(Pack.ToString()); | 461 | // Console.WriteLine(Pack.ToString()); |