Thank you very much Ahzzmandius for adding the support

to purge the avatars inventory "Trash" folder using the
bizarre tortoiseSVN method of diff/patch.
ThreadPoolClientBranch
Charles Krinke 2008-02-18 03:25:14 +00:00
parent 3df36523cb
commit 2c81e18fc3
5 changed files with 79 additions and 0 deletions

View File

@ -384,6 +384,12 @@ namespace OpenSim.Framework
public delegate void MoveInventoryItem( public delegate void MoveInventoryItem(
IClientAPI remoteClient, LLUUID folderID, LLUUID itemID, int length, string newName); IClientAPI remoteClient, LLUUID folderID, LLUUID itemID, int length, string newName);
public delegate void RemoveInventoryItem(
IClientAPI remoteClient, LLUUID itemID);
public delegate void RemoveInventoryFolder(
IClientAPI remoteClient, LLUUID folderID);
public delegate void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID); public delegate void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID);
public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID); public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID);
@ -484,6 +490,8 @@ namespace OpenSim.Framework
event UpdateInventoryItem OnUpdateInventoryItem; event UpdateInventoryItem OnUpdateInventoryItem;
event CopyInventoryItem OnCopyInventoryItem; event CopyInventoryItem OnCopyInventoryItem;
event MoveInventoryItem OnMoveInventoryItem; event MoveInventoryItem OnMoveInventoryItem;
event RemoveInventoryFolder OnRemoveInventoryFolder;
event RemoveInventoryItem OnRemoveInventoryItem;
event UDPAssetUploadRequest OnAssetUploadRequest; event UDPAssetUploadRequest OnAssetUploadRequest;
event XferReceive OnXferReceive; event XferReceive OnXferReceive;
event RequestXfer OnRequestXfer; event RequestXfer OnRequestXfer;

View File

@ -570,6 +570,8 @@ namespace OpenSim.Region.ClientStack
public event UpdateInventoryItem OnUpdateInventoryItem; public event UpdateInventoryItem OnUpdateInventoryItem;
public event CopyInventoryItem OnCopyInventoryItem; public event CopyInventoryItem OnCopyInventoryItem;
public event MoveInventoryItem OnMoveInventoryItem; public event MoveInventoryItem OnMoveInventoryItem;
public event RemoveInventoryItem OnRemoveInventoryItem;
public event RemoveInventoryFolder OnRemoveInventoryFolder;
public event UDPAssetUploadRequest OnAssetUploadRequest; public event UDPAssetUploadRequest OnAssetUploadRequest;
public event XferReceive OnXferReceive; public event XferReceive OnXferReceive;
public event RequestXfer OnRequestXfer; public event RequestXfer OnRequestXfer;
@ -3373,6 +3375,26 @@ namespace OpenSim.Region.ClientStack
} }
} }
break; break;
case PacketType.RemoveInventoryItem:
RemoveInventoryItemPacket removeItem = (RemoveInventoryItemPacket)Pack;
if (OnRemoveInventoryItem != null)
{
foreach (RemoveInventoryItemPacket.InventoryDataBlock datablock in removeItem.InventoryData)
{
OnRemoveInventoryItem(this, datablock.ItemID);
}
}
break;
case PacketType.RemoveInventoryFolder:
RemoveInventoryFolderPacket removeFolder = (RemoveInventoryFolderPacket)Pack;
if (OnRemoveInventoryFolder != null)
{
foreach (RemoveInventoryFolderPacket.FolderDataBlock datablock in removeFolder.FolderData)
{
OnRemoveInventoryFolder(this, datablock.FolderID);
}
}
break;
case PacketType.RequestTaskInventory: case PacketType.RequestTaskInventory:
RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack; RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack;
if (OnRequestTaskInventory != null) if (OnRequestTaskInventory != null)

View File

@ -476,6 +476,51 @@ namespace OpenSim.Region.Environment.Scenes
} }
} }
private void RemoveInventoryItem(IClientAPI remoteClient, LLUUID itemID)
{
CachedUserInfo userInfo
= CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
if (userInfo == null)
{
m_log.Error("[AGENTINVENTORY]: Failed to find user " + remoteClient.AgentId.ToString());
return;
}
// is going through the root folder really the best way?
// this triggers a tree walk to find and remove the item. 8-(
// since this only happens in Trash (in theory) shouldn't we grab
// the trash folder directly instead of RootFolder?
if (userInfo.RootFolder != null)
{
InventoryItemBase item = userInfo.RootFolder.HasItem(itemID);
if (item != null)
{
userInfo.DeleteItem(remoteClient.AgentId, item);
}
}
}
private void RemoveInventoryFolder(IClientAPI remoteClient, LLUUID folderID)
{
CachedUserInfo userInfo
= CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
if (userInfo == null)
{
m_log.Error("[AGENTINVENTORY]: Failed to find user " + remoteClient.AgentId.ToString());
return;
}
if (userInfo.RootFolder != null)
{
InventoryItemBase folder = userInfo.RootFolder.HasItem(folderID);
if (folder != null)
{
// doesn't work just yet, commented out. WIll fix in next patch.
// userInfo.DeleteItem(remoteClient.AgentId, folder);
}
}
}
private SceneObjectGroup GetGroupByPrim(uint localID) private SceneObjectGroup GetGroupByPrim(uint localID)
{ {
List<EntityBase> EntitieList = GetEntities(); List<EntityBase> EntitieList = GetEntities();

View File

@ -1397,6 +1397,8 @@ namespace OpenSim.Region.Environment.Scenes
client.OnUpdateInventoryItem += UpdateInventoryItemAsset; client.OnUpdateInventoryItem += UpdateInventoryItemAsset;
client.OnCopyInventoryItem += CopyInventoryItem; client.OnCopyInventoryItem += CopyInventoryItem;
client.OnMoveInventoryItem += MoveInventoryItem; client.OnMoveInventoryItem += MoveInventoryItem;
client.OnRemoveInventoryItem += RemoveInventoryItem;
client.OnRemoveInventoryFolder += RemoveInventoryFolder;
// client.OnAssetUploadRequest += CommsManager.TransactionsManager.HandleUDPUploadRequest; // client.OnAssetUploadRequest += CommsManager.TransactionsManager.HandleUDPUploadRequest;
// client.OnXferReceive += CommsManager.TransactionsManager.HandleXfer; // client.OnXferReceive += CommsManager.TransactionsManager.HandleXfer;
client.OnRezScript += RezScript; client.OnRezScript += RezScript;

View File

@ -112,6 +112,8 @@ namespace SimpleApp
public event CreateInventoryFolder OnCreateNewInventoryFolder; public event CreateInventoryFolder OnCreateNewInventoryFolder;
public event UpdateInventoryFolder OnUpdateInventoryFolder; public event UpdateInventoryFolder OnUpdateInventoryFolder;
public event MoveInventoryFolder OnMoveInventoryFolder; public event MoveInventoryFolder OnMoveInventoryFolder;
public event RemoveInventoryFolder OnRemoveInventoryFolder;
public event RemoveInventoryItem OnRemoveInventoryItem;
public event FetchInventoryDescendents OnFetchInventoryDescendents; public event FetchInventoryDescendents OnFetchInventoryDescendents;
public event PurgeInventoryDescendents OnPurgeInventoryDescendents; public event PurgeInventoryDescendents OnPurgeInventoryDescendents;
public event FetchInventory OnFetchInventory; public event FetchInventory OnFetchInventory;