diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 0674e62..7cedde0 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -92,25 +92,44 @@ namespace OpenSim.Region.Framework.Scenes | |||
92 | } | 92 | } |
93 | } | 93 | } |
94 | 94 | ||
95 | public void AddInventoryItem(UUID AgentID, InventoryItemBase item) | 95 | /// <summary> |
96 | /// Add the given inventory item to a user's inventory. | ||
97 | /// </summary> | ||
98 | /// <param name="item"></param> | ||
99 | public void AddInventoryItem(InventoryItemBase item) | ||
96 | { | 100 | { |
97 | if (InventoryService.AddItem(item)) | 101 | if (InventoryService.AddItem(item)) |
98 | { | 102 | { |
99 | int userlevel = 0; | 103 | int userlevel = 0; |
100 | if (Permissions.IsGod(AgentID)) | 104 | if (Permissions.IsGod(item.Owner)) |
101 | { | 105 | { |
102 | userlevel = 1; | 106 | userlevel = 1; |
103 | } | 107 | } |
104 | EventManager.TriggerOnNewInventoryItemUploadComplete(AgentID, item.AssetID, item.Name, userlevel); | 108 | EventManager.TriggerOnNewInventoryItemUploadComplete(item.Owner, item.AssetID, item.Name, userlevel); |
105 | } | 109 | } |
106 | else | 110 | else |
107 | { | 111 | { |
108 | m_log.WarnFormat( | 112 | m_log.WarnFormat( |
109 | "[AGENT INVENTORY]: Agent {0} could not add item {1} {2}", | 113 | "[AGENT INVENTORY]: Agent {0} could not add item {1} {2}", |
110 | AgentID, item.Name, item.ID); | 114 | item.Owner, item.Name, item.ID); |
111 | 115 | ||
112 | return; | 116 | return; |
113 | } | 117 | } |
118 | } | ||
119 | |||
120 | /// <summary> | ||
121 | /// Add the given inventory item to a user's inventory. | ||
122 | /// </summary> | ||
123 | /// <param name="AgentID"> | ||
124 | /// A <see cref="UUID"/> | ||
125 | /// </param> | ||
126 | /// <param name="item"> | ||
127 | /// A <see cref="InventoryItemBase"/> | ||
128 | /// </param> | ||
129 | [Obsolete("Use AddInventoryItem(InventoryItemBase item) instead. This was deprecated in OpenSim 0.7.1")] | ||
130 | public void AddInventoryItem(UUID AgentID, InventoryItemBase item) | ||
131 | { | ||
132 | AddInventoryItem(item); | ||
114 | } | 133 | } |
115 | 134 | ||
116 | /// <summary> | 135 | /// <summary> |
@@ -121,7 +140,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
121 | /// in which the item is to be placed.</param> | 140 | /// in which the item is to be placed.</param> |
122 | public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item) | 141 | public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item) |
123 | { | 142 | { |
124 | AddInventoryItem(remoteClient.AgentId, item); | 143 | AddInventoryItem(item); |
125 | remoteClient.SendInventoryItemCreateUpdate(item, 0); | 144 | remoteClient.SendInventoryItemCreateUpdate(item, 0); |
126 | } | 145 | } |
127 | 146 | ||
@@ -1108,7 +1127,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1108 | 1127 | ||
1109 | agentItem.Folder = folderId; | 1128 | agentItem.Folder = folderId; |
1110 | 1129 | ||
1111 | AddInventoryItem(avatarId, agentItem); | 1130 | AddInventoryItem(agentItem); |
1112 | 1131 | ||
1113 | return agentItem; | 1132 | return agentItem; |
1114 | } | 1133 | } |
@@ -1232,7 +1251,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1232 | { | 1251 | { |
1233 | agentItem.Folder = newFolderID; | 1252 | agentItem.Folder = newFolderID; |
1234 | 1253 | ||
1235 | AddInventoryItem(destID, agentItem); | 1254 | AddInventoryItem(agentItem); |
1236 | } | 1255 | } |
1237 | } | 1256 | } |
1238 | 1257 | ||