hackish code to allow emptying of trash. This really should be done on the inventory server, and not from the region.
Also: it appeared to work the first try, so I have probably done something horribly wrong.afrisby
parent
beca2373e1
commit
383eccc543
|
@ -136,7 +136,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||||
/// <param name="fetchFolders"></param>
|
/// <param name="fetchFolders"></param>
|
||||||
/// <param name="fetchItems"></param>
|
/// <param name="fetchItems"></param>
|
||||||
/// <param name="sortOrder"></param>
|
/// <param name="sortOrder"></param>
|
||||||
public void HandleFecthInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID,
|
public void HandleFetchInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID,
|
||||||
bool fetchFolders, bool fetchItems, int sortOrder)
|
bool fetchFolders, bool fetchItems, int sortOrder)
|
||||||
{
|
{
|
||||||
InventoryFolderImpl fold = null;
|
InventoryFolderImpl fold = null;
|
||||||
|
@ -181,6 +181,26 @@ namespace OpenSim.Framework.Communications.Cache
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, LLUUID folderID)
|
||||||
|
{
|
||||||
|
CachedUserInfo userProfile;
|
||||||
|
if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile))
|
||||||
|
{
|
||||||
|
if (userProfile.RootFolder != null)
|
||||||
|
{
|
||||||
|
InventoryFolderImpl subFolder = userProfile.RootFolder.HasSubFolder(folderID);
|
||||||
|
if (subFolder != null)
|
||||||
|
{
|
||||||
|
List<InventoryItemBase> items=subFolder.RequestListOfItems();
|
||||||
|
foreach(InventoryItemBase item in items)
|
||||||
|
{
|
||||||
|
userProfile.DeleteItem(remoteClient.AgentId, item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID)
|
public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID)
|
||||||
{
|
{
|
||||||
if (ownerID == libraryRoot.agentID)
|
if (ownerID == libraryRoot.agentID)
|
||||||
|
|
|
@ -306,6 +306,9 @@ namespace OpenSim.Framework
|
||||||
public delegate void FetchInventoryDescendents(
|
public delegate void FetchInventoryDescendents(
|
||||||
IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder);
|
IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder);
|
||||||
|
|
||||||
|
public delegate void PurgeInventoryDescendents(
|
||||||
|
IClientAPI remoteClient, LLUUID folderID);
|
||||||
|
|
||||||
public delegate void FetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID);
|
public delegate void FetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID);
|
||||||
|
|
||||||
public delegate void RequestTaskInventory(IClientAPI remoteClient, uint localID);
|
public delegate void RequestTaskInventory(IClientAPI remoteClient, uint localID);
|
||||||
|
@ -398,6 +401,7 @@ namespace OpenSim.Framework
|
||||||
event CreateNewInventoryItem OnCreateNewInventoryItem;
|
event CreateNewInventoryItem OnCreateNewInventoryItem;
|
||||||
event CreateInventoryFolder OnCreateNewInventoryFolder;
|
event CreateInventoryFolder OnCreateNewInventoryFolder;
|
||||||
event FetchInventoryDescendents OnFetchInventoryDescendents;
|
event FetchInventoryDescendents OnFetchInventoryDescendents;
|
||||||
|
event PurgeInventoryDescendents OnPurgeInventoryDescendents;
|
||||||
event FetchInventory OnFetchInventory;
|
event FetchInventory OnFetchInventory;
|
||||||
event RequestTaskInventory OnRequestTaskInventory;
|
event RequestTaskInventory OnRequestTaskInventory;
|
||||||
event UpdateInventoryItem OnUpdateInventoryItem;
|
event UpdateInventoryItem OnUpdateInventoryItem;
|
||||||
|
|
|
@ -430,6 +430,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
public event CreateNewInventoryItem OnCreateNewInventoryItem;
|
public event CreateNewInventoryItem OnCreateNewInventoryItem;
|
||||||
public event CreateInventoryFolder OnCreateNewInventoryFolder;
|
public event CreateInventoryFolder OnCreateNewInventoryFolder;
|
||||||
public event FetchInventoryDescendents OnFetchInventoryDescendents;
|
public event FetchInventoryDescendents OnFetchInventoryDescendents;
|
||||||
|
public event PurgeInventoryDescendents OnPurgeInventoryDescendents;
|
||||||
public event FetchInventory OnFetchInventory;
|
public event FetchInventory OnFetchInventory;
|
||||||
public event RequestTaskInventory OnRequestTaskInventory;
|
public event RequestTaskInventory OnRequestTaskInventory;
|
||||||
public event UpdateInventoryItem OnUpdateInventoryItem;
|
public event UpdateInventoryItem OnUpdateInventoryItem;
|
||||||
|
@ -2827,6 +2828,13 @@ namespace OpenSim.Region.ClientStack
|
||||||
Fetch.InventoryData.SortOrder);
|
Fetch.InventoryData.SortOrder);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case PacketType.PurgeInventoryDescendents:
|
||||||
|
if (OnPurgeInventoryDescendents != null)
|
||||||
|
{
|
||||||
|
PurgeInventoryDescendentsPacket Purge = (PurgeInventoryDescendentsPacket)Pack;
|
||||||
|
OnPurgeInventoryDescendents(this, Purge.InventoryData.FolderID);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case PacketType.UpdateInventoryItem:
|
case PacketType.UpdateInventoryItem:
|
||||||
UpdateInventoryItemPacket update = (UpdateInventoryItemPacket) Pack;
|
UpdateInventoryItemPacket update = (UpdateInventoryItemPacket) Pack;
|
||||||
if (OnUpdateInventoryItem != null)
|
if (OnUpdateInventoryItem != null)
|
||||||
|
|
|
@ -971,7 +971,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
client.OnCreateNewInventoryItem += CreateNewInventoryItem;
|
client.OnCreateNewInventoryItem += CreateNewInventoryItem;
|
||||||
client.OnCreateNewInventoryFolder += CommsManager.UserProfileCacheService.HandleCreateInventoryFolder;
|
client.OnCreateNewInventoryFolder += CommsManager.UserProfileCacheService.HandleCreateInventoryFolder;
|
||||||
client.OnFetchInventoryDescendents += CommsManager.UserProfileCacheService.HandleFecthInventoryDescendents;
|
client.OnFetchInventoryDescendents += CommsManager.UserProfileCacheService.HandleFetchInventoryDescendents;
|
||||||
|
client.OnPurgeInventoryDescendents += CommsManager.UserProfileCacheService.HandlePurgeInventoryDescendents;
|
||||||
client.OnRequestTaskInventory += RequestTaskInventory;
|
client.OnRequestTaskInventory += RequestTaskInventory;
|
||||||
client.OnFetchInventory += CommsManager.UserProfileCacheService.HandleFetchInventory;
|
client.OnFetchInventory += CommsManager.UserProfileCacheService.HandleFetchInventory;
|
||||||
client.OnUpdateInventoryItem += UpdateInventoryItemAsset;
|
client.OnUpdateInventoryItem += UpdateInventoryItemAsset;
|
||||||
|
|
|
@ -107,6 +107,7 @@ namespace SimpleApp
|
||||||
public event CreateNewInventoryItem OnCreateNewInventoryItem;
|
public event CreateNewInventoryItem OnCreateNewInventoryItem;
|
||||||
public event CreateInventoryFolder OnCreateNewInventoryFolder;
|
public event CreateInventoryFolder OnCreateNewInventoryFolder;
|
||||||
public event FetchInventoryDescendents OnFetchInventoryDescendents;
|
public event FetchInventoryDescendents OnFetchInventoryDescendents;
|
||||||
|
public event PurgeInventoryDescendents OnPurgeInventoryDescendents;
|
||||||
public event FetchInventory OnFetchInventory;
|
public event FetchInventory OnFetchInventory;
|
||||||
public event RequestTaskInventory OnRequestTaskInventory;
|
public event RequestTaskInventory OnRequestTaskInventory;
|
||||||
public event UpdateInventoryItem OnUpdateInventoryItem;
|
public event UpdateInventoryItem OnUpdateInventoryItem;
|
||||||
|
|
Loading…
Reference in New Issue