diff options
author | Diva Canto | 2009-08-12 20:39:48 -0700 |
---|---|---|
committer | Diva Canto | 2009-08-12 20:39:48 -0700 |
commit | 7aa54593e0b6672979feec97b8151ed134388723 (patch) | |
tree | eaa145993ba39c61f6cbfcd202deb50fbd125fe6 /OpenSim/Region/Framework/Scenes/Scene.cs | |
parent | * Added two new packet handler implementations for inventory ops. This is sta... (diff) | |
download | opensim-SC_OLD-7aa54593e0b6672979feec97b8151ed134388723.zip opensim-SC_OLD-7aa54593e0b6672979feec97b8151ed134388723.tar.gz opensim-SC_OLD-7aa54593e0b6672979feec97b8151ed134388723.tar.bz2 opensim-SC_OLD-7aa54593e0b6672979feec97b8151ed134388723.tar.xz |
Redirected all calls to CachedUserProfile methods to the inventory service. Redirection of the RootFolder property is still todo. This compiles but probably inventory will be inconsistent.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 96 |
1 files changed, 45 insertions, 51 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 919075c..0c99166 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3510,59 +3510,53 @@ namespace OpenSim.Region.Framework.Scenes | |||
3510 | case 2: // Sell a copy | 3510 | case 2: // Sell a copy |
3511 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group); | 3511 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group); |
3512 | 3512 | ||
3513 | CachedUserInfo userInfo = | 3513 | uint perms=group.GetEffectivePermissions(); |
3514 | CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); | ||
3515 | 3514 | ||
3516 | if (userInfo != null) | 3515 | if ((perms & (uint)PermissionMask.Transfer) == 0) |
3517 | { | 3516 | { |
3518 | uint perms=group.GetEffectivePermissions(); | 3517 | m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale"); |
3519 | 3518 | return false; | |
3520 | if ((perms & (uint)PermissionMask.Transfer) == 0) | 3519 | } |
3521 | { | ||
3522 | m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale"); | ||
3523 | return false; | ||
3524 | } | ||
3525 | 3520 | ||
3526 | AssetBase asset = CreateAsset( | 3521 | AssetBase asset = CreateAsset( |
3527 | group.GetPartName(localID), | 3522 | group.GetPartName(localID), |
3528 | group.GetPartDescription(localID), | 3523 | group.GetPartDescription(localID), |
3529 | (sbyte)AssetType.Object, | 3524 | (sbyte)AssetType.Object, |
3530 | Utils.StringToBytes(sceneObjectXml)); | 3525 | Utils.StringToBytes(sceneObjectXml)); |
3531 | AssetService.Store(asset); | 3526 | AssetService.Store(asset); |
3532 | 3527 | ||
3533 | InventoryItemBase item = new InventoryItemBase(); | 3528 | InventoryItemBase item = new InventoryItemBase(); |
3534 | item.CreatorId = part.CreatorID.ToString(); | 3529 | item.CreatorId = part.CreatorID.ToString(); |
3535 | 3530 | ||
3536 | item.ID = UUID.Random(); | 3531 | item.ID = UUID.Random(); |
3537 | item.Owner = remoteClient.AgentId; | 3532 | item.Owner = remoteClient.AgentId; |
3538 | item.AssetID = asset.FullID; | 3533 | item.AssetID = asset.FullID; |
3539 | item.Description = asset.Description; | 3534 | item.Description = asset.Description; |
3540 | item.Name = asset.Name; | 3535 | item.Name = asset.Name; |
3541 | item.AssetType = asset.Type; | 3536 | item.AssetType = asset.Type; |
3542 | item.InvType = (int)InventoryType.Object; | 3537 | item.InvType = (int)InventoryType.Object; |
3543 | item.Folder = categoryID; | 3538 | item.Folder = categoryID; |
3544 | 3539 | ||
3545 | uint nextPerms=(perms & 7) << 13; | 3540 | uint nextPerms=(perms & 7) << 13; |
3546 | if ((nextPerms & (uint)PermissionMask.Copy) == 0) | 3541 | if ((nextPerms & (uint)PermissionMask.Copy) == 0) |
3547 | perms &= ~(uint)PermissionMask.Copy; | 3542 | perms &= ~(uint)PermissionMask.Copy; |
3548 | if ((nextPerms & (uint)PermissionMask.Transfer) == 0) | 3543 | if ((nextPerms & (uint)PermissionMask.Transfer) == 0) |
3549 | perms &= ~(uint)PermissionMask.Transfer; | 3544 | perms &= ~(uint)PermissionMask.Transfer; |
3550 | if ((nextPerms & (uint)PermissionMask.Modify) == 0) | 3545 | if ((nextPerms & (uint)PermissionMask.Modify) == 0) |
3551 | perms &= ~(uint)PermissionMask.Modify; | 3546 | perms &= ~(uint)PermissionMask.Modify; |
3552 | 3547 | ||
3553 | item.BasePermissions = perms & part.NextOwnerMask; | 3548 | item.BasePermissions = perms & part.NextOwnerMask; |
3554 | item.CurrentPermissions = perms & part.NextOwnerMask; | 3549 | item.CurrentPermissions = perms & part.NextOwnerMask; |
3555 | item.NextPermissions = part.NextOwnerMask; | 3550 | item.NextPermissions = part.NextOwnerMask; |
3556 | item.EveryOnePermissions = part.EveryoneMask & | 3551 | item.EveryOnePermissions = part.EveryoneMask & |
3557 | part.NextOwnerMask; | 3552 | part.NextOwnerMask; |
3558 | item.GroupPermissions = part.GroupMask & | 3553 | item.GroupPermissions = part.GroupMask & |
3559 | part.NextOwnerMask; | 3554 | part.NextOwnerMask; |
3560 | item.CurrentPermissions |= 8; // Slam! | 3555 | item.CurrentPermissions |= 8; // Slam! |
3561 | item.CreationDate = Util.UnixTimeSinceEpoch(); | 3556 | item.CreationDate = Util.UnixTimeSinceEpoch(); |
3562 | 3557 | ||
3563 | userInfo.AddItem(item); | 3558 | if (InventoryService.AddItem(item)) |
3564 | remoteClient.SendInventoryItemCreateUpdate(item, 0); | 3559 | remoteClient.SendInventoryItemCreateUpdate(item, 0); |
3565 | } | ||
3566 | else | 3560 | else |
3567 | { | 3561 | { |
3568 | m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable"); | 3562 | m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable"); |
@@ -3577,8 +3571,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3577 | 3571 | ||
3578 | foreach (UUID invID in invList) | 3572 | foreach (UUID invID in invList) |
3579 | { | 3573 | { |
3580 | TaskInventoryItem item = part.Inventory.GetInventoryItem(invID); | 3574 | TaskInventoryItem item1 = part.Inventory.GetInventoryItem(invID); |
3581 | if ((item.CurrentPermissions & | 3575 | if ((item1.CurrentPermissions & |
3582 | (uint)PermissionMask.Transfer) == 0) | 3576 | (uint)PermissionMask.Transfer) == 0) |
3583 | { | 3577 | { |
3584 | okToSell = false; | 3578 | okToSell = false; |