aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs29
1 files changed, 21 insertions, 8 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 704ca5d..5ab7731 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -330,6 +330,13 @@ namespace OpenSim.Region.Environment.Scenes
330 //item.GroupID = itemUpd.GroupID; 330 //item.GroupID = itemUpd.GroupID;
331 //item.GroupOwned = itemUpd.GroupOwned; 331 //item.GroupOwned = itemUpd.GroupOwned;
332 //item.CreationDate = itemUpd.CreationDate; 332 //item.CreationDate = itemUpd.CreationDate;
333 // The client sends zero if its newly created?
334
335 if (itemUpd.CreationDate == 0)
336 item.CreationDate = Util.UnixTimeSinceEpoch();
337 else
338 item.CreationDate = itemUpd.CreationDate;
339
333 340
334 // TODO: Check if folder changed and move item 341 // TODO: Check if folder changed and move item
335 //item.NextPermissions = itemUpd.Folder; 342 //item.NextPermissions = itemUpd.Folder;
@@ -448,6 +455,8 @@ namespace OpenSim.Region.Environment.Scenes
448 itemCopy.SalePrice = item.SalePrice; 455 itemCopy.SalePrice = item.SalePrice;
449 itemCopy.SaleType = item.SaleType; 456 itemCopy.SaleType = item.SaleType;
450 457
458 itemCopy.CreationDate = item.CreationDate;
459
451 recipientUserInfo.AddItem(itemCopy); 460 recipientUserInfo.AddItem(itemCopy);
452 461
453 if (!ExternalChecks.ExternalChecksBypassPermissions()) 462 if (!ExternalChecks.ExternalChecksBypassPermissions())
@@ -532,13 +541,13 @@ namespace OpenSim.Region.Environment.Scenes
532 { 541 {
533 CreateNewInventoryItem( 542 CreateNewInventoryItem(
534 remoteClient, newFolderID, item.Name, item.Flags, callbackID, asset, (sbyte)item.InvType, 543 remoteClient, newFolderID, item.Name, item.Flags, callbackID, asset, (sbyte)item.InvType,
535 item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, item.NextPermissions); 544 item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, item.NextPermissions, Util.UnixTimeSinceEpoch());
536 } 545 }
537 else 546 else
538 { 547 {
539 CreateNewInventoryItem( 548 CreateNewInventoryItem(
540 remoteClient, newFolderID, item.Name, item.Flags, callbackID, asset, (sbyte)item.InvType, 549 remoteClient, newFolderID, item.Name, item.Flags, callbackID, asset, (sbyte)item.InvType,
541 item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions, item.NextPermissions); 550 item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions, item.NextPermissions, Util.UnixTimeSinceEpoch());
542 } 551 }
543 } 552 }
544 else 553 else
@@ -634,15 +643,15 @@ namespace OpenSim.Region.Environment.Scenes
634 /// <param name="invType"></param> 643 /// <param name="invType"></param>
635 /// <param name="nextOwnerMask"></param> 644 /// <param name="nextOwnerMask"></param>
636 private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, string name, uint flags, uint callbackID, 645 private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, string name, uint flags, uint callbackID,
637 AssetBase asset, sbyte invType, uint nextOwnerMask) 646 AssetBase asset, sbyte invType, uint nextOwnerMask, int creationDate)
638 { 647 {
639 CreateNewInventoryItem( 648 CreateNewInventoryItem(
640 remoteClient, folderID, name, flags, callbackID, asset, invType, 649 remoteClient, folderID, name, flags, callbackID, asset, invType,
641 (uint)PermissionMask.All, (uint)PermissionMask.All, 0, nextOwnerMask); 650 (uint)PermissionMask.All, (uint)PermissionMask.All, 0, nextOwnerMask, creationDate);
642 } 651 }
643 652
644 /// <summary> 653 /// <summary>
645 /// Create a new inventory item. 654 /// Create a new Inventory Item
646 /// </summary> 655 /// </summary>
647 /// <param name="remoteClient"></param> 656 /// <param name="remoteClient"></param>
648 /// <param name="folderID"></param> 657 /// <param name="folderID"></param>
@@ -650,9 +659,10 @@ namespace OpenSim.Region.Environment.Scenes
650 /// <param name="asset"></param> 659 /// <param name="asset"></param>
651 /// <param name="invType"></param> 660 /// <param name="invType"></param>
652 /// <param name="nextOwnerMask"></param> 661 /// <param name="nextOwnerMask"></param>
662 /// <param name="creationDate"></param>
653 private void CreateNewInventoryItem( 663 private void CreateNewInventoryItem(
654 IClientAPI remoteClient, LLUUID folderID, string name, uint flags, uint callbackID, AssetBase asset, sbyte invType, 664 IClientAPI remoteClient, LLUUID folderID, string name, uint flags, uint callbackID, AssetBase asset, sbyte invType,
655 uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask) 665 uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, int creationDate)
656 { 666 {
657 CachedUserInfo userInfo 667 CachedUserInfo userInfo
658 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 668 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
@@ -674,6 +684,7 @@ namespace OpenSim.Region.Environment.Scenes
674 item.NextPermissions = nextOwnerMask; 684 item.NextPermissions = nextOwnerMask;
675 item.EveryOnePermissions = everyoneMask; 685 item.EveryOnePermissions = everyoneMask;
676 item.BasePermissions = baseMask; 686 item.BasePermissions = baseMask;
687 item.CreationDate = creationDate;
677 688
678 userInfo.AddItem(item); 689 userInfo.AddItem(item);
679 remoteClient.SendInventoryItemCreateUpdate(item); 690 remoteClient.SendInventoryItemCreateUpdate(item);
@@ -703,7 +714,7 @@ namespace OpenSim.Region.Environment.Scenes
703 public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID, 714 public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID,
704 uint callbackID, string description, string name, sbyte invType, 715 uint callbackID, string description, string name, sbyte invType,
705 sbyte assetType, 716 sbyte assetType,
706 byte wearableType, uint nextOwnerMask) 717 byte wearableType, uint nextOwnerMask, int creationDate)
707 { 718 {
708// m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item {0} in folder {1}", name, folderID); 719// m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item {0} in folder {1}", name, folderID);
709 720
@@ -730,7 +741,7 @@ namespace OpenSim.Region.Environment.Scenes
730 AssetBase asset = CreateAsset(name, description, assetType, data); 741 AssetBase asset = CreateAsset(name, description, assetType, data);
731 AssetCache.AddAsset(asset); 742 AssetCache.AddAsset(asset);
732 743
733 CreateNewInventoryItem(remoteClient, folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask); 744 CreateNewInventoryItem(remoteClient, folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate);
734 } 745 }
735 else 746 else
736 { 747 {
@@ -1664,6 +1675,7 @@ namespace OpenSim.Region.Environment.Scenes
1664 } 1675 }
1665 1676
1666 // TODO: add the new fields (Flags, Sale info, etc) 1677 // TODO: add the new fields (Flags, Sale info, etc)
1678 item.CreationDate = Util.UnixTimeSinceEpoch();
1667 1679
1668 userInfo.AddItem(item); 1680 userInfo.AddItem(item);
1669 if (item.Owner == remoteClient.AgentId) 1681 if (item.Owner == remoteClient.AgentId)
@@ -1817,6 +1829,7 @@ namespace OpenSim.Region.Environment.Scenes
1817 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1829 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
1818 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; 1830 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
1819 } 1831 }
1832 item.CreationDate = Util.UnixTimeSinceEpoch();
1820 1833
1821 userInfo.AddItem(item); 1834 userInfo.AddItem(item);
1822 remoteClient.SendInventoryItemCreateUpdate(item); 1835 remoteClient.SendInventoryItemCreateUpdate(item);