From 0eb4e85988627a76e5538fce617a1c53b1bc97b7 Mon Sep 17 00:00:00 2001 From: alondria Date: Fri, 1 Feb 2008 14:18:00 +0000 Subject: Thanks to Hashbox for a patch to: Implementing llStringTrim and hooking in osRegionNotice --- OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs | 16 +++++++++++++++- .../Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 8 ++++++++ .../Common/LSL_BuiltIn_Commands_Interface.cs | 3 ++- 3 files changed, 25 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs index 7073830..dd46fa4 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs @@ -1829,6 +1829,11 @@ namespace OpenSim.Region.ScriptEngine.Common return m_LSL_Functions.llGetParcelDetails(pos, param); } + public string llStringTrim(string src, int type) + { + return m_LSL_Functions.llStringTrim(src, type); + } + // // OpenSim Functions // @@ -1853,6 +1858,13 @@ namespace OpenSim.Region.ScriptEngine.Common return m_LSL_Functions.osRegionRestart(seconds); } + public void osRegionNotice(string msg) + { + m_LSL_Functions.osRegionNotice(msg); + } + + + // LSL CONSTANTS public const int TRUE = 1; public const int FALSE = 0; @@ -2165,7 +2177,9 @@ namespace OpenSim.Region.ScriptEngine.Common public const double DEG_TO_RAD = 0.01745329238f; public const double RAD_TO_DEG = 57.29578f; public const double SQRT2 = 1.414213538f; - + public const int STRING_TRIM_HEAD = 1; + public const int STRING_TRIM_TAIL = 2; + public const int STRING_TRIM = 3; // Can not be public const? public vector ZERO_VECTOR = new vector(0.0, 0.0, 0.0); public rotation ZERO_ROTATION = new rotation(0.0, 0, 0.0, 1.0); diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 9167632..91cddf1 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -3062,6 +3062,14 @@ namespace OpenSim.Region.ScriptEngine.Common return ret; } + public string llStringTrim(string src, int type) + { + if (type == (int)LSL_BaseClass.STRING_TRIM_HEAD) { return src.TrimStart(); } + if (type == (int)LSL_BaseClass.STRING_TRIM_TAIL) { return src.TrimEnd(); } + if (type == (int)LSL_BaseClass.STRING_TRIM) { return src.Trim(); } + return src; + } + // // OpenSim functions // diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs index 419398f..dbeeaf5 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs @@ -633,11 +633,12 @@ namespace OpenSim.Region.ScriptEngine.Common int llGetParcelMaxPrims(LSL_Types.Vector3 pos, int sim_wide); //wiki list llGetParcelDetails(vector pos, list params) LSL_Types.list llGetParcelDetails(LSL_Types.Vector3 pos, LSL_Types.list param); - + string llStringTrim(string src, int type); //OpenSim functions string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer); double osTerrainGetHeight(int x, int y); int osTerrainSetHeight(int x, int y, double val); int osRegionRestart(double seconds); + void osRegionNotice(string msg); } } \ No newline at end of file -- cgit v1.1