aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authordahlia2010-04-12 17:10:51 -0700
committerdahlia2010-04-12 17:10:51 -0700
commit3d0860ae616749518a40c6f6088d2644d589daf9 (patch)
tree0c4be75377265948201b742a342b078c4ece3609 /OpenSim/Region
parentminor - add some documentation to PrimitiveBaseShape constructor with OpenMet... (diff)
downloadopensim-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--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs34
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs31
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs1
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs1
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs1
6 files changed, 69 insertions, 0 deletions
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;