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 a2275f8..33166df 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); |
@@ -3673,59 +3673,53 @@ namespace OpenSim.Region.Framework.Scenes | |||
3673 | case 2: // Sell a copy | 3673 | case 2: // Sell a copy |
3674 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group); | 3674 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group); |
3675 | 3675 | ||
3676 | CachedUserInfo userInfo = | 3676 | uint perms=group.GetEffectivePermissions(); |
3677 | CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); | ||
3678 | 3677 | ||
3679 | if (userInfo != null) | 3678 | if ((perms & (uint)PermissionMask.Transfer) == 0) |
3680 | { | 3679 | { |
3681 | uint perms=group.GetEffectivePermissions(); | 3680 | m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale"); |
3682 | 3681 | return false; | |
3683 | if ((perms & (uint)PermissionMask.Transfer) == 0) | 3682 | } |
3684 | { | ||
3685 | m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale"); | ||
3686 | return false; | ||
3687 | } | ||
3688 | 3683 | ||
3689 | AssetBase asset = CreateAsset( | 3684 | AssetBase asset = CreateAsset( |
3690 | group.GetPartName(localID), | 3685 | group.GetPartName(localID), |
3691 | group.GetPartDescription(localID), | 3686 | group.GetPartDescription(localID), |
3692 | (sbyte)AssetType.Object, | 3687 | (sbyte)AssetType.Object, |
3693 | Utils.StringToBytes(sceneObjectXml)); | 3688 | Utils.StringToBytes(sceneObjectXml)); |
3694 | AssetService.Store(asset); | 3689 | AssetService.Store(asset); |
3695 | 3690 | ||
3696 | InventoryItemBase item = new InventoryItemBase(); | 3691 | InventoryItemBase item = new InventoryItemBase(); |
3697 | item.CreatorId = part.CreatorID.ToString(); | 3692 | item.CreatorId = part.CreatorID.ToString(); |
3698 | 3693 | ||
3699 | item.ID = UUID.Random(); | 3694 | item.ID = UUID.Random(); |
3700 | item.Owner = remoteClient.AgentId; | 3695 | item.Owner = remoteClient.AgentId; |
3701 | item.AssetID = asset.FullID; | 3696 | item.AssetID = asset.FullID; |
3702 | item.Description = asset.Description; | 3697 | item.Description = asset.Description; |
3703 | item.Name = asset.Name; | 3698 | item.Name = asset.Name; |
3704 | item.AssetType = asset.Type; | 3699 | item.AssetType = asset.Type; |
3705 | item.InvType = (int)InventoryType.Object; | 3700 | item.InvType = (int)InventoryType.Object; |
3706 | item.Folder = categoryID; | 3701 | item.Folder = categoryID; |
3707 | 3702 | ||
3708 | uint nextPerms=(perms & 7) << 13; | 3703 | uint nextPerms=(perms & 7) << 13; |
3709 | if ((nextPerms & (uint)PermissionMask.Copy) == 0) | 3704 | if ((nextPerms & (uint)PermissionMask.Copy) == 0) |
3710 | perms &= ~(uint)PermissionMask.Copy; | 3705 | perms &= ~(uint)PermissionMask.Copy; |
3711 | if ((nextPerms & (uint)PermissionMask.Transfer) == 0) | 3706 | if ((nextPerms & (uint)PermissionMask.Transfer) == 0) |
3712 | perms &= ~(uint)PermissionMask.Transfer; | 3707 | perms &= ~(uint)PermissionMask.Transfer; |
3713 | if ((nextPerms & (uint)PermissionMask.Modify) == 0) | 3708 | if ((nextPerms & (uint)PermissionMask.Modify) == 0) |
3714 | perms &= ~(uint)PermissionMask.Modify; | 3709 | perms &= ~(uint)PermissionMask.Modify; |
3715 | 3710 | ||
3716 | item.BasePermissions = perms & part.NextOwnerMask; | 3711 | item.BasePermissions = perms & part.NextOwnerMask; |
3717 | item.CurrentPermissions = perms & part.NextOwnerMask; | 3712 | item.CurrentPermissions = perms & part.NextOwnerMask; |
3718 | item.NextPermissions = part.NextOwnerMask; | 3713 | item.NextPermissions = part.NextOwnerMask; |
3719 | item.EveryOnePermissions = part.EveryoneMask & | 3714 | item.EveryOnePermissions = part.EveryoneMask & |
3720 | part.NextOwnerMask; | 3715 | part.NextOwnerMask; |
3721 | item.GroupPermissions = part.GroupMask & | 3716 | item.GroupPermissions = part.GroupMask & |
3722 | part.NextOwnerMask; | 3717 | part.NextOwnerMask; |
3723 | item.CurrentPermissions |= 8; // Slam! | 3718 | item.CurrentPermissions |= 8; // Slam! |
3724 | item.CreationDate = Util.UnixTimeSinceEpoch(); | 3719 | item.CreationDate = Util.UnixTimeSinceEpoch(); |
3725 | 3720 | ||
3726 | userInfo.AddItem(item); | 3721 | if (InventoryService.AddItem(item)) |
3727 | remoteClient.SendInventoryItemCreateUpdate(item, 0); | 3722 | remoteClient.SendInventoryItemCreateUpdate(item, 0); |
3728 | } | ||
3729 | else | 3723 | else |
3730 | { | 3724 | { |
3731 | m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable"); | 3725 | m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable"); |
@@ -3740,8 +3734,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3740 | 3734 | ||
3741 | foreach (UUID invID in invList) | 3735 | foreach (UUID invID in invList) |
3742 | { | 3736 | { |
3743 | TaskInventoryItem item = part.Inventory.GetInventoryItem(invID); | 3737 | TaskInventoryItem item1 = part.Inventory.GetInventoryItem(invID); |
3744 | if ((item.CurrentPermissions & | 3738 | if ((item1.CurrentPermissions & |
3745 | (uint)PermissionMask.Transfer) == 0) | 3739 | (uint)PermissionMask.Transfer) == 0) |
3746 | { | 3740 | { |
3747 | okToSell = false; | 3741 | okToSell = false; |