diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 116 |
1 files changed, 61 insertions, 55 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 18d7bad..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; |
@@ -2076,6 +2087,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2076 | client.OnUpdatePrimTexture += m_sceneGraph.UpdatePrimTexture; | 2087 | client.OnUpdatePrimTexture += m_sceneGraph.UpdatePrimTexture; |
2077 | client.OnTeleportLocationRequest += RequestTeleportLocation; | 2088 | client.OnTeleportLocationRequest += RequestTeleportLocation; |
2078 | client.OnTeleportLandmarkRequest += RequestTeleportLandmark; | 2089 | client.OnTeleportLandmarkRequest += RequestTeleportLandmark; |
2090 | client.OnObjectRequest += RequestPrim; | ||
2079 | client.OnObjectSelect += SelectPrim; | 2091 | client.OnObjectSelect += SelectPrim; |
2080 | client.OnObjectDeselect += DeselectPrim; | 2092 | client.OnObjectDeselect += DeselectPrim; |
2081 | client.OnGrabUpdate += m_sceneGraph.MoveObject; | 2093 | client.OnGrabUpdate += m_sceneGraph.MoveObject; |
@@ -3672,59 +3684,53 @@ namespace OpenSim.Region.Framework.Scenes | |||
3672 | case 2: // Sell a copy | 3684 | case 2: // Sell a copy |
3673 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group); | 3685 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group); |
3674 | 3686 | ||
3675 | CachedUserInfo userInfo = | 3687 | uint perms=group.GetEffectivePermissions(); |
3676 | CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); | ||
3677 | 3688 | ||
3678 | if (userInfo != null) | 3689 | if ((perms & (uint)PermissionMask.Transfer) == 0) |
3679 | { | 3690 | { |
3680 | uint perms=group.GetEffectivePermissions(); | 3691 | m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale"); |
3681 | 3692 | return false; | |
3682 | if ((perms & (uint)PermissionMask.Transfer) == 0) | 3693 | } |
3683 | { | ||
3684 | m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale"); | ||
3685 | return false; | ||
3686 | } | ||
3687 | 3694 | ||
3688 | AssetBase asset = CreateAsset( | 3695 | AssetBase asset = CreateAsset( |
3689 | group.GetPartName(localID), | 3696 | group.GetPartName(localID), |
3690 | group.GetPartDescription(localID), | 3697 | group.GetPartDescription(localID), |
3691 | (sbyte)AssetType.Object, | 3698 | (sbyte)AssetType.Object, |
3692 | Utils.StringToBytes(sceneObjectXml)); | 3699 | Utils.StringToBytes(sceneObjectXml)); |
3693 | AssetService.Store(asset); | 3700 | AssetService.Store(asset); |
3694 | 3701 | ||
3695 | InventoryItemBase item = new InventoryItemBase(); | 3702 | InventoryItemBase item = new InventoryItemBase(); |
3696 | item.CreatorId = part.CreatorID.ToString(); | 3703 | item.CreatorId = part.CreatorID.ToString(); |
3697 | 3704 | ||
3698 | item.ID = UUID.Random(); | 3705 | item.ID = UUID.Random(); |
3699 | item.Owner = remoteClient.AgentId; | 3706 | item.Owner = remoteClient.AgentId; |
3700 | item.AssetID = asset.FullID; | 3707 | item.AssetID = asset.FullID; |
3701 | item.Description = asset.Description; | 3708 | item.Description = asset.Description; |
3702 | item.Name = asset.Name; | 3709 | item.Name = asset.Name; |
3703 | item.AssetType = asset.Type; | 3710 | item.AssetType = asset.Type; |
3704 | item.InvType = (int)InventoryType.Object; | 3711 | item.InvType = (int)InventoryType.Object; |
3705 | item.Folder = categoryID; | 3712 | item.Folder = categoryID; |
3706 | 3713 | ||
3707 | uint nextPerms=(perms & 7) << 13; | 3714 | uint nextPerms=(perms & 7) << 13; |
3708 | if ((nextPerms & (uint)PermissionMask.Copy) == 0) | 3715 | if ((nextPerms & (uint)PermissionMask.Copy) == 0) |
3709 | perms &= ~(uint)PermissionMask.Copy; | 3716 | perms &= ~(uint)PermissionMask.Copy; |
3710 | if ((nextPerms & (uint)PermissionMask.Transfer) == 0) | 3717 | if ((nextPerms & (uint)PermissionMask.Transfer) == 0) |
3711 | perms &= ~(uint)PermissionMask.Transfer; | 3718 | perms &= ~(uint)PermissionMask.Transfer; |
3712 | if ((nextPerms & (uint)PermissionMask.Modify) == 0) | 3719 | if ((nextPerms & (uint)PermissionMask.Modify) == 0) |
3713 | perms &= ~(uint)PermissionMask.Modify; | 3720 | perms &= ~(uint)PermissionMask.Modify; |
3714 | 3721 | ||
3715 | item.BasePermissions = perms & part.NextOwnerMask; | 3722 | item.BasePermissions = perms & part.NextOwnerMask; |
3716 | item.CurrentPermissions = perms & part.NextOwnerMask; | 3723 | item.CurrentPermissions = perms & part.NextOwnerMask; |
3717 | item.NextPermissions = part.NextOwnerMask; | 3724 | item.NextPermissions = part.NextOwnerMask; |
3718 | item.EveryOnePermissions = part.EveryoneMask & | 3725 | item.EveryOnePermissions = part.EveryoneMask & |
3719 | part.NextOwnerMask; | 3726 | part.NextOwnerMask; |
3720 | item.GroupPermissions = part.GroupMask & | 3727 | item.GroupPermissions = part.GroupMask & |
3721 | part.NextOwnerMask; | 3728 | part.NextOwnerMask; |
3722 | item.CurrentPermissions |= 8; // Slam! | 3729 | item.CurrentPermissions |= 8; // Slam! |
3723 | item.CreationDate = Util.UnixTimeSinceEpoch(); | 3730 | item.CreationDate = Util.UnixTimeSinceEpoch(); |
3724 | 3731 | ||
3725 | userInfo.AddItem(item); | 3732 | if (InventoryService.AddItem(item)) |
3726 | remoteClient.SendInventoryItemCreateUpdate(item, 0); | 3733 | remoteClient.SendInventoryItemCreateUpdate(item, 0); |
3727 | } | ||
3728 | else | 3734 | else |
3729 | { | 3735 | { |
3730 | m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable"); | 3736 | m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable"); |
@@ -3739,8 +3745,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3739 | 3745 | ||
3740 | foreach (UUID invID in invList) | 3746 | foreach (UUID invID in invList) |
3741 | { | 3747 | { |
3742 | TaskInventoryItem item = part.Inventory.GetInventoryItem(invID); | 3748 | TaskInventoryItem item1 = part.Inventory.GetInventoryItem(invID); |
3743 | if ((item.CurrentPermissions & | 3749 | if ((item1.CurrentPermissions & |
3744 | (uint)PermissionMask.Transfer) == 0) | 3750 | (uint)PermissionMask.Transfer) == 0) |
3745 | { | 3751 | { |
3746 | okToSell = false; | 3752 | okToSell = false; |