diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 98 |
1 files changed, 46 insertions, 52 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 18d7bad..b9edd6e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1962,7 +1962,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1962 | m_log.DebugFormat("[ATTACHMENT]: Received " + | 1962 | m_log.DebugFormat("[ATTACHMENT]: Received " + |
1963 | "attachment {0}, inworld asset id {1}", | 1963 | "attachment {0}, inworld asset id {1}", |
1964 | //grp.RootPart.LastOwnerID.ToString(), | 1964 | //grp.RootPart.LastOwnerID.ToString(), |
1965 | grp.GetFromAssetID(), | 1965 | grp.GetFromItemID(), |
1966 | grp.UUID.ToString()); | 1966 | grp.UUID.ToString()); |
1967 | 1967 | ||
1968 | //grp.SetFromAssetID(grp.RootPart.LastOwnerID); | 1968 | //grp.SetFromAssetID(grp.RootPart.LastOwnerID); |
@@ -3672,59 +3672,53 @@ namespace OpenSim.Region.Framework.Scenes | |||
3672 | case 2: // Sell a copy | 3672 | case 2: // Sell a copy |
3673 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group); | 3673 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group); |
3674 | 3674 | ||
3675 | CachedUserInfo userInfo = | 3675 | uint perms=group.GetEffectivePermissions(); |
3676 | CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); | ||
3677 | 3676 | ||
3678 | if (userInfo != null) | 3677 | if ((perms & (uint)PermissionMask.Transfer) == 0) |
3679 | { | 3678 | { |
3680 | uint perms=group.GetEffectivePermissions(); | 3679 | m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale"); |
3681 | 3680 | return false; | |
3682 | if ((perms & (uint)PermissionMask.Transfer) == 0) | 3681 | } |
3683 | { | ||
3684 | m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale"); | ||
3685 | return false; | ||
3686 | } | ||
3687 | 3682 | ||
3688 | AssetBase asset = CreateAsset( | 3683 | AssetBase asset = CreateAsset( |
3689 | group.GetPartName(localID), | 3684 | group.GetPartName(localID), |
3690 | group.GetPartDescription(localID), | 3685 | group.GetPartDescription(localID), |
3691 | (sbyte)AssetType.Object, | 3686 | (sbyte)AssetType.Object, |
3692 | Utils.StringToBytes(sceneObjectXml)); | 3687 | Utils.StringToBytes(sceneObjectXml)); |
3693 | AssetService.Store(asset); | 3688 | AssetService.Store(asset); |
3694 | 3689 | ||
3695 | InventoryItemBase item = new InventoryItemBase(); | 3690 | InventoryItemBase item = new InventoryItemBase(); |
3696 | item.CreatorId = part.CreatorID.ToString(); | 3691 | item.CreatorId = part.CreatorID.ToString(); |
3697 | 3692 | ||
3698 | item.ID = UUID.Random(); | 3693 | item.ID = UUID.Random(); |
3699 | item.Owner = remoteClient.AgentId; | 3694 | item.Owner = remoteClient.AgentId; |
3700 | item.AssetID = asset.FullID; | 3695 | item.AssetID = asset.FullID; |
3701 | item.Description = asset.Description; | 3696 | item.Description = asset.Description; |
3702 | item.Name = asset.Name; | 3697 | item.Name = asset.Name; |
3703 | item.AssetType = asset.Type; | 3698 | item.AssetType = asset.Type; |
3704 | item.InvType = (int)InventoryType.Object; | 3699 | item.InvType = (int)InventoryType.Object; |
3705 | item.Folder = categoryID; | 3700 | item.Folder = categoryID; |
3706 | 3701 | ||
3707 | uint nextPerms=(perms & 7) << 13; | 3702 | uint nextPerms=(perms & 7) << 13; |
3708 | if ((nextPerms & (uint)PermissionMask.Copy) == 0) | 3703 | if ((nextPerms & (uint)PermissionMask.Copy) == 0) |
3709 | perms &= ~(uint)PermissionMask.Copy; | 3704 | perms &= ~(uint)PermissionMask.Copy; |
3710 | if ((nextPerms & (uint)PermissionMask.Transfer) == 0) | 3705 | if ((nextPerms & (uint)PermissionMask.Transfer) == 0) |
3711 | perms &= ~(uint)PermissionMask.Transfer; | 3706 | perms &= ~(uint)PermissionMask.Transfer; |
3712 | if ((nextPerms & (uint)PermissionMask.Modify) == 0) | 3707 | if ((nextPerms & (uint)PermissionMask.Modify) == 0) |
3713 | perms &= ~(uint)PermissionMask.Modify; | 3708 | perms &= ~(uint)PermissionMask.Modify; |
3714 | 3709 | ||
3715 | item.BasePermissions = perms & part.NextOwnerMask; | 3710 | item.BasePermissions = perms & part.NextOwnerMask; |
3716 | item.CurrentPermissions = perms & part.NextOwnerMask; | 3711 | item.CurrentPermissions = perms & part.NextOwnerMask; |
3717 | item.NextPermissions = part.NextOwnerMask; | 3712 | item.NextPermissions = part.NextOwnerMask; |
3718 | item.EveryOnePermissions = part.EveryoneMask & | 3713 | item.EveryOnePermissions = part.EveryoneMask & |
3719 | part.NextOwnerMask; | 3714 | part.NextOwnerMask; |
3720 | item.GroupPermissions = part.GroupMask & | 3715 | item.GroupPermissions = part.GroupMask & |
3721 | part.NextOwnerMask; | 3716 | part.NextOwnerMask; |
3722 | item.CurrentPermissions |= 8; // Slam! | 3717 | item.CurrentPermissions |= 8; // Slam! |
3723 | item.CreationDate = Util.UnixTimeSinceEpoch(); | 3718 | item.CreationDate = Util.UnixTimeSinceEpoch(); |
3724 | 3719 | ||
3725 | userInfo.AddItem(item); | 3720 | if (InventoryService.AddItem(item)) |
3726 | remoteClient.SendInventoryItemCreateUpdate(item, 0); | 3721 | remoteClient.SendInventoryItemCreateUpdate(item, 0); |
3727 | } | ||
3728 | else | 3722 | else |
3729 | { | 3723 | { |
3730 | m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable"); | 3724 | m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable"); |
@@ -3739,8 +3733,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3739 | 3733 | ||
3740 | foreach (UUID invID in invList) | 3734 | foreach (UUID invID in invList) |
3741 | { | 3735 | { |
3742 | TaskInventoryItem item = part.Inventory.GetInventoryItem(invID); | 3736 | TaskInventoryItem item1 = part.Inventory.GetInventoryItem(invID); |
3743 | if ((item.CurrentPermissions & | 3737 | if ((item1.CurrentPermissions & |
3744 | (uint)PermissionMask.Transfer) == 0) | 3738 | (uint)PermissionMask.Transfer) == 0) |
3745 | { | 3739 | { |
3746 | okToSell = false; | 3740 | okToSell = false; |