prim inv item creation date is date of adding to prim

This commit is contained in:
UbitUmarov
2024-11-14 22:29:32 +00:00
parent 24cbfb284a
commit 0a0e1ea0b1
2 changed files with 7 additions and 9 deletions

View File

@@ -172,7 +172,7 @@ namespace OpenSim.Framework
public TaskInventoryItem()
{
ScriptRunning = true;
CreationDate = (uint)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
CreationDate = (uint)Util.UnixTimeSinceEpoch();
}
}
}

View File

@@ -135,19 +135,17 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns></returns>
public bool AddInventoryItem(UUID agentID, uint localID, InventoryItemBase item, UUID copyItemID, bool withModRights = true)
{
// m_log.DebugFormat(
// "[PRIM INVENTORY]: Adding inventory item {0} from {1} to part with local ID {2}",
// item.Name, remoteClient.Name, localID);
//m_log.DebugFormat(
// "[PRIM INVENTORY]: Adding inventory item {0} from {1} to part with local ID {2}",
// item.Name, remoteClient.Name, localID);
UUID newItemId = copyItemID.IsZero() ? item.ID : copyItemID;
SceneObjectPart part = GetPart(localID);
if (part is null)
{
m_log.ErrorFormat(
"[PRIM INVENTORY]: " +
"Couldn't find prim local ID {0} in group {1}, {2} to add inventory item ID {3}",
localID, Name, UUID, newItemId);
m_log.Error(
$"[PRIM INVENTORY]: Couldn't find prim local ID {localID} in group {Name}, {UUID} to add inventory item ID {newItemId}");
return false;
}
@@ -156,6 +154,7 @@ namespace OpenSim.Region.Framework.Scenes
ItemID = newItemId,
AssetID = item.AssetID,
Name = item.Name,
//CreationDate = (uint)Util.UnixTimeSinceEpoch(),
Description = item.Description,
OwnerID = part.OwnerID, // Transfer ownership
CreatorID = item.CreatorIdAsUuid,
@@ -193,7 +192,6 @@ namespace OpenSim.Region.Framework.Scenes
// TODO: These are pending addition of those fields to TaskInventoryItem
// taskItem.SalePrice = item.SalePrice;
// taskItem.SaleType = item.SaleType;
taskItem.CreationDate = (uint)item.CreationDate;
bool addFromAllowedDrop;
if(withModRights)