diff options
author | Melanie | 2010-07-14 19:51:12 +0100 |
---|---|---|
committer | Melanie | 2010-07-14 19:51:12 +0100 |
commit | e1ea82b329b9346ccacb1edd25a0e2b44f07e8c8 (patch) | |
tree | 6bff7c77be5ebee69eb1fecbdc1dce5633bc42e5 /OpenSim | |
parent | Remove useless quaternion parameter from AttachObject sig (diff) | |
download | opensim-SC-e1ea82b329b9346ccacb1edd25a0e2b44f07e8c8.zip opensim-SC-e1ea82b329b9346ccacb1edd25a0e2b44f07e8c8.tar.gz opensim-SC-e1ea82b329b9346ccacb1edd25a0e2b44f07e8c8.tar.bz2 opensim-SC-e1ea82b329b9346ccacb1edd25a0e2b44f07e8c8.tar.xz |
Major attachments cleanup. Remove unused AttachObject ClientView method
Clean up use of AttachObject throughout, reduce number of overloads
and number of parameters
Diffstat (limited to '')
13 files changed, 51 insertions, 117 deletions
diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index fa1f0d8..65921a2 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs | |||
@@ -1035,11 +1035,6 @@ namespace OpenSim.Client.MXP.ClientStack | |||
1035 | // Minimap function, not used. | 1035 | // Minimap function, not used. |
1036 | } | 1036 | } |
1037 | 1037 | ||
1038 | public void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID) | ||
1039 | { | ||
1040 | // Need to translate to MXP somehow | ||
1041 | } | ||
1042 | |||
1043 | public void SetChildAgentThrottle(byte[] throttle) | 1038 | public void SetChildAgentThrottle(byte[] throttle) |
1044 | { | 1039 | { |
1045 | // Need to translate to MXP somehow | 1040 | // Need to translate to MXP somehow |
diff --git a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs index cf7aaf2..b808e95 100644 --- a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs +++ b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs | |||
@@ -593,11 +593,6 @@ namespace OpenSim.Client.Sirikata.ClientStack | |||
593 | throw new System.NotImplementedException(); | 593 | throw new System.NotImplementedException(); |
594 | } | 594 | } |
595 | 595 | ||
596 | public void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID) | ||
597 | { | ||
598 | throw new System.NotImplementedException(); | ||
599 | } | ||
600 | |||
601 | public void SetChildAgentThrottle(byte[] throttle) | 596 | public void SetChildAgentThrottle(byte[] throttle) |
602 | { | 597 | { |
603 | throw new System.NotImplementedException(); | 598 | throw new System.NotImplementedException(); |
diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs index ab23484..a6c490b 100644 --- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs +++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs | |||
@@ -599,11 +599,6 @@ namespace OpenSim.Client.VWoHTTP.ClientStack | |||
599 | throw new System.NotImplementedException(); | 599 | throw new System.NotImplementedException(); |
600 | } | 600 | } |
601 | 601 | ||
602 | public void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID) | ||
603 | { | ||
604 | throw new System.NotImplementedException(); | ||
605 | } | ||
606 | |||
607 | public void SetChildAgentThrottle(byte[] throttle) | 602 | public void SetChildAgentThrottle(byte[] throttle) |
608 | { | 603 | { |
609 | throw new System.NotImplementedException(); | 604 | throw new System.NotImplementedException(); |
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index fbbbc08..db74548 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -1017,7 +1017,6 @@ namespace OpenSim.Framework | |||
1017 | 1017 | ||
1018 | void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations); | 1018 | void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations); |
1019 | 1019 | ||
1020 | void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID); | ||
1021 | void SetChildAgentThrottle(byte[] throttle); | 1020 | void SetChildAgentThrottle(byte[] throttle); |
1022 | 1021 | ||
1023 | void SendAvatarDataImmediate(ISceneEntity avatar); | 1022 | void SendAvatarDataImmediate(ISceneEntity avatar); |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 2a21b02..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) |
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 84c406a..527934d 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -69,6 +69,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
69 | get { return false; } | 69 | get { return false; } |
70 | } | 70 | } |
71 | 71 | ||
72 | // Called by client | ||
73 | // | ||
72 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent) | 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"); |
@@ -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, 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, 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, objatt.AbsolutePosition, false); | ||
242 | //objatt.ScheduleGroupForFullUpdate(); | 235 | //objatt.ScheduleGroupForFullUpdate(); |
243 | 236 | ||
244 | if (tainted) | 237 | if (tainted) |
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 b1bc3bc..2af2548 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | |||
@@ -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, 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 c47369b..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.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 | ||
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 496cfb8..999cf5e 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs | |||
@@ -630,10 +630,6 @@ namespace OpenSim.Tests.Common.Mock | |||
630 | { | 630 | { |
631 | } | 631 | } |
632 | 632 | ||
633 | public virtual void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID) | ||
634 | { | ||
635 | } | ||
636 | |||
637 | public virtual void SendDialog(string objectname, UUID objectID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels) | 633 | public virtual void SendDialog(string objectname, UUID objectID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels) |
638 | { | 634 | { |
639 | } | 635 | } |