diff options
author | Melanie | 2010-06-09 20:25:05 +0100 |
---|---|---|
committer | Melanie | 2010-06-09 20:25:05 +0100 |
commit | 1dce2436613de7772a91013cd2defc977b5adb26 (patch) | |
tree | 0a105bd8fedd0c6b4c15b6268bdb32b1f069c0c6 /OpenSim/Region | |
parent | Give attachments the same priority as other avatars in BestAvatarResponsiveness (diff) | |
parent | Bug fix on attachments: attach->drop->attach works now. (diff) | |
download | opensim-SC_OLD-1dce2436613de7772a91013cd2defc977b5adb26.zip opensim-SC_OLD-1dce2436613de7772a91013cd2defc977b5adb26.tar.gz opensim-SC_OLD-1dce2436613de7772a91013cd2defc977b5adb26.tar.bz2 opensim-SC_OLD-1dce2436613de7772a91013cd2defc977b5adb26.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region')
3 files changed, 34 insertions, 21 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 4fac01f..f63089d 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -25,6 +25,7 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | ||
28 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
29 | using System.Reflection; | 30 | using System.Reflection; |
30 | using System.Xml; | 31 | using System.Xml; |
@@ -73,31 +74,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
73 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, bool silent) | 74 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, bool silent) |
74 | { | 75 | { |
75 | m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject"); | 76 | m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject"); |
76 | |||
77 | // If we can't take it, we can't attach it! | ||
78 | SceneObjectPart part = m_scene.GetSceneObjectPart(objectLocalID); | ||
79 | if (part == null) | ||
80 | return; | ||
81 | 77 | ||
82 | if (!m_scene.Permissions.CanTakeObject(part.UUID, remoteClient.AgentId)) | 78 | try |
83 | return; | ||
84 | |||
85 | // Calls attach with a Zero position | ||
86 | if (AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, Vector3.Zero, false)) | ||
87 | { | 79 | { |
88 | m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId); | 80 | // If we can't take it, we can't attach it! |
89 | 81 | SceneObjectPart part = m_scene.GetSceneObjectPart(objectLocalID); | |
90 | // Save avatar attachment information | 82 | if (part == null) |
91 | ScenePresence presence; | 83 | return; |
92 | if (m_scene.AvatarFactory != null && m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) | 84 | |
85 | if (!m_scene.Permissions.CanTakeObject(part.UUID, remoteClient.AgentId)) | ||
86 | return; | ||
87 | |||
88 | // Calls attach with a Zero position | ||
89 | if (AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, Vector3.Zero, false)) | ||
93 | { | 90 | { |
94 | m_log.Info( | 91 | m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId); |
95 | "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId | 92 | |
96 | + ", AttachmentPoint: " + AttachmentPt); | 93 | // Save avatar attachment information |
97 | 94 | ScenePresence presence; | |
98 | m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); | 95 | if (m_scene.AvatarFactory != null && m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) |
96 | { | ||
97 | m_log.Info( | ||
98 | "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId | ||
99 | + ", AttachmentPoint: " + AttachmentPt); | ||
100 | |||
101 | m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); | ||
102 | } | ||
99 | } | 103 | } |
100 | } | 104 | } |
105 | catch (Exception e) | ||
106 | { | ||
107 | m_log.DebugFormat("[ATTACHMENTS MODULE]: exception upon Attach Object {0}", e); | ||
108 | } | ||
101 | } | 109 | } |
102 | 110 | ||
103 | public bool AttachObject( | 111 | public bool AttachObject( |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index e111867..8847043 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1755,7 +1755,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1755 | item.AssetType = asset.Type; | 1755 | item.AssetType = asset.Type; |
1756 | item.InvType = (int)InventoryType.Object; | 1756 | item.InvType = (int)InventoryType.Object; |
1757 | 1757 | ||
1758 | item.Folder = UUID.Zero; // Objects folder! | 1758 | InventoryFolderBase folder = InventoryService.GetFolderForType(remoteClient.AgentId, AssetType.Object); |
1759 | if (folder != null) | ||
1760 | item.Folder = folder.ID; | ||
1761 | else // oopsies | ||
1762 | item.Folder = UUID.Zero; | ||
1759 | 1763 | ||
1760 | if ((remoteClient.AgentId != grp.RootPart.OwnerID) && Permissions.PropagatePermissions()) | 1764 | if ((remoteClient.AgentId != grp.RootPart.OwnerID) && Permissions.PropagatePermissions()) |
1761 | { | 1765 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index f918291..66ad14f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1206,6 +1206,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1206 | return; | 1206 | return; |
1207 | 1207 | ||
1208 | detachedpos = avatar.AbsolutePosition; | 1208 | detachedpos = avatar.AbsolutePosition; |
1209 | RootPart.FromItemID = UUID.Zero; | ||
1209 | 1210 | ||
1210 | AbsolutePosition = detachedpos; | 1211 | AbsolutePosition = detachedpos; |
1211 | m_rootPart.AttachedAvatar = UUID.Zero; | 1212 | m_rootPart.AttachedAvatar = UUID.Zero; |