Mantis#1638. Thank you kindly, Salahzar for a patch that:

Addresses an unused field in the asset server but never get filled up. 
It also makes working the recent items tab in inventory :))))
0.6.0-stable
Charles Krinke 2008-07-13 18:57:13 +00:00
parent 92cac0c6de
commit d0fb5e8c90
3 changed files with 25 additions and 10 deletions

View File

@ -198,7 +198,7 @@ namespace OpenSim.Framework
public delegate void CreateNewInventoryItem(
IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID, uint callbackID, string description, string name,
sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask);
sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask, int creationDate);
public delegate void FetchInventoryDescendents(
IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder);

View File

@ -1762,6 +1762,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
InventoryReply.InventoryData[0].Flags = Item.Flags;
InventoryReply.InventoryData[0].SalePrice = Item.SalePrice;
InventoryReply.InventoryData[0].SaleType = Item.SaleType;
InventoryReply.InventoryData[0].CreationDate = Item.CreationDate;
InventoryReply.InventoryData[0].CRC =
Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType,
@ -5288,7 +5289,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
createItem.InventoryBlock.InvType,
createItem.InventoryBlock.Type,
createItem.InventoryBlock.WearableType,
createItem.InventoryBlock.NextOwnerMask);
createItem.InventoryBlock.NextOwnerMask,
Util.UnixTimeSinceEpoch());
}
break;
case PacketType.FetchInventory:

View File

@ -330,6 +330,13 @@ namespace OpenSim.Region.Environment.Scenes
//item.GroupID = itemUpd.GroupID;
//item.GroupOwned = itemUpd.GroupOwned;
//item.CreationDate = itemUpd.CreationDate;
// The client sends zero if its newly created?
if (itemUpd.CreationDate == 0)
item.CreationDate = Util.UnixTimeSinceEpoch();
else
item.CreationDate = itemUpd.CreationDate;
// TODO: Check if folder changed and move item
//item.NextPermissions = itemUpd.Folder;
@ -448,6 +455,8 @@ namespace OpenSim.Region.Environment.Scenes
itemCopy.SalePrice = item.SalePrice;
itemCopy.SaleType = item.SaleType;
itemCopy.CreationDate = item.CreationDate;
recipientUserInfo.AddItem(itemCopy);
if (!ExternalChecks.ExternalChecksBypassPermissions())
@ -532,13 +541,13 @@ namespace OpenSim.Region.Environment.Scenes
{
CreateNewInventoryItem(
remoteClient, newFolderID, item.Name, item.Flags, callbackID, asset, (sbyte)item.InvType,
item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, item.NextPermissions);
item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, item.NextPermissions, Util.UnixTimeSinceEpoch());
}
else
{
CreateNewInventoryItem(
remoteClient, newFolderID, item.Name, item.Flags, callbackID, asset, (sbyte)item.InvType,
item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions, item.NextPermissions);
item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions, item.NextPermissions, Util.UnixTimeSinceEpoch());
}
}
else
@ -634,15 +643,15 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="invType"></param>
/// <param name="nextOwnerMask"></param>
private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, string name, uint flags, uint callbackID,
AssetBase asset, sbyte invType, uint nextOwnerMask)
AssetBase asset, sbyte invType, uint nextOwnerMask, int creationDate)
{
CreateNewInventoryItem(
remoteClient, folderID, name, flags, callbackID, asset, invType,
(uint)PermissionMask.All, (uint)PermissionMask.All, 0, nextOwnerMask);
(uint)PermissionMask.All, (uint)PermissionMask.All, 0, nextOwnerMask, creationDate);
}
/// <summary>
/// Create a new inventory item.
/// Create a new Inventory Item
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="folderID"></param>
@ -650,9 +659,10 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="asset"></param>
/// <param name="invType"></param>
/// <param name="nextOwnerMask"></param>
/// <param name="creationDate"></param>
private void CreateNewInventoryItem(
IClientAPI remoteClient, LLUUID folderID, string name, uint flags, uint callbackID, AssetBase asset, sbyte invType,
uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask)
uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, int creationDate)
{
CachedUserInfo userInfo
= CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
@ -674,6 +684,7 @@ namespace OpenSim.Region.Environment.Scenes
item.NextPermissions = nextOwnerMask;
item.EveryOnePermissions = everyoneMask;
item.BasePermissions = baseMask;
item.CreationDate = creationDate;
userInfo.AddItem(item);
remoteClient.SendInventoryItemCreateUpdate(item);
@ -703,7 +714,7 @@ namespace OpenSim.Region.Environment.Scenes
public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID,
uint callbackID, string description, string name, sbyte invType,
sbyte assetType,
byte wearableType, uint nextOwnerMask)
byte wearableType, uint nextOwnerMask, int creationDate)
{
// m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item {0} in folder {1}", name, folderID);
@ -730,7 +741,7 @@ namespace OpenSim.Region.Environment.Scenes
AssetBase asset = CreateAsset(name, description, assetType, data);
AssetCache.AddAsset(asset);
CreateNewInventoryItem(remoteClient, folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask);
CreateNewInventoryItem(remoteClient, folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate);
}
else
{
@ -1664,6 +1675,7 @@ namespace OpenSim.Region.Environment.Scenes
}
// TODO: add the new fields (Flags, Sale info, etc)
item.CreationDate = Util.UnixTimeSinceEpoch();
userInfo.AddItem(item);
if (item.Owner == remoteClient.AgentId)
@ -1817,6 +1829,7 @@ namespace OpenSim.Region.Environment.Scenes
item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
}
item.CreationDate = Util.UnixTimeSinceEpoch();
userInfo.AddItem(item);
remoteClient.SendInventoryItemCreateUpdate(item);