aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/DotNetEngine
diff options
context:
space:
mode:
authorMelanie Thielker2009-04-12 02:42:05 +0000
committerMelanie Thielker2009-04-12 02:42:05 +0000
commitf6f3737fe8c2ee77d127fb26d1674590ca0ced37 (patch)
treefe572c36b559ffdfacaa0b95087221abfe572663 /OpenSim/Region/ScriptEngine/DotNetEngine
parentAdding a script event, changed(CHANGED_ANIMATION) (diff)
downloadopensim-SC_OLD-f6f3737fe8c2ee77d127fb26d1674590ca0ced37.zip
opensim-SC_OLD-f6f3737fe8c2ee77d127fb26d1674590ca0ced37.tar.gz
opensim-SC_OLD-f6f3737fe8c2ee77d127fb26d1674590ca0ced37.tar.bz2
opensim-SC_OLD-f6f3737fe8c2ee77d127fb26d1674590ca0ced37.tar.xz
Fix a regression where animations would only be sent if the avatar has
attachments. Convert base types to LSL types for event marshalling through IScriptModule to avoid parameter errors.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs38
1 files changed, 36 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
index c3b52df..23acc08 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
@@ -219,7 +219,24 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
219 219
220 public bool PostScriptEvent(UUID itemID, string name, Object[] p) 220 public bool PostScriptEvent(UUID itemID, string name, Object[] p)
221 { 221 {
222 return PostScriptEvent(itemID, new EventParams(name, p, new DetectParams[0])); 222 Object[] lsl_p = new Object[p.Length];
223 for (int i = 0; i < p.Length ; i++)
224 {
225 if (p[i] is int)
226 lsl_p[i] = new LSL_Types.LSLInteger((int)p[i]);
227 else if (p[i] is string)
228 lsl_p[i] = new LSL_Types.LSLString((string)p[i]);
229 else if (p[i] is Vector3)
230 lsl_p[i] = new LSL_Types.Vector3(((Vector3)p[i]).X, ((Vector3)p[i]).Y, ((Vector3)p[i]).Z);
231 else if (p[i] is Quaternion)
232 lsl_p[i] = new LSL_Types.Quaternion(((Quaternion)p[i]).X, ((Quaternion)p[i]).Y, ((Quaternion)p[i]).Z, ((Quaternion)p[i]).W);
233 else if (p[i] is float)
234 lsl_p[i] = new LSL_Types.LSLFloat((float)p[i]);
235 else
236 lsl_p[i] = p[i];
237 }
238
239 return PostScriptEvent(itemID, new EventParams(name, lsl_p, new DetectParams[0]));
223 } 240 }
224 241
225 public bool PostObjectEvent(UUID itemID, string name, Object[] p) 242 public bool PostObjectEvent(UUID itemID, string name, Object[] p)
@@ -228,7 +245,24 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
228 if (part == null) 245 if (part == null)
229 return false; 246 return false;
230 247
231 return PostObjectEvent(part.LocalId, new EventParams(name, p, new DetectParams[0])); 248 Object[] lsl_p = new Object[p.Length];
249 for (int i = 0; i < p.Length ; i++)
250 {
251 if (p[i] is int)
252 lsl_p[i] = new LSL_Types.LSLInteger((int)p[i]);
253 else if (p[i] is string)
254 lsl_p[i] = new LSL_Types.LSLString((string)p[i]);
255 else if (p[i] is Vector3)
256 lsl_p[i] = new LSL_Types.Vector3(((Vector3)p[i]).X, ((Vector3)p[i]).Y, ((Vector3)p[i]).Z);
257 else if (p[i] is Quaternion)
258 lsl_p[i] = new LSL_Types.Quaternion(((Quaternion)p[i]).X, ((Quaternion)p[i]).Y, ((Quaternion)p[i]).Z, ((Quaternion)p[i]).W);
259 else if (p[i] is float)
260 lsl_p[i] = new LSL_Types.LSLFloat((float)p[i]);
261 else
262 lsl_p[i] = p[i];
263 }
264
265 return PostObjectEvent(part.LocalId, new EventParams(name, lsl_p, new DetectParams[0]));
232 } 266 }
233 267
234 public DetectParams GetDetectParams(UUID itemID, int number) 268 public DetectParams GetDetectParams(UUID itemID, int number)