diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 115 |
1 files changed, 60 insertions, 55 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a2275f8..d1f7a4b 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); |
@@ -2042,13 +2042,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
2042 | } | 2042 | } |
2043 | else | 2043 | else |
2044 | { | 2044 | { |
2045 | AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode); | ||
2046 | |||
2045 | m_log.DebugFormat( | 2047 | m_log.DebugFormat( |
2046 | "[SCENE]: Adding new child agent for {0} in {1}", | 2048 | "[SCENE]: Adding new {0} agent for {1} in {2}", |
2047 | client.Name, RegionInfo.RegionName); | 2049 | ((aCircuit.child == true) ? "child" : "root"), client.Name, RegionInfo.RegionName); |
2048 | 2050 | ||
2049 | CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); | 2051 | CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); |
2050 | 2052 | ||
2051 | CreateAndAddScenePresence(client); | 2053 | ScenePresence sp = CreateAndAddScenePresence(client); |
2054 | |||
2055 | // HERE!!! Do the initial attachments right here | ||
2056 | // first agent upon login is a root agent by design. | ||
2057 | // All other AddNewClient calls find aCircuit.child to be true | ||
2058 | if (aCircuit.child == false) | ||
2059 | { | ||
2060 | sp.IsChildAgent = false; | ||
2061 | sp.RezAttachments(); | ||
2062 | } | ||
2052 | } | 2063 | } |
2053 | 2064 | ||
2054 | m_LastLogin = Environment.TickCount; | 2065 | m_LastLogin = Environment.TickCount; |
@@ -3673,59 +3684,53 @@ namespace OpenSim.Region.Framework.Scenes | |||
3673 | case 2: // Sell a copy | 3684 | case 2: // Sell a copy |
3674 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group); | 3685 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group); |
3675 | 3686 | ||
3676 | CachedUserInfo userInfo = | 3687 | uint perms=group.GetEffectivePermissions(); |
3677 | CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); | ||
3678 | 3688 | ||
3679 | if (userInfo != null) | 3689 | if ((perms & (uint)PermissionMask.Transfer) == 0) |
3680 | { | 3690 | { |
3681 | uint perms=group.GetEffectivePermissions(); | 3691 | m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale"); |
3682 | 3692 | return false; | |
3683 | if ((perms & (uint)PermissionMask.Transfer) == 0) | 3693 | } |
3684 | { | ||
3685 | m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale"); | ||
3686 | return false; | ||
3687 | } | ||
3688 | 3694 | ||
3689 | AssetBase asset = CreateAsset( | 3695 | AssetBase asset = CreateAsset( |
3690 | group.GetPartName(localID), | 3696 | group.GetPartName(localID), |
3691 | group.GetPartDescription(localID), | 3697 | group.GetPartDescription(localID), |
3692 | (sbyte)AssetType.Object, | 3698 | (sbyte)AssetType.Object, |
3693 | Utils.StringToBytes(sceneObjectXml)); | 3699 | Utils.StringToBytes(sceneObjectXml)); |
3694 | AssetService.Store(asset); | 3700 | AssetService.Store(asset); |
3695 | 3701 | ||
3696 | InventoryItemBase item = new InventoryItemBase(); | 3702 | InventoryItemBase item = new InventoryItemBase(); |
3697 | item.CreatorId = part.CreatorID.ToString(); | 3703 | item.CreatorId = part.CreatorID.ToString(); |
3698 | 3704 | ||
3699 | item.ID = UUID.Random(); | 3705 | item.ID = UUID.Random(); |
3700 | item.Owner = remoteClient.AgentId; | 3706 | item.Owner = remoteClient.AgentId; |
3701 | item.AssetID = asset.FullID; | 3707 | item.AssetID = asset.FullID; |
3702 | item.Description = asset.Description; | 3708 | item.Description = asset.Description; |
3703 | item.Name = asset.Name; | 3709 | item.Name = asset.Name; |
3704 | item.AssetType = asset.Type; | 3710 | item.AssetType = asset.Type; |
3705 | item.InvType = (int)InventoryType.Object; | 3711 | item.InvType = (int)InventoryType.Object; |
3706 | item.Folder = categoryID; | 3712 | item.Folder = categoryID; |
3707 | 3713 | ||
3708 | uint nextPerms=(perms & 7) << 13; | 3714 | uint nextPerms=(perms & 7) << 13; |
3709 | if ((nextPerms & (uint)PermissionMask.Copy) == 0) | 3715 | if ((nextPerms & (uint)PermissionMask.Copy) == 0) |
3710 | perms &= ~(uint)PermissionMask.Copy; | 3716 | perms &= ~(uint)PermissionMask.Copy; |
3711 | if ((nextPerms & (uint)PermissionMask.Transfer) == 0) | 3717 | if ((nextPerms & (uint)PermissionMask.Transfer) == 0) |
3712 | perms &= ~(uint)PermissionMask.Transfer; | 3718 | perms &= ~(uint)PermissionMask.Transfer; |
3713 | if ((nextPerms & (uint)PermissionMask.Modify) == 0) | 3719 | if ((nextPerms & (uint)PermissionMask.Modify) == 0) |
3714 | perms &= ~(uint)PermissionMask.Modify; | 3720 | perms &= ~(uint)PermissionMask.Modify; |
3715 | 3721 | ||
3716 | item.BasePermissions = perms & part.NextOwnerMask; | 3722 | item.BasePermissions = perms & part.NextOwnerMask; |
3717 | item.CurrentPermissions = perms & part.NextOwnerMask; | 3723 | item.CurrentPermissions = perms & part.NextOwnerMask; |
3718 | item.NextPermissions = part.NextOwnerMask; | 3724 | item.NextPermissions = part.NextOwnerMask; |
3719 | item.EveryOnePermissions = part.EveryoneMask & | 3725 | item.EveryOnePermissions = part.EveryoneMask & |
3720 | part.NextOwnerMask; | 3726 | part.NextOwnerMask; |
3721 | item.GroupPermissions = part.GroupMask & | 3727 | item.GroupPermissions = part.GroupMask & |
3722 | part.NextOwnerMask; | 3728 | part.NextOwnerMask; |
3723 | item.CurrentPermissions |= 8; // Slam! | 3729 | item.CurrentPermissions |= 8; // Slam! |
3724 | item.CreationDate = Util.UnixTimeSinceEpoch(); | 3730 | item.CreationDate = Util.UnixTimeSinceEpoch(); |
3725 | 3731 | ||
3726 | userInfo.AddItem(item); | 3732 | if (InventoryService.AddItem(item)) |
3727 | remoteClient.SendInventoryItemCreateUpdate(item, 0); | 3733 | remoteClient.SendInventoryItemCreateUpdate(item, 0); |
3728 | } | ||
3729 | else | 3734 | else |
3730 | { | 3735 | { |
3731 | m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable"); | 3736 | m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable"); |
@@ -3740,8 +3745,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3740 | 3745 | ||
3741 | foreach (UUID invID in invList) | 3746 | foreach (UUID invID in invList) |
3742 | { | 3747 | { |
3743 | TaskInventoryItem item = part.Inventory.GetInventoryItem(invID); | 3748 | TaskInventoryItem item1 = part.Inventory.GetInventoryItem(invID); |
3744 | if ((item.CurrentPermissions & | 3749 | if ((item1.CurrentPermissions & |
3745 | (uint)PermissionMask.Transfer) == 0) | 3750 | (uint)PermissionMask.Transfer) == 0) |
3746 | { | 3751 | { |
3747 | okToSell = false; | 3752 | okToSell = false; |