From ed6165ab9cb0726ab4d41265b097faf1d12d15b4 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Tue, 7 Apr 2009 17:46:23 +0000 Subject: * Apply http://opensimulator.org/mantis/view.php?id=3227 * Implement "Add To Outfit" * Thanks FredoChaplin --- CONTRIBUTORS.txt | 1 + OpenSim/Client/MXP/ClientStack/MXPClientView.cs | 1 + OpenSim/Framework/IClientAPI.cs | 4 ++++ OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 13 +++++++++++++ OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | 1 + OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 10 ++++++++++ OpenSim/Region/Framework/Scenes/Scene.cs | 1 + OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | 1 + OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 9 files changed, 33 insertions(+) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 722360b..0217476 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -54,6 +54,7 @@ Patches * devalnor-#708 * dmiles (Daxtron Labs) * dslake (Intel) +* FredoChaplin * Gerhard * Godfrey * Grumly57 diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index 2284ab8..c29e895 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs @@ -572,6 +572,7 @@ namespace OpenSim.Client.MXP.ClientStack public event SetAppearance OnSetAppearance; public event AvatarNowWearing OnAvatarNowWearing; public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv; + public event RezMultipleAttachmentsFromInv OnRezMultipleAttachmentsFromInv; public event UUIDNameRequest OnDetachAttachmentIntoInv; public event ObjectAttach OnObjectAttach; public event ObjectDeselect OnObjectDetach; diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 2c153a9..1fa5ae2 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -53,6 +53,9 @@ namespace OpenSim.Framework public delegate UUID RezSingleAttachmentFromInv(IClientAPI remoteClient, UUID itemID, uint AttachmentPt); + public delegate void RezMultipleAttachmentsFromInv(IClientAPI remoteClient, RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header, + RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects); + public delegate void ObjectAttach( IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, bool silent); @@ -566,6 +569,7 @@ namespace OpenSim.Framework // [Obsolete("LLClientView Specific - Replace and rename OnAvatarUpdate. Difference from SetAppearance?")] event AvatarNowWearing OnAvatarNowWearing; event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv; + event RezMultipleAttachmentsFromInv OnRezMultipleAttachmentsFromInv; event UUIDNameRequest OnDetachAttachmentIntoInv; event ObjectAttach OnObjectAttach; event ObjectDeselect OnObjectDetach; diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 9b2f0ef..47f8344 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -142,6 +142,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP private SetAppearance handlerSetAppearance; //OnSetAppearance; private AvatarNowWearing handlerAvatarNowWearing; //OnAvatarNowWearing; private RezSingleAttachmentFromInv handlerRezSingleAttachment; //OnRezSingleAttachmentFromInv; + private RezMultipleAttachmentsFromInv handlerRezMultipleAttachments; //OnRezMultipleAttachmentsFromInv; private UUIDNameRequest handlerDetachAttachmentIntoInv; // Detach attachment! private ObjectAttach handlerObjectAttach; //OnObjectAttach; private SetAlwaysRun handlerSetAlwaysRun; //OnSetAlwaysRun; @@ -916,6 +917,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public event SetAppearance OnSetAppearance; public event AvatarNowWearing OnAvatarNowWearing; public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv; + public event RezMultipleAttachmentsFromInv OnRezMultipleAttachmentsFromInv; public event UUIDNameRequest OnDetachAttachmentIntoInv; public event ObjectAttach OnObjectAttach; public event ObjectDeselect OnObjectDetach; @@ -4717,6 +4719,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP break; + case PacketType.RezMultipleAttachmentsFromInv: + handlerRezMultipleAttachments = OnRezMultipleAttachmentsFromInv; + if (handlerRezMultipleAttachments != null) + { + RezMultipleAttachmentsFromInvPacket rez = (RezMultipleAttachmentsFromInvPacket)Pack; + handlerRezMultipleAttachments(this, rez.HeaderData, + rez.ObjectData); + } + + break; + case PacketType.DetachAttachmentIntoInv: handlerDetachAttachmentIntoInv = OnDetachAttachmentIntoInv; if (handlerDetachAttachmentIntoInv != null) diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index dc63b05..90ed9ae 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -63,6 +63,7 @@ namespace OpenSim.Region.Examples.SimpleModule public event SetAppearance OnSetAppearance; public event AvatarNowWearing OnAvatarNowWearing; public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv; + public event RezMultipleAttachmentsFromInv OnRezMultipleAttachmentsFromInv; public event UUIDNameRequest OnDetachAttachmentIntoInv; public event ObjectAttach OnObjectAttach; public event ObjectDeselect OnObjectDetach; diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 0be6b7f..11cee7c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -31,6 +31,7 @@ using System.Reflection; using System.Text; using System.Timers; using OpenMetaverse; +using OpenMetaverse.Packets; using log4net; using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; @@ -2563,6 +2564,15 @@ namespace OpenSim.Region.Framework.Scenes return att.UUID; } + public void RezMultipleAttachments(IClientAPI remoteClient, RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header, + RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects) + { + foreach (RezMultipleAttachmentsFromInvPacket.ObjectDataBlock obj in objects) + { + RezSingleAttachment(remoteClient, obj.ItemID, obj.AttachmentPt); + } + } + public void AttachObject(IClientAPI controllingClient, uint localID, uint attachPoint, Quaternion rot, Vector3 pos, bool silent) { m_sceneGraph.AttachObject(controllingClient, localID, attachPoint, rot, pos, silent); diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 0da819d..0991171 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1935,6 +1935,7 @@ namespace OpenSim.Region.Framework.Scenes client.OnDeRezObject += DeRezObject; client.OnRezObject += RezObject; client.OnRezSingleAttachmentFromInv += RezSingleAttachment; + client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachments; client.OnDetachAttachmentIntoInv += DetachSingleAttachmentToInv; client.OnObjectAttach += m_sceneGraph.AttachObject; client.OnObjectDetach += m_sceneGraph.DetachObject; diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 4de6793..644f429 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -169,6 +169,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC public event SetAppearance OnSetAppearance; public event AvatarNowWearing OnAvatarNowWearing; public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv; + public event RezMultipleAttachmentsFromInv OnRezMultipleAttachmentsFromInv; public event UUIDNameRequest OnDetachAttachmentIntoInv; public event ObjectAttach OnObjectAttach; public event ObjectDeselect OnObjectDetach; diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 33f080f..e82c26d 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -74,6 +74,7 @@ namespace OpenSim.Tests.Common.Mock public event SetAppearance OnSetAppearance; public event AvatarNowWearing OnAvatarNowWearing; public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv; + public event RezMultipleAttachmentsFromInv OnRezMultipleAttachmentsFromInv; public event UUIDNameRequest OnDetachAttachmentIntoInv; public event ObjectAttach OnObjectAttach; public event ObjectDeselect OnObjectDetach; -- cgit v1.1