aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs50
1 files changed, 48 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 4054369..8ef33d7 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -2039,9 +2039,55 @@ namespace OpenSim.Region.ScriptEngine.Common
2039 NotImplemented("llEjectFromLand"); 2039 NotImplemented("llEjectFromLand");
2040 } 2040 }
2041 2041
2042 public void llParseString2List() 2042 public LSL_Types.list llParseString2List(string str, LSL_Types.list separators, LSL_Types.list spacers)
2043 { 2043 {
2044 NotImplemented("llParseString2List"); 2044 LSL_Types.list ret = new LSL_Types.list();
2045 object[] delimeters = new object[separators.Length + spacers.Length];
2046 separators.Data.CopyTo(delimeters, 0);
2047 spacers.Data.CopyTo(delimeters, separators.Length);
2048 bool dfound = false;
2049 do
2050 {
2051 dfound = false;
2052 int cindex = -1;
2053 string cdeli = "";
2054 for (int i = 0; i < delimeters.Length; i++)
2055 {
2056 int index = str.IndexOf(delimeters[i].ToString());
2057 bool found = index != -1;
2058 if (found)
2059 {
2060 if ((cindex > index) || (cindex == -1))
2061 {
2062 cindex = index;
2063 cdeli = (string)delimeters[i];
2064 }
2065 dfound = dfound || found;
2066 }
2067 }
2068 if (cindex != -1)
2069 {
2070 if (cindex > 0)
2071 {
2072 ret.Add(str.Substring(0, cindex));
2073 if (spacers.Contains(cdeli))
2074 {
2075 ret.Add(cdeli);
2076 }
2077 }
2078 if (cindex == 0 && spacers.Contains(cdeli))
2079 {
2080 ret.Add(cdeli);
2081 }
2082 str = str.Substring(cindex + 1);
2083 }
2084 }
2085 while (dfound);
2086 if (str != "")
2087 {
2088 ret.Add(str);
2089 }
2090 return ret;
2045 } 2091 }
2046 2092
2047 public int llOverMyLand(string id) 2093 public int llOverMyLand(string id)