diff options
author | Justin Clark-Casey (justincc) | 2010-03-12 22:39:15 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-03-12 22:39:15 +0000 |
commit | b9f5cd75bc9b46b067d151a1a13d4e95cc98cedb (patch) | |
tree | a9cbf02470f359f998bb76a76b0c37fd9b42d15d /OpenSim/Region/CoreModules/Avatar | |
parent | start laoding griduser local connector, though it isn't invoked by anything yet (diff) | |
download | opensim-SC_OLD-b9f5cd75bc9b46b067d151a1a13d4e95cc98cedb.zip opensim-SC_OLD-b9f5cd75bc9b46b067d151a1a13d4e95cc98cedb.tar.gz opensim-SC_OLD-b9f5cd75bc9b46b067d151a1a13d4e95cc98cedb.tar.bz2 opensim-SC_OLD-b9f5cd75bc9b46b067d151a1a13d4e95cc98cedb.tar.xz |
refactor: move client invoked AttachObject from SceneGraph to AttachmentsModule
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 3b7fe88..3c2cc42 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -67,6 +67,36 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
67 | get { return false; } | 67 | get { return false; } |
68 | } | 68 | } |
69 | 69 | ||
70 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, bool silent) | ||
71 | { | ||
72 | m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject"); | ||
73 | |||
74 | // If we can't take it, we can't attach it! | ||
75 | SceneObjectPart part = m_scene.GetSceneObjectPart(objectLocalID); | ||
76 | if (part == null) | ||
77 | return; | ||
78 | |||
79 | if (!m_scene.Permissions.CanTakeObject(part.UUID, remoteClient.AgentId)) | ||
80 | return; | ||
81 | |||
82 | // Calls attach with a Zero position | ||
83 | if (AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, Vector3.Zero, false)) | ||
84 | { | ||
85 | m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId); | ||
86 | |||
87 | // Save avatar attachment information | ||
88 | ScenePresence presence; | ||
89 | if (m_scene.AvatarFactory != null && m_scene.TryGetAvatar(remoteClient.AgentId, out presence)) | ||
90 | { | ||
91 | m_log.Info( | ||
92 | "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId | ||
93 | + ", AttachmentPoint: " + AttachmentPt); | ||
94 | |||
95 | m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); | ||
96 | } | ||
97 | } | ||
98 | } | ||
99 | |||
70 | public bool AttachObject( | 100 | public bool AttachObject( |
71 | IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, Vector3 attachPos, bool silent) | 101 | IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, Vector3 attachPos, bool silent) |
72 | { | 102 | { |
@@ -143,7 +173,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
143 | SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt) | 173 | SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt) |
144 | { | 174 | { |
145 | m_log.DebugFormat( | 175 | m_log.DebugFormat( |
146 | "[ATTACHMENTS MODULEY]: Updating inventory of {0} to show attachment of {1} (item ID {2})", | 176 | "[ATTACHMENTS MODULE]: Updating inventory of {0} to show attachment of {1} (item ID {2})", |
147 | remoteClient.Name, att.Name, itemID); | 177 | remoteClient.Name, att.Name, itemID); |
148 | 178 | ||
149 | if (!att.IsDeleted) | 179 | if (!att.IsDeleted) |