From f6f3737fe8c2ee77d127fb26d1674590ca0ced37 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 12 Apr 2009 02:42:05 +0000 Subject: 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. --- .../ScriptEngine/DotNetEngine/ScriptEngine.cs | 38 ++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine') 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 public bool PostScriptEvent(UUID itemID, string name, Object[] p) { - return PostScriptEvent(itemID, new EventParams(name, p, new DetectParams[0])); + Object[] lsl_p = new Object[p.Length]; + for (int i = 0; i < p.Length ; i++) + { + if (p[i] is int) + lsl_p[i] = new LSL_Types.LSLInteger((int)p[i]); + else if (p[i] is string) + lsl_p[i] = new LSL_Types.LSLString((string)p[i]); + else if (p[i] is Vector3) + lsl_p[i] = new LSL_Types.Vector3(((Vector3)p[i]).X, ((Vector3)p[i]).Y, ((Vector3)p[i]).Z); + else if (p[i] is Quaternion) + lsl_p[i] = new LSL_Types.Quaternion(((Quaternion)p[i]).X, ((Quaternion)p[i]).Y, ((Quaternion)p[i]).Z, ((Quaternion)p[i]).W); + else if (p[i] is float) + lsl_p[i] = new LSL_Types.LSLFloat((float)p[i]); + else + lsl_p[i] = p[i]; + } + + return PostScriptEvent(itemID, new EventParams(name, lsl_p, new DetectParams[0])); } public bool PostObjectEvent(UUID itemID, string name, Object[] p) @@ -228,7 +245,24 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine if (part == null) return false; - return PostObjectEvent(part.LocalId, new EventParams(name, p, new DetectParams[0])); + Object[] lsl_p = new Object[p.Length]; + for (int i = 0; i < p.Length ; i++) + { + if (p[i] is int) + lsl_p[i] = new LSL_Types.LSLInteger((int)p[i]); + else if (p[i] is string) + lsl_p[i] = new LSL_Types.LSLString((string)p[i]); + else if (p[i] is Vector3) + lsl_p[i] = new LSL_Types.Vector3(((Vector3)p[i]).X, ((Vector3)p[i]).Y, ((Vector3)p[i]).Z); + else if (p[i] is Quaternion) + lsl_p[i] = new LSL_Types.Quaternion(((Quaternion)p[i]).X, ((Quaternion)p[i]).Y, ((Quaternion)p[i]).Z, ((Quaternion)p[i]).W); + else if (p[i] is float) + lsl_p[i] = new LSL_Types.LSLFloat((float)p[i]); + else + lsl_p[i] = p[i]; + } + + return PostObjectEvent(part.LocalId, new EventParams(name, lsl_p, new DetectParams[0])); } public DetectParams GetDetectParams(UUID itemID, int number) -- cgit v1.1