aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar
diff options
context:
space:
mode:
authorMelanie2010-06-09 20:25:05 +0100
committerMelanie2010-06-09 20:25:05 +0100
commit1dce2436613de7772a91013cd2defc977b5adb26 (patch)
tree0a105bd8fedd0c6b4c15b6268bdb32b1f069c0c6 /OpenSim/Region/CoreModules/Avatar
parentGive attachments the same priority as other avatars in BestAvatarResponsiveness (diff)
parentBug fix on attachments: attach->drop->attach works now. (diff)
downloadopensim-SC-1dce2436613de7772a91013cd2defc977b5adb26.zip
opensim-SC-1dce2436613de7772a91013cd2defc977b5adb26.tar.gz
opensim-SC-1dce2436613de7772a91013cd2defc977b5adb26.tar.bz2
opensim-SC-1dce2436613de7772a91013cd2defc977b5adb26.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs48
1 files changed, 28 insertions, 20 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
28using System;
28using System.Collections.Generic; 29using System.Collections.Generic;
29using System.Reflection; 30using System.Reflection;
30using System.Xml; 31using 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(