diff options
author | Charles Krinke | 2008-06-24 21:23:28 +0000 |
---|---|---|
committer | Charles Krinke | 2008-06-24 21:23:28 +0000 |
commit | dc0d089bf504aac293d669988e4b4bdb0e1355c0 (patch) | |
tree | 63591d3f2c49cf22c0605d7a7ace5a46dd7fef44 /OpenSim/Region/Environment | |
parent | * Applied patch from Melanie, mantis issue #1581 - "Refactor LSL language, ap... (diff) | |
download | opensim-SC_OLD-dc0d089bf504aac293d669988e4b4bdb0e1355c0.zip opensim-SC_OLD-dc0d089bf504aac293d669988e4b4bdb0e1355c0.tar.gz opensim-SC_OLD-dc0d089bf504aac293d669988e4b4bdb0e1355c0.tar.bz2 opensim-SC_OLD-dc0d089bf504aac293d669988e4b4bdb0e1355c0.tar.xz |
Mantis#5189. Thank you kindly, Matth for your patch
to add the beginnings of llGiveInventory().
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 114 |
1 files changed, 101 insertions, 13 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index e6bae4c..3580b99 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -869,21 +869,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
869 | /// </summary> | 869 | /// </summary> |
870 | /// <param name="remoteClient"></param> | 870 | /// <param name="remoteClient"></param> |
871 | /// <param name="folderID"></param> | 871 | /// <param name="folderID"></param> |
872 | /// <param name="primLocalID"></param> | 872 | /// <param name="part"></param> |
873 | /// <param name="itemID"></param> | 873 | /// <param name="itemID"></param> |
874 | public void MoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, uint primLocalId, LLUUID itemId) | 874 | public void MoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, SceneObjectPart part, LLUUID itemId) |
875 | { | 875 | { |
876 | SceneObjectPart part = GetSceneObjectPart(primLocalId); | ||
877 | |||
878 | if (null == part) | ||
879 | { | ||
880 | m_log.WarnFormat( | ||
881 | "[PRIM INVENTORY]: " + | ||
882 | "Move of inventory item {0} from prim with local id {1} failed because the prim could not be found", | ||
883 | itemId, primLocalId); | ||
884 | |||
885 | return; | ||
886 | } | ||
887 | 876 | ||
888 | TaskInventoryItem taskItem = part.GetInventoryItem(itemId); | 877 | TaskInventoryItem taskItem = part.GetInventoryItem(itemId); |
889 | 878 | ||
@@ -934,7 +923,106 @@ namespace OpenSim.Region.Environment.Scenes | |||
934 | } | 923 | } |
935 | 924 | ||
936 | } | 925 | } |
926 | |||
927 | /// <summary> | ||
928 | /// <see>MoveTaskInventoryItem</see> | ||
929 | /// </summary> | ||
930 | /// <param name="remoteClient"></param> | ||
931 | /// <param name="folderID"></param> | ||
932 | /// <param name="primLocalID"></param> | ||
933 | /// <param name="itemID"></param> | ||
934 | public void MoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, uint primLocalId, LLUUID itemId) | ||
935 | { | ||
936 | SceneObjectPart part = GetSceneObjectPart(primLocalId); | ||
937 | |||
938 | if (null == part) | ||
939 | { | ||
940 | m_log.WarnFormat( | ||
941 | "[PRIM INVENTORY]: " + | ||
942 | "Move of inventory item {0} from prim with local id {1} failed because the prim could not be found", | ||
943 | itemId, primLocalId); | ||
944 | |||
945 | return; | ||
946 | } | ||
947 | MoveTaskInventoryItem(remoteClient, folderId, part, itemId); | ||
948 | } | ||
949 | |||
950 | /// <summary> | ||
951 | /// <see>MoveTaskInventoryItem</see> | ||
952 | /// </summary> | ||
953 | /// <param name="remoteClient"></param> | ||
954 | /// <param name="folderID"></param> | ||
955 | /// <param name="part"></param> | ||
956 | /// <param name="itemID"></param> | ||
957 | public void MoveTaskInventoryItem(LLUUID avatarId, LLUUID folderId, SceneObjectPart part, LLUUID itemId) | ||
958 | { | ||
959 | ScenePresence avatar; | ||
937 | 960 | ||
961 | if (TryGetAvatar(avatarId, out avatar)) | ||
962 | { | ||
963 | MoveTaskInventoryItem(avatar.ControllingClient, folderId, part, itemId); | ||
964 | } | ||
965 | else | ||
966 | { | ||
967 | m_log.ErrorFormat( | ||
968 | "[PRIM INVENTORY]: " + | ||
969 | "Avatar {0} cannot be found to update its prim item asset", | ||
970 | avatarId); | ||
971 | } | ||
972 | } | ||
973 | |||
974 | /// <summary> | ||
975 | /// Copy a task (prim) inventory item to another task (prim) | ||
976 | /// </summary> | ||
977 | /// <param name="destId"></param> | ||
978 | /// <param name="part"></param> | ||
979 | /// <param name="itemId"></param> | ||
980 | public void CopyTaskInventoryItem(LLUUID destId, SceneObjectPart part, LLUUID itemId) | ||
981 | { | ||
982 | TaskInventoryItem srcTaskItem = part.GetInventoryItem(itemId); | ||
983 | |||
984 | if(srcTaskItem == null) | ||
985 | { | ||
986 | // error was already logged | ||
987 | return; | ||
988 | } | ||
989 | |||
990 | SceneObjectPart destPart = GetSceneObjectPart(destId); | ||
991 | |||
992 | if(destPart == null) | ||
993 | { | ||
994 | m_log.ErrorFormat( | ||
995 | "[PRIM INVENTORY]: " + | ||
996 | "Could not find prim for ID {0}", | ||
997 | destId); | ||
998 | return; | ||
999 | } | ||
1000 | |||
1001 | TaskInventoryItem destTaskItem = new TaskInventoryItem(); | ||
1002 | |||
1003 | destTaskItem.ItemID = LLUUID.Random(); | ||
1004 | destTaskItem.CreatorID = srcTaskItem.CreatorID; | ||
1005 | destTaskItem.AssetID = srcTaskItem.AssetID; | ||
1006 | destTaskItem.GroupID = srcTaskItem.GroupID; | ||
1007 | destTaskItem.OwnerID = srcTaskItem.OwnerID; | ||
1008 | destTaskItem.ParentID = srcTaskItem.ParentID; | ||
1009 | destTaskItem.ParentPartID = srcTaskItem.ParentPartID; | ||
1010 | |||
1011 | destTaskItem.BaseMask = srcTaskItem.BaseMask; | ||
1012 | destTaskItem.EveryoneMask = srcTaskItem.EveryoneMask; | ||
1013 | destTaskItem.GroupMask = srcTaskItem.GroupMask; | ||
1014 | destTaskItem.OwnerMask = srcTaskItem.OwnerMask; | ||
1015 | destTaskItem.Flags = srcTaskItem.Flags; | ||
1016 | |||
1017 | destTaskItem.Description = srcTaskItem.Description; | ||
1018 | destTaskItem.Name = srcTaskItem.Name; | ||
1019 | destTaskItem.InvType = srcTaskItem.InvType; | ||
1020 | destTaskItem.Type = srcTaskItem.Type; | ||
1021 | |||
1022 | destPart.AddInventoryItem(destTaskItem); | ||
1023 | |||
1024 | } | ||
1025 | |||
938 | /// <summary> | 1026 | /// <summary> |
939 | /// Update an item in a prim (task) inventory. | 1027 | /// Update an item in a prim (task) inventory. |
940 | /// This method does not handle scripts, <see>RezScript(IClientAPI, LLUUID, unit)</see> | 1028 | /// This method does not handle scripts, <see>RezScript(IClientAPI, LLUUID, unit)</see> |