aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorroot2009-12-22 06:25:32 +0100
committerMelanie2009-12-22 04:55:43 +0000
commit05e8b4e72c440e19c54fbcb17e2120834a27c3ab (patch)
tree70103466881cedae8c63de87b8747ccaba58f7a2 /OpenSim/Region/Framework/Scenes
parentGlue code for a couple of new LSL function implementations (diff)
downloadopensim-SC-05e8b4e72c440e19c54fbcb17e2120834a27c3ab.zip
opensim-SC-05e8b4e72c440e19c54fbcb17e2120834a27c3ab.tar.gz
opensim-SC-05e8b4e72c440e19c54fbcb17e2120834a27c3ab.tar.bz2
opensim-SC-05e8b4e72c440e19c54fbcb17e2120834a27c3ab.tar.xz
Add a data path for error messages
Committed from my other box where git is not configured properly Signed-off-by: Melanie <melanie@t-data.com>
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs22
2 files changed, 34 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 0b0c205..89ce4ae 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -27,6 +27,7 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Collections;
30using System.Reflection; 31using System.Reflection;
31using System.Text; 32using System.Text;
32using System.Timers; 33using 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
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index b98747a..eb7f5ff 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -29,6 +29,7 @@ using System;
29using System.Xml; 29using System.Xml;
30using System.IO; 30using System.IO;
31using System.Collections.Generic; 31using System.Collections.Generic;
32using System.Collections;
32using System.Reflection; 33using System.Reflection;
33using OpenMetaverse; 34using OpenMetaverse;
34using log4net; 35using log4net;
@@ -205,6 +206,27 @@ namespace OpenSim.Region.Framework.Scenes
205 } 206 }
206 } 207 }
207 208
209 public ArrayList GetScriptErrors(UUID itemID)
210 {
211 ArrayList ret = new ArrayList();
212
213 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
214 if (engines == null) // No engine at all
215 return ret;
216
217 foreach (IScriptModule e in engines)
218 {
219 if (e != null)
220 {
221 ArrayList errors = e.GetScriptErrors(itemID);
222 foreach (Object line in errors)
223 ret.Add(line);
224 }
225 }
226
227 return ret;
228 }
229
208 /// <summary> 230 /// <summary>
209 /// Stop all the scripts in this prim. 231 /// Stop all the scripts in this prim.
210 /// </summary> 232 /// </summary>