From ec8c93aa5e1d0af2c0adf38156b05e85421f4a81 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 4 Dec 2011 12:35:01 +0100 Subject: Implement ChangeInventoryItemFlagsPacket handling --- OpenSim/Framework/IClientAPI.cs | 2 ++ OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 16 ++++++++++++++++ .../InternetRelayClientView/Server/IRCClientView.cs | 1 + OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | 1 + OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 5 files changed, 21 insertions(+) diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 925998f..cda8a1b 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -503,6 +503,7 @@ namespace OpenSim.Framework public delegate void SimWideDeletesDelegate(IClientAPI client,UUID agentID, int flags, UUID targetID); public delegate void SendPostcard(IClientAPI client); + public delegate void ChangeInventoryItemFlags(IClientAPI client, UUID itemID, uint flags); #endregion @@ -1007,6 +1008,7 @@ namespace OpenSim.Framework event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; event SimWideDeletesDelegate OnSimWideDeletes; event SendPostcard OnSendPostcard; + event ChangeInventoryItemFlags OnChangeInventoryItemFlags; event MuteListEntryUpdate OnUpdateMuteListEntry; event MuteListEntryRemove OnRemoveMuteListEntry; event GodlikeMessage onGodlikeMessage; diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 3186dff..effa8d0 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -286,6 +286,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; public event SimWideDeletesDelegate OnSimWideDeletes; public event SendPostcard OnSendPostcard; + public event ChangeInventoryItemFlags OnChangeInventoryItemFlags; public event MuteListEntryUpdate OnUpdateMuteListEntry; public event MuteListEntryRemove OnRemoveMuteListEntry; public event GodlikeMessage onGodlikeMessage; @@ -5344,6 +5345,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP AddLocalPacketHandler(PacketType.GroupVoteHistoryRequest, HandleGroupVoteHistoryRequest); AddLocalPacketHandler(PacketType.SimWideDeletes, HandleSimWideDeletes); AddLocalPacketHandler(PacketType.SendPostcard, HandleSendPostcard); + AddLocalPacketHandler(PacketType.ChangeInventoryItemFlags, HandleChangeInventoryItemFlags); AddGenericPacketHandler("autopilot", HandleAutopilot); } @@ -9822,6 +9824,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP return false; } + private bool HandleChangeInventoryItemFlags(IClientAPI client, Packet packet) + { + ChangeInventoryItemFlagsPacket ChangeInventoryItemFlags = + (ChangeInventoryItemFlagsPacket)packet; + ChangeInventoryItemFlags handlerChangeInventoryItemFlags = OnChangeInventoryItemFlags; + if (handlerChangeInventoryItemFlags != null) + { + foreach(ChangeInventoryItemFlagsPacket.InventoryDataBlock b in ChangeInventoryItemFlags.InventoryData) + handlerChangeInventoryItemFlags(this, b.ItemID, b.Flags); + return true; + } + return false; + } + private bool HandleUseCircuitCode(IClientAPI sender, Packet Pack) { return true; diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 9fa243e..60d3c2d 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -860,6 +860,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; public event SimWideDeletesDelegate OnSimWideDeletes; public event SendPostcard OnSendPostcard; + public event ChangeInventoryItemFlags OnChangeInventoryItemFlags; public event MuteListEntryUpdate OnUpdateMuteListEntry; public event MuteListEntryRemove OnRemoveMuteListEntry; public event GodlikeMessage onGodlikeMessage; diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index a29ed21..2b60cc3 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -400,6 +400,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; public event SimWideDeletesDelegate OnSimWideDeletes; public event SendPostcard OnSendPostcard; + public event ChangeInventoryItemFlags OnChangeInventoryItemFlags; public event MuteListEntryUpdate OnUpdateMuteListEntry; public event MuteListEntryRemove OnRemoveMuteListEntry; public event GodlikeMessage onGodlikeMessage; diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index cedd6c7..1e74451 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -312,6 +312,7 @@ namespace OpenSim.Tests.Common.Mock public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; public event SimWideDeletesDelegate OnSimWideDeletes; public event SendPostcard OnSendPostcard; + public event ChangeInventoryItemFlags OnChangeInventoryItemFlags; public event MuteListEntryUpdate OnUpdateMuteListEntry; public event MuteListEntryRemove OnRemoveMuteListEntry; public event GodlikeMessage onGodlikeMessage; -- cgit v1.1