diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs | 98 |
1 files changed, 95 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs index b72d743..4d25b5d 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs | |||
@@ -60,6 +60,27 @@ namespace OpenSim.Region.Environment.Scenes | |||
60 | } | 60 | } |
61 | } | 61 | } |
62 | 62 | ||
63 | // /// Start a given script. | ||
64 | // /// </summary> | ||
65 | // /// <param name="localID"> | ||
66 | // /// A <see cref="System.UInt32"/> | ||
67 | // /// </param> | ||
68 | // public void StartScript(LLUUID partID, LLUUID itemID) | ||
69 | // { | ||
70 | // SceneObjectPart part = GetChildPart(partID); | ||
71 | // if (part != null) | ||
72 | // { | ||
73 | // part.StartScript(itemID); | ||
74 | // } | ||
75 | // else | ||
76 | // { | ||
77 | // MainLog.Instance.Error( | ||
78 | // "PRIMINVENTORY", | ||
79 | // "Couldn't find part {0} in object group {1}, {2} to start script with ID {3}", | ||
80 | // localID, Name, UUID, itemID); | ||
81 | // } | ||
82 | // } | ||
83 | |||
63 | /// <summary> | 84 | /// <summary> |
64 | /// Start the scripts contained in all the prims in this group. | 85 | /// Start the scripts contained in all the prims in this group. |
65 | /// </summary> | 86 | /// </summary> |
@@ -71,6 +92,27 @@ namespace OpenSim.Region.Environment.Scenes | |||
71 | } | 92 | } |
72 | } | 93 | } |
73 | 94 | ||
95 | /// Start a given script. | ||
96 | /// </summary> | ||
97 | /// <param name="localID"> | ||
98 | /// A <see cref="System.UInt32"/> | ||
99 | /// </param> | ||
100 | public void StopScript(uint partID, LLUUID itemID) | ||
101 | { | ||
102 | SceneObjectPart part = GetChildPart(partID); | ||
103 | if (part != null) | ||
104 | { | ||
105 | part.StopScript(itemID); | ||
106 | } | ||
107 | else | ||
108 | { | ||
109 | MainLog.Instance.Error( | ||
110 | "PRIMINVENTORY", | ||
111 | "Couldn't find part {0} in object group {1}, {2} to stop script with ID {3}", | ||
112 | partID, Name, UUID, itemID); | ||
113 | } | ||
114 | } | ||
115 | |||
74 | /// <summary> | 116 | /// <summary> |
75 | /// | 117 | /// |
76 | /// </summary> | 118 | /// </summary> |
@@ -156,13 +198,63 @@ namespace OpenSim.Region.Environment.Scenes | |||
156 | 198 | ||
157 | return false; | 199 | return false; |
158 | } | 200 | } |
201 | |||
202 | /// <summary> | ||
203 | /// Returns an existing inventory item. Returns the original, so any changes will be live. | ||
204 | /// </summary> | ||
205 | /// <param name="primID"></param> | ||
206 | /// <param name="itemID"></param> | ||
207 | /// <returns>null if the item does not exist</returns> | ||
208 | public TaskInventoryItem GetInventoryItem(uint primID, LLUUID itemID) | ||
209 | { | ||
210 | SceneObjectPart part = GetChildPart(primID); | ||
211 | if (part != null) | ||
212 | { | ||
213 | return part.GetInventoryItem(itemID); | ||
214 | } | ||
215 | else | ||
216 | { | ||
217 | MainLog.Instance.Error( | ||
218 | "PRIMINVENTORY", | ||
219 | "Couldn't find prim local ID {0} in prim {1}, {2} to get inventory item ID {3}", | ||
220 | primID, part.Name, part.UUID, itemID); | ||
221 | } | ||
222 | |||
223 | return null; | ||
224 | } | ||
225 | |||
226 | /// <summary> | ||
227 | /// Update an existing inventory item. | ||
228 | /// </summary> | ||
229 | /// <param name="item">The updated item. An item with the same id must already exist | ||
230 | /// in this prim's inventory</param> | ||
231 | /// <returns>false if the item did not exist, true if the update occurred succesfully</returns> | ||
232 | public bool UpdateInventoryItem(TaskInventoryItem item) | ||
233 | { | ||
234 | SceneObjectPart part = GetChildPart(item.ParentPartID); | ||
235 | if (part != null) | ||
236 | { | ||
237 | part.UpdateInventoryItem(item); | ||
238 | |||
239 | return true; | ||
240 | } | ||
241 | else | ||
242 | { | ||
243 | MainLog.Instance.Error( | ||
244 | "PRIMINVENTORY", | ||
245 | "Couldn't find prim ID {0} to update item {1}, {2}", | ||
246 | item.ParentPartID, item.name, item.item_id); | ||
247 | } | ||
248 | |||
249 | return false; | ||
250 | } | ||
159 | 251 | ||
160 | public int RemoveInventoryItem(IClientAPI remoteClient, uint localID, LLUUID itemID) | 252 | public int RemoveInventoryItem(uint localID, LLUUID itemID) |
161 | { | 253 | { |
162 | SceneObjectPart part = GetChildPart(localID); | 254 | SceneObjectPart part = GetChildPart(localID); |
163 | if (part != null) | 255 | if (part != null) |
164 | { | 256 | { |
165 | int type = part.RemoveInventoryItem(remoteClient, localID, itemID); | 257 | int type = part.RemoveInventoryItem(itemID); |
166 | 258 | ||
167 | // It might seem somewhat crude to update the whole group for a single prim inventory change, | 259 | // It might seem somewhat crude to update the whole group for a single prim inventory change, |
168 | // but it's possible that other prim inventory changes will take place before the region | 260 | // but it's possible that other prim inventory changes will take place before the region |
@@ -177,4 +269,4 @@ namespace OpenSim.Region.Environment.Scenes | |||
177 | return -1; | 269 | return -1; |
178 | } | 270 | } |
179 | } | 271 | } |
180 | } \ No newline at end of file | 272 | } |