diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 61 |
1 files changed, 41 insertions, 20 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index e94790f..296a50e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3824,7 +3824,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3824 | 3824 | ||
3825 | if (targetPart != null) | 3825 | if (targetPart != null) |
3826 | { | 3826 | { |
3827 | if (parent != 0) { | 3827 | if (parent != 0) |
3828 | { | ||
3828 | parentPrim = m_host.ParentGroup; | 3829 | parentPrim = m_host.ParentGroup; |
3829 | childPrim = targetPart.ParentGroup; | 3830 | childPrim = targetPart.ParentGroup; |
3830 | } | 3831 | } |
@@ -5426,7 +5427,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5426 | } | 5427 | } |
5427 | } | 5428 | } |
5428 | } | 5429 | } |
5429 | else { | 5430 | else |
5431 | { | ||
5430 | object[] array = new object[src.Length]; | 5432 | object[] array = new object[src.Length]; |
5431 | Array.Copy(src.Data, 0, array, 0, src.Length); | 5433 | Array.Copy(src.Data, 0, array, 0, src.Length); |
5432 | result = new LSL_List(array); | 5434 | result = new LSL_List(array); |
@@ -6271,7 +6273,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6271 | SetParticleSystem(m_host, rules); | 6273 | SetParticleSystem(m_host, rules); |
6272 | } | 6274 | } |
6273 | 6275 | ||
6274 | private void SetParticleSystem(SceneObjectPart part, LSL_List rules) { | 6276 | private void SetParticleSystem(SceneObjectPart part, LSL_List rules) |
6277 | { | ||
6275 | 6278 | ||
6276 | 6279 | ||
6277 | if (rules.Length == 0) | 6280 | if (rules.Length == 0) |
@@ -8965,17 +8968,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8965 | * Convert separator and spacer lists to C# strings. | 8968 | * Convert separator and spacer lists to C# strings. |
8966 | * Also filter out null strings so we don't hang. | 8969 | * Also filter out null strings so we don't hang. |
8967 | */ | 8970 | */ |
8968 | for (i = 0; i < seplen; i ++) { | 8971 | for (i = 0; i < seplen; i ++) |
8972 | { | ||
8969 | d = separray[i].ToString(); | 8973 | d = separray[i].ToString(); |
8970 | if (d.Length > 0) { | 8974 | if (d.Length > 0) |
8975 | { | ||
8971 | delarray[dellen++] = d; | 8976 | delarray[dellen++] = d; |
8972 | } | 8977 | } |
8973 | } | 8978 | } |
8974 | seplen = dellen; | 8979 | seplen = dellen; |
8975 | 8980 | ||
8976 | for (i = 0; i < spclen; i ++) { | 8981 | for (i = 0; i < spclen; i ++) |
8982 | { | ||
8977 | d = spcarray[i].ToString(); | 8983 | d = spcarray[i].ToString(); |
8978 | if (d.Length > 0) { | 8984 | if (d.Length > 0) |
8985 | { | ||
8979 | delarray[dellen++] = d; | 8986 | delarray[dellen++] = d; |
8980 | } | 8987 | } |
8981 | } | 8988 | } |
@@ -8983,7 +8990,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8983 | /* | 8990 | /* |
8984 | * Scan through source string from beginning to end. | 8991 | * Scan through source string from beginning to end. |
8985 | */ | 8992 | */ |
8986 | for (i = 0;;) { | 8993 | for (i = 0;;) |
8994 | { | ||
8987 | 8995 | ||
8988 | /* | 8996 | /* |
8989 | * Find earliest delimeter in src starting at i (if any). | 8997 | * Find earliest delimeter in src starting at i (if any). |
@@ -8991,13 +8999,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8991 | int earliestDel = -1; | 8999 | int earliestDel = -1; |
8992 | int earliestSrc = srclen; | 9000 | int earliestSrc = srclen; |
8993 | string earliestStr = null; | 9001 | string earliestStr = null; |
8994 | for (j = 0; j < dellen; j ++) { | 9002 | for (j = 0; j < dellen; j ++) |
9003 | { | ||
8995 | d = delarray[j]; | 9004 | d = delarray[j]; |
8996 | if (d != null) { | 9005 | if (d != null) |
9006 | { | ||
8997 | int index = src.IndexOf(d, i); | 9007 | int index = src.IndexOf(d, i); |
8998 | if (index < 0) { | 9008 | if (index < 0) |
9009 | { | ||
8999 | delarray[j] = null; // delim nowhere in src, don't check it anymore | 9010 | delarray[j] = null; // delim nowhere in src, don't check it anymore |
9000 | } else if (index < earliestSrc) { | 9011 | } |
9012 | else if (index < earliestSrc) | ||
9013 | { | ||
9001 | earliestSrc = index; // where delimeter starts in source string | 9014 | earliestSrc = index; // where delimeter starts in source string |
9002 | earliestDel = j; // where delimeter is in delarray[] | 9015 | earliestDel = j; // where delimeter is in delarray[] |
9003 | earliestStr = d; // the delimeter string from delarray[] | 9016 | earliestStr = d; // the delimeter string from delarray[] |
@@ -9009,7 +9022,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9009 | /* | 9022 | /* |
9010 | * Output source string starting at i through start of earliest delimeter. | 9023 | * Output source string starting at i through start of earliest delimeter. |
9011 | */ | 9024 | */ |
9012 | if (keepNulls || (earliestSrc > i)) { | 9025 | if (keepNulls || (earliestSrc > i)) |
9026 | { | ||
9013 | outarray[outlen++] = src.Substring(i, earliestSrc - i); | 9027 | outarray[outlen++] = src.Substring(i, earliestSrc - i); |
9014 | } | 9028 | } |
9015 | 9029 | ||
@@ -9021,7 +9035,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9021 | /* | 9035 | /* |
9022 | * If delimeter was a spacer, output the spacer. | 9036 | * If delimeter was a spacer, output the spacer. |
9023 | */ | 9037 | */ |
9024 | if (earliestDel >= seplen) { | 9038 | if (earliestDel >= seplen) |
9039 | { | ||
9025 | outarray[outlen++] = earliestStr; | 9040 | outarray[outlen++] = earliestStr; |
9026 | } | 9041 | } |
9027 | 9042 | ||
@@ -9035,7 +9050,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9035 | * Make up an exact-sized output array suitable for an LSL_List object. | 9050 | * Make up an exact-sized output array suitable for an LSL_List object. |
9036 | */ | 9051 | */ |
9037 | object[] outlist = new object[outlen]; | 9052 | object[] outlist = new object[outlen]; |
9038 | for (i = 0; i < outlen; i ++) { | 9053 | for (i = 0; i < outlen; i ++) |
9054 | { | ||
9039 | outlist[i] = new LSL_String(outarray[i]); | 9055 | outlist[i] = new LSL_String(outarray[i]); |
9040 | } | 9056 | } |
9041 | return new LSL_List(outlist); | 9057 | return new LSL_List(outlist); |
@@ -10002,12 +10018,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10002 | 10018 | ||
10003 | SortedDictionary<int, float> parameters = new SortedDictionary<int, float>(); | 10019 | SortedDictionary<int, float> parameters = new SortedDictionary<int, float>(); |
10004 | object[] data = rules.Data; | 10020 | object[] data = rules.Data; |
10005 | for (int i = 0; i < data.Length; ++i) { | 10021 | for (int i = 0; i < data.Length; ++i) |
10022 | { | ||
10006 | int type = Convert.ToInt32(data[i++].ToString()); | 10023 | int type = Convert.ToInt32(data[i++].ToString()); |
10007 | if (i >= data.Length) break; // odd number of entries => ignore the last | 10024 | if (i >= data.Length) break; // odd number of entries => ignore the last |
10008 | 10025 | ||
10009 | // some special cases: Vector parameters are split into 3 float parameters (with type+1, type+2, type+3) | 10026 | // some special cases: Vector parameters are split into 3 float parameters (with type+1, type+2, type+3) |
10010 | switch (type) { | 10027 | switch (type) |
10028 | { | ||
10011 | case ScriptBaseClass.CAMERA_FOCUS: | 10029 | case ScriptBaseClass.CAMERA_FOCUS: |
10012 | case ScriptBaseClass.CAMERA_FOCUS_OFFSET: | 10030 | case ScriptBaseClass.CAMERA_FOCUS_OFFSET: |
10013 | case ScriptBaseClass.CAMERA_POSITION: | 10031 | case ScriptBaseClass.CAMERA_POSITION: |
@@ -10213,12 +10231,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10213 | Regex r = new Regex(authregex); | 10231 | Regex r = new Regex(authregex); |
10214 | int[] gnums = r.GetGroupNumbers(); | 10232 | int[] gnums = r.GetGroupNumbers(); |
10215 | Match m = r.Match(url); | 10233 | Match m = r.Match(url); |
10216 | if (m.Success) { | 10234 | if (m.Success) |
10217 | for (int i = 1; i < gnums.Length; i++) { | 10235 | { |
10236 | for (int i = 1; i < gnums.Length; i++) | ||
10237 | { | ||
10218 | //System.Text.RegularExpressions.Group g = m.Groups[gnums[i]]; | 10238 | //System.Text.RegularExpressions.Group g = m.Groups[gnums[i]]; |
10219 | //CaptureCollection cc = g.Captures; | 10239 | //CaptureCollection cc = g.Captures; |
10220 | } | 10240 | } |
10221 | if (m.Groups.Count == 5) { | 10241 | if (m.Groups.Count == 5) |
10242 | { | ||
10222 | httpHeaders["Authorization"] = String.Format("Basic {0}", Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(m.Groups[2].ToString() + ":" + m.Groups[3].ToString()))); | 10243 | httpHeaders["Authorization"] = String.Format("Basic {0}", Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(m.Groups[2].ToString() + ":" + m.Groups[3].ToString()))); |
10223 | url = m.Groups[1].ToString() + m.Groups[4].ToString(); | 10244 | url = m.Groups[1].ToString() + m.Groups[4].ToString(); |
10224 | } | 10245 | } |