mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
Allow moving, deleting, and restoring objects in inventory.
Note: only tested in grid mode, and emptying trash is still not implemented.
This commit is contained in:
@@ -236,6 +236,46 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
return asset;
|
||||
}
|
||||
|
||||
public void MoveInventoryItem(IClientAPI remoteClient,LLUUID folderID, LLUUID itemID, int length, string newName)
|
||||
{
|
||||
MainLog.Instance.Verbose("INVENTORY", "Moving item for " + remoteClient.AgentId.ToStringHyphenated());
|
||||
CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
|
||||
if (userInfo == null)
|
||||
{
|
||||
MainLog.Instance.Warn("INVENTORY", "Failed to find user " + remoteClient.AgentId.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
if (userInfo.RootFolder != null)
|
||||
{
|
||||
InventoryItemBase item = userInfo.RootFolder.HasItem(itemID);
|
||||
if (item != null)
|
||||
{
|
||||
if (newName != "")
|
||||
{
|
||||
item.inventoryName = newName;
|
||||
}
|
||||
item.parentFolderID = folderID;
|
||||
userInfo.DeleteItem(remoteClient.AgentId, item);
|
||||
|
||||
// TODO: preserve current permissions?
|
||||
AddInventoryItem(remoteClient, item);
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Warn("INVENTORY", "Failed to find item " + itemID.ToString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Warn("INVENTORY", "Failed to find item " + itemID.ToString() + ", no root folder");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID,
|
||||
AssetBase asset, uint nextOwnerMask)
|
||||
{
|
||||
|
||||
@@ -976,6 +976,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
client.OnFetchInventory += CommsManager.UserProfileCacheService.HandleFetchInventory;
|
||||
client.OnUpdateInventoryItem += UpdateInventoryItemAsset;
|
||||
client.OnCopyInventoryItem += CopyInventoryItem;
|
||||
client.OnMoveInventoryItem += MoveInventoryItem;
|
||||
client.OnAssetUploadRequest += CommsManager.TransactionsManager.HandleUDPUploadRequest;
|
||||
client.OnXferReceive += CommsManager.TransactionsManager.HandleXfer;
|
||||
client.OnRezScript += RezScript;
|
||||
|
||||
Reference in New Issue
Block a user