aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorDiva Canto2011-06-03 08:27:01 -0700
committerDiva Canto2011-06-03 08:27:01 -0700
commit76c60f1f99ca8aa7c1a336918aa0ef5f83b1ae04 (patch)
treeb5bcc10a80d6cd0515f1aa980563a0ce0cb0d70b /OpenSim/Region/Framework
parentHG IM: increase the timeout value (diff)
downloadopensim-SC-76c60f1f99ca8aa7c1a336918aa0ef5f83b1ae04.zip
opensim-SC-76c60f1f99ca8aa7c1a336918aa0ef5f83b1ae04.tar.gz
opensim-SC-76c60f1f99ca8aa7c1a336918aa0ef5f83b1ae04.tar.bz2
opensim-SC-76c60f1f99ca8aa7c1a336918aa0ef5f83b1ae04.tar.xz
Moved CreateNewInventoryItem to the InventoryAccessModule in preparation for supporting HG landmarks.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs74
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs4
2 files changed, 3 insertions, 75 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 3c47873..b70e1c3 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -778,7 +778,7 @@ namespace OpenSim.Region.Framework.Scenes
778 /// <param name="asset"></param> 778 /// <param name="asset"></param>
779 /// <param name="invType"></param> 779 /// <param name="invType"></param>
780 /// <param name="nextOwnerMask"></param> 780 /// <param name="nextOwnerMask"></param>
781 private void CreateNewInventoryItem(IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID, string name, uint flags, uint callbackID, 781 public void CreateNewInventoryItem(IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID, string name, uint flags, uint callbackID,
782 AssetBase asset, sbyte invType, uint nextOwnerMask, int creationDate) 782 AssetBase asset, sbyte invType, uint nextOwnerMask, int creationDate)
783 { 783 {
784 CreateNewInventoryItem( 784 CreateNewInventoryItem(
@@ -833,78 +833,6 @@ namespace OpenSim.Region.Framework.Scenes
833 } 833 }
834 834
835 /// <summary> 835 /// <summary>
836 /// Create a new inventory item. Called when the client creates a new item directly within their
837 /// inventory (e.g. by selecting a context inventory menu option).
838 /// </summary>
839 /// <param name="remoteClient"></param>
840 /// <param name="transactionID"></param>
841 /// <param name="folderID"></param>
842 /// <param name="callbackID"></param>
843 /// <param name="description"></param>
844 /// <param name="name"></param>
845 /// <param name="invType"></param>
846 /// <param name="type"></param>
847 /// <param name="wearableType"></param>
848 /// <param name="nextOwnerMask"></param>
849 public void CreateNewInventoryItem(IClientAPI remoteClient, UUID transactionID, UUID folderID,
850 uint callbackID, string description, string name, sbyte invType,
851 sbyte assetType,
852 byte wearableType, uint nextOwnerMask, int creationDate)
853 {
854 m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item {0} in folder {1}", name, folderID);
855
856 if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId))
857 return;
858
859 InventoryFolderBase f = new InventoryFolderBase(folderID, remoteClient.AgentId);
860 InventoryFolderBase folder = InventoryService.GetFolder(f);
861
862 if (folder == null || folder.Owner != remoteClient.AgentId)
863 return;
864
865 if (transactionID == UUID.Zero)
866 {
867 ScenePresence presence;
868 if (TryGetScenePresence(remoteClient.AgentId, out presence))
869 {
870 byte[] data = null;
871
872 if (invType == (sbyte)InventoryType.Landmark && presence != null)
873 {
874 Vector3 pos = presence.AbsolutePosition;
875 string strdata = String.Format(
876 "Landmark version 2\nregion_id {0}\nlocal_pos {1} {2} {3}\nregion_handle {4}\n",
877 presence.Scene.RegionInfo.RegionID,
878 pos.X, pos.Y, pos.Z,
879 presence.RegionHandle);
880 data = Encoding.ASCII.GetBytes(strdata);
881 }
882
883 AssetBase asset = CreateAsset(name, description, assetType, data, remoteClient.AgentId);
884 AssetService.Store(asset);
885
886 CreateNewInventoryItem(remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate);
887 }
888 else
889 {
890 m_log.ErrorFormat(
891 "ScenePresence for agent uuid {0} unexpectedly not found in CreateNewInventoryItem",
892 remoteClient.AgentId);
893 }
894 }
895 else
896 {
897 IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>();
898 if (agentTransactions != null)
899 {
900 agentTransactions.HandleItemCreationFromTransaction(
901 remoteClient, transactionID, folderID, callbackID, description,
902 name, invType, assetType, wearableType, nextOwnerMask);
903 }
904 }
905 }
906
907 /// <summary>
908 /// Link an inventory item to an existing item. 836 /// Link an inventory item to an existing item.
909 /// </summary> 837 /// </summary>
910 /// <remarks> 838 /// <remarks>
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 1d562fd..b179683 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2726,7 +2726,7 @@ namespace OpenSim.Region.Framework.Scenes
2726 2726
2727 public virtual void SubscribeToClientInventoryEvents(IClientAPI client) 2727 public virtual void SubscribeToClientInventoryEvents(IClientAPI client)
2728 { 2728 {
2729 client.OnCreateNewInventoryItem += CreateNewInventoryItem; 2729
2730 client.OnLinkInventoryItem += HandleLinkInventoryItem; 2730 client.OnLinkInventoryItem += HandleLinkInventoryItem;
2731 client.OnCreateNewInventoryFolder += HandleCreateInventoryFolder; 2731 client.OnCreateNewInventoryFolder += HandleCreateInventoryFolder;
2732 client.OnUpdateInventoryFolder += HandleUpdateInventoryFolder; 2732 client.OnUpdateInventoryFolder += HandleUpdateInventoryFolder;
@@ -2853,7 +2853,7 @@ namespace OpenSim.Region.Framework.Scenes
2853 2853
2854 public virtual void UnSubscribeToClientInventoryEvents(IClientAPI client) 2854 public virtual void UnSubscribeToClientInventoryEvents(IClientAPI client)
2855 { 2855 {
2856 client.OnCreateNewInventoryItem -= CreateNewInventoryItem; 2856
2857 client.OnCreateNewInventoryFolder -= HandleCreateInventoryFolder; 2857 client.OnCreateNewInventoryFolder -= HandleCreateInventoryFolder;
2858 client.OnUpdateInventoryFolder -= HandleUpdateInventoryFolder; 2858 client.OnUpdateInventoryFolder -= HandleUpdateInventoryFolder;
2859 client.OnMoveInventoryFolder -= HandleMoveInventoryFolder; // 2; //!! 2859 client.OnMoveInventoryFolder -= HandleMoveInventoryFolder; // 2; //!!