aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorDiva Canto2010-07-14 14:48:14 -0700
committerDiva Canto2010-07-14 14:48:14 -0700
commit0d8c0811d381951939efd4e2887b872e81a6a34a (patch)
tree1424db67347d3e441817cf8860327a8d884b061a /OpenSim/Region
parentRemoved a few obsolete mono addin references. Mantis #4854 (diff)
parentMajor attachments cleanup. Remove unused AttachObject ClientView method (diff)
downloadopensim-SC_OLD-0d8c0811d381951939efd4e2887b872e81a6a34a.zip
opensim-SC_OLD-0d8c0811d381951939efd4e2887b872e81a6a34a.tar.gz
opensim-SC_OLD-0d8c0811d381951939efd4e2887b872e81a6a34a.tar.bz2
opensim-SC_OLD-0d8c0811d381951939efd4e2887b872e81a6a34a.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs26
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs103
-rw-r--r--OpenSim/Region/DataSnapshot/ObjectSnapshot.cs2
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs4
-rw-r--r--OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs3
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs5
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs5
9 files changed, 55 insertions, 101 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 540fccc..0aec01a 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -3678,30 +3678,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3678 3678
3679 #endregion Primitive Packet/Data Sending Methods 3679 #endregion Primitive Packet/Data Sending Methods
3680 3680
3681 /// <summary>
3682 ///
3683 /// </summary>
3684 /// <param name="localID"></param>
3685 /// <param name="rotation"></param>
3686 /// <param name="attachPoint"></param>
3687 public void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID)
3688 {
3689 if (attachPoint > 30 && ownerID != AgentId) // Someone else's HUD
3690 return;
3691
3692 ObjectAttachPacket attach = (ObjectAttachPacket)PacketPool.Instance.GetPacket(PacketType.ObjectAttach);
3693 // TODO: don't create new blocks if recycling an old packet
3694 attach.AgentData.AgentID = AgentId;
3695 attach.AgentData.SessionID = m_sessionId;
3696 attach.AgentData.AttachmentPoint = attachPoint;
3697 attach.ObjectData = new ObjectAttachPacket.ObjectDataBlock[1];
3698 attach.ObjectData[0] = new ObjectAttachPacket.ObjectDataBlock();
3699 attach.ObjectData[0].ObjectLocalID = localID;
3700 attach.ObjectData[0].Rotation = rotation;
3701 attach.Header.Zerocoded = true;
3702 OutPacket(attach, ThrottleOutPacketType.Task);
3703 }
3704
3705 void HandleQueueEmpty(ThrottleOutPacketTypeFlags categories) 3681 void HandleQueueEmpty(ThrottleOutPacketTypeFlags categories)
3706 { 3682 {
3707 if ((categories & ThrottleOutPacketTypeFlags.Task) != 0) 3683 if ((categories & ThrottleOutPacketTypeFlags.Task) != 0)
@@ -5731,7 +5707,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5731 { 5707 {
5732 if (att.ObjectData.Length > 0) 5708 if (att.ObjectData.Length > 0)
5733 { 5709 {
5734 handlerObjectAttach(this, att.ObjectData[0].ObjectLocalID, att.AgentData.AttachmentPoint, att.ObjectData[0].Rotation, false); 5710 handlerObjectAttach(this, att.ObjectData[0].ObjectLocalID, att.AgentData.AttachmentPoint, false);
5735 } 5711 }
5736 } 5712 }
5737 } 5713 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index a7b4c66..527934d 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -69,7 +69,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
69 get { return false; } 69 get { return false; }
70 } 70 }
71 71
72 public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, bool silent) 72 // Called by client
73 //
74 public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent)
73 { 75 {
74 m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject"); 76 m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject");
75 77
@@ -84,7 +86,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
84 return; 86 return;
85 87
86 // Calls attach with a Zero position 88 // Calls attach with a Zero position
87 if (AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, Vector3.Zero, false)) 89 if (AttachObject(remoteClient, part.ParentGroup, AttachmentPt, false))
88 { 90 {
89 m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId); 91 m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId);
90 92
@@ -106,72 +108,64 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
106 } 108 }
107 } 109 }
108 110
109 public bool AttachObject( 111 public bool AttachObject(IClientAPI remoteClient, SceneObjectGroup group, uint AttachmentPt, bool silent)
110 IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, Vector3 attachPos, bool silent)
111 { 112 {
112 SceneObjectGroup group = m_scene.GetGroupByPrim(objectLocalID); 113 Vector3 attachPos = group.AbsolutePosition;
113 if (group != null) 114
115 if (m_scene.Permissions.CanTakeObject(group.UUID, remoteClient.AgentId))
114 { 116 {
115 if (m_scene.Permissions.CanTakeObject(group.UUID, remoteClient.AgentId)) 117 // If the attachment point isn't the same as the one previously used
118 // set it's offset position = 0 so that it appears on the attachment point
119 // and not in a weird location somewhere unknown.
120 if (AttachmentPt != 0 && AttachmentPt != (uint)group.GetAttachmentPoint())
116 { 121 {
117 // If the attachment point isn't the same as the one previously used 122 attachPos = Vector3.Zero;
118 // set it's offset position = 0 so that it appears on the attachment point 123 }
119 // and not in a weird location somewhere unknown.
120 if (AttachmentPt != 0 && AttachmentPt != (uint)group.GetAttachmentPoint())
121 {
122 attachPos = Vector3.Zero;
123 }
124
125 // AttachmentPt 0 means the client chose to 'wear' the attachment.
126 if (AttachmentPt == 0)
127 {
128 // Check object for stored attachment point
129 AttachmentPt = (uint)group.GetAttachmentPoint();
130 }
131
132 // if we still didn't find a suitable attachment point.......
133 if (AttachmentPt == 0)
134 {
135 // Stick it on left hand with Zero Offset from the attachment point.
136 AttachmentPt = (uint)AttachmentPoint.LeftHand;
137 attachPos = Vector3.Zero;
138 }
139 124
140 group.SetAttachmentPoint((byte)AttachmentPt); 125 // AttachmentPt 0 means the client chose to 'wear' the attachment.
141 group.AbsolutePosition = attachPos; 126 if (AttachmentPt == 0)
127 {
128 // Check object for stored attachment point
129 AttachmentPt = (uint)group.GetAttachmentPoint();
130 }
142 131
143 // Saves and gets itemID 132 // if we still didn't find a suitable attachment point.......
144 UUID itemId; 133 if (AttachmentPt == 0)
134 {
135 // Stick it on left hand with Zero Offset from the attachment point.
136 AttachmentPt = (uint)AttachmentPoint.LeftHand;
137 attachPos = Vector3.Zero;
138 }
145 139
146 if (group.GetFromItemID() == UUID.Zero) 140 group.SetAttachmentPoint((byte)AttachmentPt);
147 { 141 group.AbsolutePosition = attachPos;
148 m_scene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId, out itemId);
149 }
150 else
151 {
152 itemId = group.GetFromItemID();
153 }
154 142
155 SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemId, group); 143 // Saves and gets itemID
144 UUID itemId;
156 145
157 group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); 146 if (group.GetFromItemID() == UUID.Zero)
158 147 {
159 // In case it is later dropped again, don't let 148 m_scene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId, out itemId);
160 // it get cleaned up
161 group.RootPart.RemFlag(PrimFlags.TemporaryOnRez);
162 group.HasGroupChanged = false;
163 } 149 }
164 else 150 else
165 { 151 {
166 remoteClient.SendAgentAlertMessage( 152 itemId = group.GetFromItemID();
167 "You don't have sufficient permissions to attach this object", false);
168
169 return false;
170 } 153 }
154
155 SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemId, group);
156
157 group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent);
158
159 // In case it is later dropped again, don't let
160 // it get cleaned up
161 group.RootPart.RemFlag(PrimFlags.TemporaryOnRez);
162 group.HasGroupChanged = false;
171 } 163 }
172 else 164 else
173 { 165 {
174 m_log.DebugFormat("[ATTACHMENTS MODULE]: AttachObject found no such scene object {0}", objectLocalID); 166 remoteClient.SendAgentAlertMessage(
167 "You don't have sufficient permissions to attach this object", false);
168
175 return false; 169 return false;
176 } 170 }
177 171
@@ -237,8 +231,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
237 if (AttachmentPt != 0 && AttachmentPt != objatt.GetAttachmentPoint()) 231 if (AttachmentPt != 0 && AttachmentPt != objatt.GetAttachmentPoint())
238 tainted = true; 232 tainted = true;
239 233
240 AttachObject( 234 AttachObject(remoteClient, objatt, AttachmentPt, false);
241 remoteClient, objatt.LocalId, AttachmentPt, Quaternion.Identity, objatt.AbsolutePosition, false);
242 //objatt.ScheduleGroupForFullUpdate(); 235 //objatt.ScheduleGroupForFullUpdate();
243 236
244 if (tainted) 237 if (tainted)
diff --git a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
index 6e69902..00f6918 100644
--- a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
+++ b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
@@ -73,7 +73,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
73 client.OnGrabUpdate += delegate(UUID objectID, Vector3 offset, Vector3 grapPos, 73 client.OnGrabUpdate += delegate(UUID objectID, Vector3 offset, Vector3 grapPos,
74 IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) { this.Stale = true; }; 74 IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) { this.Stale = true; };
75 client.OnObjectAttach += delegate(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, 75 client.OnObjectAttach += delegate(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt,
76 Quaternion rot, bool silent) { this.Stale = true; }; 76 bool silent) { this.Stale = true; };
77 client.OnObjectDuplicate += delegate(uint localID, Vector3 offset, uint dupeFlags, UUID AgentID, 77 client.OnObjectDuplicate += delegate(uint localID, Vector3 offset, uint dupeFlags, UUID AgentID,
78 UUID GroupID) { this.Stale = true; }; 78 UUID GroupID) { this.Stale = true; };
79 client.OnObjectDuplicateOnRay += delegate(uint localID, uint dupeFlags, UUID AgentID, UUID GroupID, 79 client.OnObjectDuplicateOnRay += delegate(uint localID, uint dupeFlags, UUID AgentID, UUID GroupID,
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index af9df45..f6e6163 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -536,10 +536,6 @@ namespace OpenSim.Region.Examples.SimpleModule
536 { 536 {
537 } 537 }
538 538
539 public virtual void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID)
540 {
541 }
542
543 public virtual void SendDialog(string objectname, UUID objectID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels) 539 public virtual void SendDialog(string objectname, UUID objectID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels)
544 { 540 {
545 } 541 }
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
index f8af367..2af2548 100644
--- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Region.Framework.Interfaces
44 /// <param name="rot"></param> 44 /// <param name="rot"></param>
45 /// <param name="silent"></param> 45 /// <param name="silent"></param>
46 void AttachObject( 46 void AttachObject(
47 IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, bool silent); 47 IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent);
48 48
49 /// <summary> 49 /// <summary>
50 /// Attach an object to an avatar. 50 /// Attach an object to an avatar.
@@ -57,7 +57,7 @@ namespace OpenSim.Region.Framework.Interfaces
57 /// <param name="silent"></param> 57 /// <param name="silent"></param>
58 /// <returns>true if the object was successfully attached, false otherwise</returns> 58 /// <returns>true if the object was successfully attached, false otherwise</returns>
59 bool AttachObject( 59 bool AttachObject(
60 IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, Vector3 attachPos, bool silent); 60 IClientAPI remoteClient, SceneObjectGroup grp, uint AttachmentPt, bool silent);
61 61
62 /// <summary> 62 /// <summary>
63 /// Rez an attachment from user inventory and change inventory status to match. 63 /// Rez an attachment from user inventory and change inventory status to match.
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 40176ec..b0f4ac0 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2571,8 +2571,7 @@ namespace OpenSim.Region.Framework.Scenes
2571 RootPrim.RemFlag(PrimFlags.TemporaryOnRez); 2571 RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
2572 2572
2573 if (AttachmentsModule != null) 2573 if (AttachmentsModule != null)
2574 AttachmentsModule.AttachObject( 2574 AttachmentsModule.AttachObject(sp.ControllingClient, grp, 0, false);
2575 sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false);
2576 2575
2577 } 2576 }
2578 else 2577 else
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 754b925..ee7aa2da 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -1055,11 +1055,6 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
1055 1055
1056 } 1056 }
1057 1057
1058 public void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID)
1059 {
1060
1061 }
1062
1063 public void SendAvatarDataImmediate(ISceneEntity avatar) 1058 public void SendAvatarDataImmediate(ISceneEntity avatar)
1064 { 1059 {
1065 1060
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 12d6643..2e0450c 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -627,10 +627,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC
627 { 627 {
628 } 628 }
629 629
630 public virtual void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID)
631 {
632 }
633
634 public virtual void SendDialog(string objectname, UUID objectID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels) 630 public virtual void SendDialog(string objectname, UUID objectID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels)
635 { 631 {
636 } 632 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index c5226ba..dbea6ef 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2940,9 +2940,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2940 2940
2941 IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; 2941 IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule;
2942 if (attachmentsModule != null) 2942 if (attachmentsModule != null)
2943 attachmentsModule.AttachObject( 2943 attachmentsModule.AttachObject(presence.ControllingClient,
2944 presence.ControllingClient, grp.LocalId, 2944 grp, (uint)attachment, false);
2945 (uint)attachment, Quaternion.Identity, Vector3.Zero, false);
2946 } 2945 }
2947 } 2946 }
2948 2947