diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 7ca779a..bce7d32 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Collections; | ||
30 | using System.Reflection; | 31 | using System.Reflection; |
31 | using System.Text; | 32 | using System.Text; |
32 | using System.Timers; | 33 | using System.Timers; |
@@ -215,13 +216,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
215 | /// <param name="primID">The prim which contains the item to update</param> | 216 | /// <param name="primID">The prim which contains the item to update</param> |
216 | /// <param name="isScriptRunning">Indicates whether the script to update is currently running</param> | 217 | /// <param name="isScriptRunning">Indicates whether the script to update is currently running</param> |
217 | /// <param name="data"></param> | 218 | /// <param name="data"></param> |
218 | public void CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, UUID itemId, | 219 | public ArrayList CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, UUID itemId, |
219 | UUID primId, bool isScriptRunning, byte[] data) | 220 | UUID primId, bool isScriptRunning, byte[] data) |
220 | { | 221 | { |
221 | if (!Permissions.CanEditScript(itemId, primId, remoteClient.AgentId)) | 222 | if (!Permissions.CanEditScript(itemId, primId, remoteClient.AgentId)) |
222 | { | 223 | { |
223 | remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false); | 224 | remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false); |
224 | return; | 225 | return new ArrayList(); |
225 | } | 226 | } |
226 | 227 | ||
227 | // Retrieve group | 228 | // Retrieve group |
@@ -234,7 +235,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
234 | "Prim inventory update requested for item ID {0} in prim ID {1} but this prim does not exist", | 235 | "Prim inventory update requested for item ID {0} in prim ID {1} but this prim does not exist", |
235 | itemId, primId); | 236 | itemId, primId); |
236 | 237 | ||
237 | return; | 238 | return new ArrayList(); |
238 | } | 239 | } |
239 | 240 | ||
240 | // Retrieve item | 241 | // Retrieve item |
@@ -247,7 +248,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
247 | + " but the item does not exist in this inventory", | 248 | + " but the item does not exist in this inventory", |
248 | itemId, part.Name, part.UUID); | 249 | itemId, part.Name, part.UUID); |
249 | 250 | ||
250 | return; | 251 | return new ArrayList(); |
251 | } | 252 | } |
252 | 253 | ||
253 | AssetBase asset = CreateAsset(item.Name, item.Description, (sbyte)AssetType.LSLText, data); | 254 | AssetBase asset = CreateAsset(item.Name, item.Description, (sbyte)AssetType.LSLText, data); |
@@ -264,29 +265,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
264 | part.GetProperties(remoteClient); | 265 | part.GetProperties(remoteClient); |
265 | 266 | ||
266 | // Trigger rerunning of script (use TriggerRezScript event, see RezScript) | 267 | // Trigger rerunning of script (use TriggerRezScript event, see RezScript) |
268 | ArrayList errors = new ArrayList(); | ||
269 | |||
267 | if (isScriptRunning) | 270 | if (isScriptRunning) |
268 | { | 271 | { |
269 | // Needs to determine which engine was running it and use that | 272 | // Needs to determine which engine was running it and use that |
270 | // | 273 | // |
271 | part.Inventory.CreateScriptInstance(item.ItemID, 0, false, DefaultScriptEngine, 0); | 274 | part.Inventory.CreateScriptInstance(item.ItemID, 0, false, DefaultScriptEngine, 0); |
275 | errors = part.Inventory.GetScriptErrors(item.ItemID); | ||
272 | } | 276 | } |
273 | else | 277 | else |
274 | { | 278 | { |
275 | remoteClient.SendAgentAlertMessage("Script saved", false); | 279 | remoteClient.SendAgentAlertMessage("Script saved", false); |
276 | } | 280 | } |
281 | return errors; | ||
277 | } | 282 | } |
278 | 283 | ||
279 | /// <summary> | 284 | /// <summary> |
280 | /// <see>CapsUpdateTaskInventoryScriptAsset(IClientAPI, UUID, UUID, bool, byte[])</see> | 285 | /// <see>CapsUpdateTaskInventoryScriptAsset(IClientAPI, UUID, UUID, bool, byte[])</see> |
281 | /// </summary> | 286 | /// </summary> |
282 | public void CapsUpdateTaskInventoryScriptAsset(UUID avatarId, UUID itemId, | 287 | public ArrayList CapsUpdateTaskInventoryScriptAsset(UUID avatarId, UUID itemId, |
283 | UUID primId, bool isScriptRunning, byte[] data) | 288 | UUID primId, bool isScriptRunning, byte[] data) |
284 | { | 289 | { |
285 | ScenePresence avatar; | 290 | ScenePresence avatar; |
286 | 291 | ||
287 | if (TryGetAvatar(avatarId, out avatar)) | 292 | if (TryGetAvatar(avatarId, out avatar)) |
288 | { | 293 | { |
289 | CapsUpdateTaskInventoryScriptAsset( | 294 | return CapsUpdateTaskInventoryScriptAsset( |
290 | avatar.ControllingClient, itemId, primId, isScriptRunning, data); | 295 | avatar.ControllingClient, itemId, primId, isScriptRunning, data); |
291 | } | 296 | } |
292 | else | 297 | else |
@@ -295,6 +300,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
295 | "[PRIM INVENTORY]: " + | 300 | "[PRIM INVENTORY]: " + |
296 | "Avatar {0} cannot be found to update its prim item asset", | 301 | "Avatar {0} cannot be found to update its prim item asset", |
297 | avatarId); | 302 | avatarId); |
303 | return new ArrayList(); | ||
298 | } | 304 | } |
299 | } | 305 | } |
300 | 306 | ||