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/Region | |
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 '')
-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 |
4 files changed, 71 insertions, 0 deletions
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; |