diff options
author | Charles Krinke | 2008-02-18 03:25:14 +0000 |
---|---|---|
committer | Charles Krinke | 2008-02-18 03:25:14 +0000 |
commit | 2c81e18fc33c12b3adcd4559b88d385779c7be6f (patch) | |
tree | 38607fed0f892e0356ba1981bf8458562a419873 /OpenSim | |
parent | Thank you very much, Hashbox for: (diff) | |
download | opensim-SC_OLD-2c81e18fc33c12b3adcd4559b88d385779c7be6f.zip opensim-SC_OLD-2c81e18fc33c12b3adcd4559b88d385779c7be6f.tar.gz opensim-SC_OLD-2c81e18fc33c12b3adcd4559b88d385779c7be6f.tar.bz2 opensim-SC_OLD-2c81e18fc33c12b3adcd4559b88d385779c7be6f.tar.xz |
Thank you very much Ahzzmandius for adding the support
to purge the avatars inventory "Trash" folder using the
bizarre tortoiseSVN method of diff/patch.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/IClientAPI.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.cs | 22 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 45 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | 2 |
5 files changed, 79 insertions, 0 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index b9ad348..bdddc33 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -384,6 +384,12 @@ namespace OpenSim.Framework | |||
384 | public delegate void MoveInventoryItem( | 384 | public delegate void MoveInventoryItem( |
385 | IClientAPI remoteClient, LLUUID folderID, LLUUID itemID, int length, string newName); | 385 | IClientAPI remoteClient, LLUUID folderID, LLUUID itemID, int length, string newName); |
386 | 386 | ||
387 | public delegate void RemoveInventoryItem( | ||
388 | IClientAPI remoteClient, LLUUID itemID); | ||
389 | |||
390 | public delegate void RemoveInventoryFolder( | ||
391 | IClientAPI remoteClient, LLUUID folderID); | ||
392 | |||
387 | public delegate void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID); | 393 | public delegate void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID); |
388 | 394 | ||
389 | public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID); | 395 | public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID); |
@@ -484,6 +490,8 @@ namespace OpenSim.Framework | |||
484 | event UpdateInventoryItem OnUpdateInventoryItem; | 490 | event UpdateInventoryItem OnUpdateInventoryItem; |
485 | event CopyInventoryItem OnCopyInventoryItem; | 491 | event CopyInventoryItem OnCopyInventoryItem; |
486 | event MoveInventoryItem OnMoveInventoryItem; | 492 | event MoveInventoryItem OnMoveInventoryItem; |
493 | event RemoveInventoryFolder OnRemoveInventoryFolder; | ||
494 | event RemoveInventoryItem OnRemoveInventoryItem; | ||
487 | event UDPAssetUploadRequest OnAssetUploadRequest; | 495 | event UDPAssetUploadRequest OnAssetUploadRequest; |
488 | event XferReceive OnXferReceive; | 496 | event XferReceive OnXferReceive; |
489 | event RequestXfer OnRequestXfer; | 497 | event RequestXfer OnRequestXfer; |
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 4d00c5b..c9a71bd 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs | |||
@@ -570,6 +570,8 @@ namespace OpenSim.Region.ClientStack | |||
570 | public event UpdateInventoryItem OnUpdateInventoryItem; | 570 | public event UpdateInventoryItem OnUpdateInventoryItem; |
571 | public event CopyInventoryItem OnCopyInventoryItem; | 571 | public event CopyInventoryItem OnCopyInventoryItem; |
572 | public event MoveInventoryItem OnMoveInventoryItem; | 572 | public event MoveInventoryItem OnMoveInventoryItem; |
573 | public event RemoveInventoryItem OnRemoveInventoryItem; | ||
574 | public event RemoveInventoryFolder OnRemoveInventoryFolder; | ||
573 | public event UDPAssetUploadRequest OnAssetUploadRequest; | 575 | public event UDPAssetUploadRequest OnAssetUploadRequest; |
574 | public event XferReceive OnXferReceive; | 576 | public event XferReceive OnXferReceive; |
575 | public event RequestXfer OnRequestXfer; | 577 | public event RequestXfer OnRequestXfer; |
@@ -3373,6 +3375,26 @@ namespace OpenSim.Region.ClientStack | |||
3373 | } | 3375 | } |
3374 | } | 3376 | } |
3375 | break; | 3377 | break; |
3378 | case PacketType.RemoveInventoryItem: | ||
3379 | RemoveInventoryItemPacket removeItem = (RemoveInventoryItemPacket)Pack; | ||
3380 | if (OnRemoveInventoryItem != null) | ||
3381 | { | ||
3382 | foreach (RemoveInventoryItemPacket.InventoryDataBlock datablock in removeItem.InventoryData) | ||
3383 | { | ||
3384 | OnRemoveInventoryItem(this, datablock.ItemID); | ||
3385 | } | ||
3386 | } | ||
3387 | break; | ||
3388 | case PacketType.RemoveInventoryFolder: | ||
3389 | RemoveInventoryFolderPacket removeFolder = (RemoveInventoryFolderPacket)Pack; | ||
3390 | if (OnRemoveInventoryFolder != null) | ||
3391 | { | ||
3392 | foreach (RemoveInventoryFolderPacket.FolderDataBlock datablock in removeFolder.FolderData) | ||
3393 | { | ||
3394 | OnRemoveInventoryFolder(this, datablock.FolderID); | ||
3395 | } | ||
3396 | } | ||
3397 | break; | ||
3376 | case PacketType.RequestTaskInventory: | 3398 | case PacketType.RequestTaskInventory: |
3377 | RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack; | 3399 | RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack; |
3378 | if (OnRequestTaskInventory != null) | 3400 | if (OnRequestTaskInventory != null) |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 2212216..13fa009 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -476,6 +476,51 @@ namespace OpenSim.Region.Environment.Scenes | |||
476 | } | 476 | } |
477 | } | 477 | } |
478 | 478 | ||
479 | private void RemoveInventoryItem(IClientAPI remoteClient, LLUUID itemID) | ||
480 | { | ||
481 | CachedUserInfo userInfo | ||
482 | = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); | ||
483 | if (userInfo == null) | ||
484 | { | ||
485 | m_log.Error("[AGENTINVENTORY]: Failed to find user " + remoteClient.AgentId.ToString()); | ||
486 | return; | ||
487 | } | ||
488 | |||
489 | // is going through the root folder really the best way? | ||
490 | // this triggers a tree walk to find and remove the item. 8-( | ||
491 | // since this only happens in Trash (in theory) shouldn't we grab | ||
492 | // the trash folder directly instead of RootFolder? | ||
493 | if (userInfo.RootFolder != null) | ||
494 | { | ||
495 | InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); | ||
496 | if (item != null) | ||
497 | { | ||
498 | userInfo.DeleteItem(remoteClient.AgentId, item); | ||
499 | } | ||
500 | } | ||
501 | } | ||
502 | |||
503 | private void RemoveInventoryFolder(IClientAPI remoteClient, LLUUID folderID) | ||
504 | { | ||
505 | CachedUserInfo userInfo | ||
506 | = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); | ||
507 | if (userInfo == null) | ||
508 | { | ||
509 | m_log.Error("[AGENTINVENTORY]: Failed to find user " + remoteClient.AgentId.ToString()); | ||
510 | return; | ||
511 | } | ||
512 | |||
513 | if (userInfo.RootFolder != null) | ||
514 | { | ||
515 | InventoryItemBase folder = userInfo.RootFolder.HasItem(folderID); | ||
516 | if (folder != null) | ||
517 | { | ||
518 | // doesn't work just yet, commented out. WIll fix in next patch. | ||
519 | // userInfo.DeleteItem(remoteClient.AgentId, folder); | ||
520 | } | ||
521 | } | ||
522 | } | ||
523 | |||
479 | private SceneObjectGroup GetGroupByPrim(uint localID) | 524 | private SceneObjectGroup GetGroupByPrim(uint localID) |
480 | { | 525 | { |
481 | List<EntityBase> EntitieList = GetEntities(); | 526 | List<EntityBase> EntitieList = GetEntities(); |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index d3b051f..7af3f5b 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -1397,6 +1397,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1397 | client.OnUpdateInventoryItem += UpdateInventoryItemAsset; | 1397 | client.OnUpdateInventoryItem += UpdateInventoryItemAsset; |
1398 | client.OnCopyInventoryItem += CopyInventoryItem; | 1398 | client.OnCopyInventoryItem += CopyInventoryItem; |
1399 | client.OnMoveInventoryItem += MoveInventoryItem; | 1399 | client.OnMoveInventoryItem += MoveInventoryItem; |
1400 | client.OnRemoveInventoryItem += RemoveInventoryItem; | ||
1401 | client.OnRemoveInventoryFolder += RemoveInventoryFolder; | ||
1400 | // client.OnAssetUploadRequest += CommsManager.TransactionsManager.HandleUDPUploadRequest; | 1402 | // client.OnAssetUploadRequest += CommsManager.TransactionsManager.HandleUDPUploadRequest; |
1401 | // client.OnXferReceive += CommsManager.TransactionsManager.HandleXfer; | 1403 | // client.OnXferReceive += CommsManager.TransactionsManager.HandleXfer; |
1402 | client.OnRezScript += RezScript; | 1404 | client.OnRezScript += RezScript; |
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index 2599e61..0258c61 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | |||
@@ -112,6 +112,8 @@ namespace SimpleApp | |||
112 | public event CreateInventoryFolder OnCreateNewInventoryFolder; | 112 | public event CreateInventoryFolder OnCreateNewInventoryFolder; |
113 | public event UpdateInventoryFolder OnUpdateInventoryFolder; | 113 | public event UpdateInventoryFolder OnUpdateInventoryFolder; |
114 | public event MoveInventoryFolder OnMoveInventoryFolder; | 114 | public event MoveInventoryFolder OnMoveInventoryFolder; |
115 | public event RemoveInventoryFolder OnRemoveInventoryFolder; | ||
116 | public event RemoveInventoryItem OnRemoveInventoryItem; | ||
115 | public event FetchInventoryDescendents OnFetchInventoryDescendents; | 117 | public event FetchInventoryDescendents OnFetchInventoryDescendents; |
116 | public event PurgeInventoryDescendents OnPurgeInventoryDescendents; | 118 | public event PurgeInventoryDescendents OnPurgeInventoryDescendents; |
117 | public event FetchInventory OnFetchInventory; | 119 | public event FetchInventory OnFetchInventory; |