From 18362b25bf343749a1f10b09925e3c5b903ef865 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Fri, 2 May 2008 23:23:39 +0000 Subject: [PATCH] Thank you kindly, Melanie for a patch to solve llParticleSystem and osDynamicTexture issues. --- .../Common/LSL_BuiltIn_Commands.cs | 2 +- .../Region/ScriptEngine/Common/LSL_Types.cs | 77 ++++++++++--------- .../ScriptEngineBase/EventQueueThreadClass.cs | 14 +++- 3 files changed, 56 insertions(+), 37 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index ee5d52cfb0..a33fe0fd53 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -3989,7 +3989,7 @@ namespace OpenSim.Region.ScriptEngine.Common break; case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_PATTERN: - int tmpi = (int)rules.Data[i + 1]; + int tmpi = int.Parse(rules.Data[i + 1].ToString()); prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi; break; diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs index 5337d7ffab..edd16a79e3 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs @@ -704,6 +704,37 @@ namespace OpenSim.Region.ScriptEngine.Common } return ret; } + + private string ToSoup() + { + string output; + output = String.Empty; + if (m_data.Length == 0) + { + return String.Empty; + } + foreach (object o in m_data) + { + output = output + o.ToString(); + } + return output; + } + + public static explicit operator String(list l) + { + return l.ToSoup(); + } + + public static explicit operator LSLString(list l) + { + return new LSLString(l.ToSoup()); + } + + public override string ToString() + { + return ToSoup(); + } + #endregion #region Statistic Methods @@ -935,36 +966,6 @@ namespace OpenSim.Region.ScriptEngine.Common } } - public override string ToString() - { - string output; - output = String.Empty; - if (m_data.Length == 0) - { - return String.Empty; - } - foreach (object o in m_data) - { - output = output + o.ToString(); - } - return output; - - } - - public static explicit operator string(list l) - { - string output; - output = String.Empty; - if (l.m_data.Length == 0) - { - return String.Empty; - } - foreach (object o in l.m_data) - { - output = output + o.ToString(); - } - return output; - } } // @@ -1200,11 +1201,17 @@ namespace OpenSim.Region.ScriptEngine.Common } #endregion - static public implicit operator Int32(LSLInteger i) + + static public implicit operator int(LSLInteger i) { return i.value; } + static public implicit operator uint(LSLInteger i) + { + return (uint)i.value; + } + static public explicit operator LSLString(LSLInteger i) { return new LSLString(i.ToString()); @@ -1255,10 +1262,10 @@ namespace OpenSim.Region.ScriptEngine.Common return i; } - //static public implicit operator System.Double(LSLInteger i) - //{ - // return (double)i.value; - //} + static public implicit operator System.Double(LSLInteger i) + { + return (double)i.value; + } #region Overriders diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs index 30b3e8f724..1b1a5fa1dc 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs @@ -295,7 +295,19 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase if (e.InnerException != null) { // Send inner exception - text += e.InnerException.Message.ToString(); + string[] lines=e.InnerException.ToString().Replace("\r", "").Split('\n'); + int line=0; + foreach(string t in lines) + { + int idx=t.IndexOf("SecondLife.Script."); + if(idx != -1) + { + int colon=t.IndexOf(":"); + line=Convert.ToInt32(t.Substring(colon+1)); + break; + } + } + text += e.InnerException.Message.ToString()+" in line "+line.ToString(); } else {