aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
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
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')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs38
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs38
2 files changed, 72 insertions, 4 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)
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index f47e57d..5317cf1 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -935,7 +935,24 @@ namespace OpenSim.Region.ScriptEngine.XEngine
935 935
936 public bool PostScriptEvent(UUID itemID, string name, Object[] p) 936 public bool PostScriptEvent(UUID itemID, string name, Object[] p)
937 { 937 {
938 return PostScriptEvent(itemID, new EventParams(name, p, new DetectParams[0])); 938 Object[] lsl_p = new Object[p.Length];
939 for (int i = 0; i < p.Length ; i++)
940 {
941 if (p[i] is int)
942 lsl_p[i] = new LSL_Types.LSLInteger((int)p[i]);
943 else if (p[i] is string)
944 lsl_p[i] = new LSL_Types.LSLString((string)p[i]);
945 else if (p[i] is Vector3)
946 lsl_p[i] = new LSL_Types.Vector3(((Vector3)p[i]).X, ((Vector3)p[i]).Y, ((Vector3)p[i]).Z);
947 else if (p[i] is Quaternion)
948 lsl_p[i] = new LSL_Types.Quaternion(((Quaternion)p[i]).X, ((Quaternion)p[i]).Y, ((Quaternion)p[i]).Z, ((Quaternion)p[i]).W);
949 else if (p[i] is float)
950 lsl_p[i] = new LSL_Types.LSLFloat((float)p[i]);
951 else
952 lsl_p[i] = p[i];
953 }
954
955 return PostScriptEvent(itemID, new EventParams(name, lsl_p, new DetectParams[0]));
939 } 956 }
940 957
941 public bool PostObjectEvent(UUID itemID, string name, Object[] p) 958 public bool PostObjectEvent(UUID itemID, string name, Object[] p)
@@ -944,7 +961,24 @@ namespace OpenSim.Region.ScriptEngine.XEngine
944 if (part == null) 961 if (part == null)
945 return false; 962 return false;
946 963
947 return PostObjectEvent(part.LocalId, new EventParams(name, p, new DetectParams[0])); 964 Object[] lsl_p = new Object[p.Length];
965 for (int i = 0; i < p.Length ; i++)
966 {
967 if (p[i] is int)
968 lsl_p[i] = new LSL_Types.LSLInteger((int)p[i]);
969 else if (p[i] is string)
970 lsl_p[i] = new LSL_Types.LSLString((string)p[i]);
971 else if (p[i] is Vector3)
972 lsl_p[i] = new LSL_Types.Vector3(((Vector3)p[i]).X, ((Vector3)p[i]).Y, ((Vector3)p[i]).Z);
973 else if (p[i] is Quaternion)
974 lsl_p[i] = new LSL_Types.Quaternion(((Quaternion)p[i]).X, ((Quaternion)p[i]).Y, ((Quaternion)p[i]).Z, ((Quaternion)p[i]).W);
975 else if (p[i] is float)
976 lsl_p[i] = new LSL_Types.LSLFloat((float)p[i]);
977 else
978 lsl_p[i] = p[i];
979 }
980
981 return PostObjectEvent(part.LocalId, new EventParams(name, lsl_p, new DetectParams[0]));
948 } 982 }
949 983
950 public Assembly OnAssemblyResolve(object sender, 984 public Assembly OnAssemblyResolve(object sender,