diff options
author | dahlia | 2010-04-12 17:10:51 -0700 |
---|---|---|
committer | dahlia | 2010-04-12 17:10:51 -0700 |
commit | 3d0860ae616749518a40c6f6088d2644d589daf9 (patch) | |
tree | 0c4be75377265948201b742a342b078c4ece3609 | |
parent | minor - add some documentation to PrimitiveBaseShape constructor with OpenMet... (diff) | |
download | opensim-SC-3d0860ae616749518a40c6f6088d2644d589daf9.zip opensim-SC-3d0860ae616749518a40c6f6088d2644d589daf9.tar.gz opensim-SC-3d0860ae616749518a40c6f6088d2644d589daf9.tar.bz2 opensim-SC-3d0860ae616749518a40c6f6088d2644d589daf9.tar.xz |
thanks lkalif for Mantis #4676 - a patch that adds support for inventory links
Signed-off-by: dahlia <dahliaTrimble@gmail.removeme.com>
Diffstat (limited to '')
-rw-r--r-- | CONTRIBUTORS.txt | 1 | ||||
-rw-r--r-- | OpenSim/Client/MXP/ClientStack/MXPClientView.cs | 1 | ||||
-rw-r--r-- | OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs | 1 | ||||
-rw-r--r-- | OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs | 1 | ||||
-rw-r--r-- | OpenSim/Framework/IClientAPI.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 34 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 31 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | 1 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestClient.cs | 1 |
12 files changed, 79 insertions, 0 deletions
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index e5c8cb9..9aadd70 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt | |||
@@ -88,6 +88,7 @@ what it is today. | |||
88 | * Kitto Flora | 88 | * Kitto Flora |
89 | * KittyLiu | 89 | * KittyLiu |
90 | * Kurt Taylor (IBM) | 90 | * Kurt Taylor (IBM) |
91 | * lkalif | ||
91 | * lulurun | 92 | * lulurun |
92 | * M.Igarashi | 93 | * M.Igarashi |
93 | * maimedleech | 94 | * maimedleech |
diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index 17bd795..1d6d4c1 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs | |||
@@ -642,6 +642,7 @@ namespace OpenSim.Client.MXP.ClientStack | |||
642 | public event Action<UUID> OnRemoveAvatar; | 642 | public event Action<UUID> OnRemoveAvatar; |
643 | public event ObjectPermissions OnObjectPermissions; | 643 | public event ObjectPermissions OnObjectPermissions; |
644 | public event CreateNewInventoryItem OnCreateNewInventoryItem; | 644 | public event CreateNewInventoryItem OnCreateNewInventoryItem; |
645 | public event LinkInventoryItem OnLinkInventoryItem; | ||
645 | public event CreateInventoryFolder OnCreateNewInventoryFolder; | 646 | public event CreateInventoryFolder OnCreateNewInventoryFolder; |
646 | public event UpdateInventoryFolder OnUpdateInventoryFolder; | 647 | public event UpdateInventoryFolder OnUpdateInventoryFolder; |
647 | public event MoveInventoryFolder OnMoveInventoryFolder; | 648 | public event MoveInventoryFolder OnMoveInventoryFolder; |
diff --git a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs index 4ecbaf9..43c64e9 100644 --- a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs +++ b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs | |||
@@ -288,6 +288,7 @@ namespace OpenSim.Client.Sirikata.ClientStack | |||
288 | public event Action<UUID> OnRemoveAvatar; | 288 | public event Action<UUID> OnRemoveAvatar; |
289 | public event ObjectPermissions OnObjectPermissions; | 289 | public event ObjectPermissions OnObjectPermissions; |
290 | public event CreateNewInventoryItem OnCreateNewInventoryItem; | 290 | public event CreateNewInventoryItem OnCreateNewInventoryItem; |
291 | public event LinkInventoryItem OnLinkInventoryItem; | ||
291 | public event CreateInventoryFolder OnCreateNewInventoryFolder; | 292 | public event CreateInventoryFolder OnCreateNewInventoryFolder; |
292 | public event UpdateInventoryFolder OnUpdateInventoryFolder; | 293 | public event UpdateInventoryFolder OnUpdateInventoryFolder; |
293 | public event MoveInventoryFolder OnMoveInventoryFolder; | 294 | public event MoveInventoryFolder OnMoveInventoryFolder; |
diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs index 1da746a..864b4f1 100644 --- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs +++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs | |||
@@ -291,6 +291,7 @@ namespace OpenSim.Client.VWoHTTP.ClientStack | |||
291 | public event Action<UUID> OnRemoveAvatar = delegate { }; | 291 | public event Action<UUID> OnRemoveAvatar = delegate { }; |
292 | public event ObjectPermissions OnObjectPermissions = delegate { }; | 292 | public event ObjectPermissions OnObjectPermissions = delegate { }; |
293 | public event CreateNewInventoryItem OnCreateNewInventoryItem = delegate { }; | 293 | public event CreateNewInventoryItem OnCreateNewInventoryItem = delegate { }; |
294 | public event LinkInventoryItem OnLinkInventoryItem = delegate { }; | ||
294 | public event CreateInventoryFolder OnCreateNewInventoryFolder = delegate { }; | 295 | public event CreateInventoryFolder OnCreateNewInventoryFolder = delegate { }; |
295 | public event UpdateInventoryFolder OnUpdateInventoryFolder = delegate { }; | 296 | public event UpdateInventoryFolder OnUpdateInventoryFolder = delegate { }; |
296 | public event MoveInventoryFolder OnMoveInventoryFolder = delegate { }; | 297 | public event MoveInventoryFolder OnMoveInventoryFolder = delegate { }; |
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 4577758..af88c4a 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -236,6 +236,10 @@ namespace OpenSim.Framework | |||
236 | IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name, | 236 | IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name, |
237 | sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask, int creationDate); | 237 | sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask, int creationDate); |
238 | 238 | ||
239 | public delegate void LinkInventoryItem( | ||
240 | IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name, | ||
241 | sbyte invType, sbyte type, UUID olditemID); | ||
242 | |||
239 | public delegate void FetchInventoryDescendents( | 243 | public delegate void FetchInventoryDescendents( |
240 | IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder); | 244 | IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder); |
241 | 245 | ||
@@ -930,6 +934,7 @@ namespace OpenSim.Framework | |||
930 | event ObjectPermissions OnObjectPermissions; | 934 | event ObjectPermissions OnObjectPermissions; |
931 | 935 | ||
932 | event CreateNewInventoryItem OnCreateNewInventoryItem; | 936 | event CreateNewInventoryItem OnCreateNewInventoryItem; |
937 | event LinkInventoryItem OnLinkInventoryItem; | ||
933 | event CreateInventoryFolder OnCreateNewInventoryFolder; | 938 | event CreateInventoryFolder OnCreateNewInventoryFolder; |
934 | event UpdateInventoryFolder OnUpdateInventoryFolder; | 939 | event UpdateInventoryFolder OnUpdateInventoryFolder; |
935 | event MoveInventoryFolder OnMoveInventoryFolder; | 940 | event MoveInventoryFolder OnMoveInventoryFolder; |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 51ab281..f0f3932 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -182,6 +182,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
182 | public event TeleportLocationRequest OnSetStartLocationRequest; | 182 | public event TeleportLocationRequest OnSetStartLocationRequest; |
183 | public event UpdateAvatarProperties OnUpdateAvatarProperties; | 183 | public event UpdateAvatarProperties OnUpdateAvatarProperties; |
184 | public event CreateNewInventoryItem OnCreateNewInventoryItem; | 184 | public event CreateNewInventoryItem OnCreateNewInventoryItem; |
185 | public event LinkInventoryItem OnLinkInventoryItem; | ||
185 | public event CreateInventoryFolder OnCreateNewInventoryFolder; | 186 | public event CreateInventoryFolder OnCreateNewInventoryFolder; |
186 | public event UpdateInventoryFolder OnUpdateInventoryFolder; | 187 | public event UpdateInventoryFolder OnUpdateInventoryFolder; |
187 | public event MoveInventoryFolder OnMoveInventoryFolder; | 188 | public event MoveInventoryFolder OnMoveInventoryFolder; |
@@ -4749,6 +4750,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4749 | AddLocalPacketHandler(PacketType.UpdateInventoryFolder, HandleUpdateInventoryFolder); | 4750 | AddLocalPacketHandler(PacketType.UpdateInventoryFolder, HandleUpdateInventoryFolder); |
4750 | AddLocalPacketHandler(PacketType.MoveInventoryFolder, HandleMoveInventoryFolder); | 4751 | AddLocalPacketHandler(PacketType.MoveInventoryFolder, HandleMoveInventoryFolder); |
4751 | AddLocalPacketHandler(PacketType.CreateInventoryItem, HandleCreateInventoryItem); | 4752 | AddLocalPacketHandler(PacketType.CreateInventoryItem, HandleCreateInventoryItem); |
4753 | AddLocalPacketHandler(PacketType.LinkInventoryItem, HandleLinkInventoryItem); | ||
4752 | AddLocalPacketHandler(PacketType.FetchInventory, HandleFetchInventory); | 4754 | AddLocalPacketHandler(PacketType.FetchInventory, HandleFetchInventory); |
4753 | AddLocalPacketHandler(PacketType.FetchInventoryDescendents, HandleFetchInventoryDescendents); | 4755 | AddLocalPacketHandler(PacketType.FetchInventoryDescendents, HandleFetchInventoryDescendents); |
4754 | AddLocalPacketHandler(PacketType.PurgeInventoryDescendents, HandlePurgeInventoryDescendents); | 4756 | AddLocalPacketHandler(PacketType.PurgeInventoryDescendents, HandlePurgeInventoryDescendents); |
@@ -7348,6 +7350,38 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7348 | return true; | 7350 | return true; |
7349 | } | 7351 | } |
7350 | 7352 | ||
7353 | private bool HandleLinkInventoryItem(IClientAPI sender, Packet Pack) | ||
7354 | { | ||
7355 | LinkInventoryItemPacket createLink = (LinkInventoryItemPacket)Pack; | ||
7356 | |||
7357 | #region Packet Session and User Check | ||
7358 | if (m_checkPackets) | ||
7359 | { | ||
7360 | if (createLink.AgentData.SessionID != SessionId || | ||
7361 | createLink.AgentData.AgentID != AgentId) | ||
7362 | return true; | ||
7363 | } | ||
7364 | #endregion | ||
7365 | |||
7366 | LinkInventoryItem linkInventoryItem = OnLinkInventoryItem; | ||
7367 | |||
7368 | if (linkInventoryItem != null) | ||
7369 | { | ||
7370 | linkInventoryItem( | ||
7371 | this, | ||
7372 | createLink.InventoryBlock.TransactionID, | ||
7373 | createLink.InventoryBlock.FolderID, | ||
7374 | createLink.InventoryBlock.CallbackID, | ||
7375 | Util.FieldToString(createLink.InventoryBlock.Description), | ||
7376 | Util.FieldToString(createLink.InventoryBlock.Name), | ||
7377 | createLink.InventoryBlock.InvType, | ||
7378 | createLink.InventoryBlock.Type, | ||
7379 | createLink.InventoryBlock.OldItemID); | ||
7380 | } | ||
7381 | |||
7382 | return true; | ||
7383 | } | ||
7384 | |||
7351 | private bool HandleFetchInventory(IClientAPI sender, Packet Pack) | 7385 | private bool HandleFetchInventory(IClientAPI sender, Packet Pack) |
7352 | { | 7386 | { |
7353 | if (OnFetchInventory != null) | 7387 | if (OnFetchInventory != null) |
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 8d27f9c..09611af 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -129,6 +129,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
129 | public event Action<UUID> OnRemoveAvatar; | 129 | public event Action<UUID> OnRemoveAvatar; |
130 | 130 | ||
131 | public event CreateNewInventoryItem OnCreateNewInventoryItem; | 131 | public event CreateNewInventoryItem OnCreateNewInventoryItem; |
132 | public event LinkInventoryItem OnLinkInventoryItem; | ||
132 | public event CreateInventoryFolder OnCreateNewInventoryFolder; | 133 | public event CreateInventoryFolder OnCreateNewInventoryFolder; |
133 | public event UpdateInventoryFolder OnUpdateInventoryFolder; | 134 | public event UpdateInventoryFolder OnUpdateInventoryFolder; |
134 | public event MoveInventoryFolder OnMoveInventoryFolder; | 135 | public event MoveInventoryFolder OnMoveInventoryFolder; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 3b7f38e..7c68ef4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -722,6 +722,37 @@ namespace OpenSim.Region.Framework.Scenes | |||
722 | } | 722 | } |
723 | } | 723 | } |
724 | 724 | ||
725 | private void HandleLinkInventoryItem(IClientAPI remoteClient, UUID transActionID, UUID folderID, | ||
726 | uint callbackID, string description, string name, | ||
727 | sbyte invType, sbyte type, UUID olditemID) | ||
728 | { | ||
729 | m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item link {0} in folder {1} pointing to {2}", name, folderID, olditemID); | ||
730 | |||
731 | if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) | ||
732 | return; | ||
733 | |||
734 | ScenePresence presence; | ||
735 | if (TryGetScenePresence(remoteClient.AgentId, out presence)) | ||
736 | { | ||
737 | byte[] data = null; | ||
738 | |||
739 | AssetBase asset = new AssetBase(); | ||
740 | asset.FullID = olditemID; | ||
741 | asset.Type = type; | ||
742 | asset.Name = name; | ||
743 | asset.Description = description; | ||
744 | |||
745 | CreateNewInventoryItem(remoteClient, remoteClient.AgentId.ToString(), folderID, name, 0, callbackID, asset, invType, (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, Util.UnixTimeSinceEpoch()); | ||
746 | |||
747 | } | ||
748 | else | ||
749 | { | ||
750 | m_log.ErrorFormat( | ||
751 | "ScenePresence for agent uuid {0} unexpectedly not found in HandleLinkInventoryItem", | ||
752 | remoteClient.AgentId); | ||
753 | } | ||
754 | } | ||
755 | |||
725 | /// <summary> | 756 | /// <summary> |
726 | /// Remove an inventory item for the client's inventory | 757 | /// Remove an inventory item for the client's inventory |
727 | /// </summary> | 758 | /// </summary> |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index fc915a3..685a678 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2749,6 +2749,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2749 | public virtual void SubscribeToClientInventoryEvents(IClientAPI client) | 2749 | public virtual void SubscribeToClientInventoryEvents(IClientAPI client) |
2750 | { | 2750 | { |
2751 | client.OnCreateNewInventoryItem += CreateNewInventoryItem; | 2751 | client.OnCreateNewInventoryItem += CreateNewInventoryItem; |
2752 | client.OnLinkInventoryItem += HandleLinkInventoryItem; | ||
2752 | client.OnCreateNewInventoryFolder += HandleCreateInventoryFolder; | 2753 | client.OnCreateNewInventoryFolder += HandleCreateInventoryFolder; |
2753 | client.OnUpdateInventoryFolder += HandleUpdateInventoryFolder; | 2754 | client.OnUpdateInventoryFolder += HandleUpdateInventoryFolder; |
2754 | client.OnMoveInventoryFolder += HandleMoveInventoryFolder; // 2; //!! | 2755 | client.OnMoveInventoryFolder += HandleMoveInventoryFolder; // 2; //!! |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index f5b148f..69e78b3 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -724,6 +724,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
724 | public event Action<UUID> OnRemoveAvatar; | 724 | public event Action<UUID> OnRemoveAvatar; |
725 | public event ObjectPermissions OnObjectPermissions; | 725 | public event ObjectPermissions OnObjectPermissions; |
726 | public event CreateNewInventoryItem OnCreateNewInventoryItem; | 726 | public event CreateNewInventoryItem OnCreateNewInventoryItem; |
727 | public event LinkInventoryItem OnLinkInventoryItem; | ||
727 | public event CreateInventoryFolder OnCreateNewInventoryFolder; | 728 | public event CreateInventoryFolder OnCreateNewInventoryFolder; |
728 | public event UpdateInventoryFolder OnUpdateInventoryFolder; | 729 | public event UpdateInventoryFolder OnUpdateInventoryFolder; |
729 | public event MoveInventoryFolder OnMoveInventoryFolder; | 730 | public event MoveInventoryFolder OnMoveInventoryFolder; |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 338c04b..6360c99 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -235,6 +235,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
235 | public event Action<UUID> OnRemoveAvatar; | 235 | public event Action<UUID> OnRemoveAvatar; |
236 | 236 | ||
237 | public event CreateNewInventoryItem OnCreateNewInventoryItem; | 237 | public event CreateNewInventoryItem OnCreateNewInventoryItem; |
238 | public event LinkInventoryItem OnLinkInventoryItem; | ||
238 | public event CreateInventoryFolder OnCreateNewInventoryFolder; | 239 | public event CreateInventoryFolder OnCreateNewInventoryFolder; |
239 | public event UpdateInventoryFolder OnUpdateInventoryFolder; | 240 | public event UpdateInventoryFolder OnUpdateInventoryFolder; |
240 | public event MoveInventoryFolder OnMoveInventoryFolder; | 241 | public event MoveInventoryFolder OnMoveInventoryFolder; |
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index f015db2..b07a072 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs | |||
@@ -141,6 +141,7 @@ namespace OpenSim.Tests.Common.Mock | |||
141 | public event Action<UUID> OnRemoveAvatar; | 141 | public event Action<UUID> OnRemoveAvatar; |
142 | 142 | ||
143 | public event CreateNewInventoryItem OnCreateNewInventoryItem; | 143 | public event CreateNewInventoryItem OnCreateNewInventoryItem; |
144 | public event LinkInventoryItem OnLinkInventoryItem; | ||
144 | public event CreateInventoryFolder OnCreateNewInventoryFolder; | 145 | public event CreateInventoryFolder OnCreateNewInventoryFolder; |
145 | public event UpdateInventoryFolder OnUpdateInventoryFolder; | 146 | public event UpdateInventoryFolder OnUpdateInventoryFolder; |
146 | public event MoveInventoryFolder OnMoveInventoryFolder; | 147 | public event MoveInventoryFolder OnMoveInventoryFolder; |