aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
authorMelanie2010-10-23 00:20:18 +0200
committerMelanie2010-10-23 00:20:18 +0200
commit9fa915bdef9371ec5953f6ba6496b11bec5803a9 (patch)
tree7af2d700c41ea33993b9eafd1b9d1f7e62306ca5 /OpenSim/Region/ScriptEngine
parentPrevent database lookups on every avatar movement when land is set to group (diff)
parentChange some exception to use ToString(). e.Message is not sufficient to fix (diff)
downloadopensim-SC_OLD-9fa915bdef9371ec5953f6ba6496b11bec5803a9.zip
opensim-SC_OLD-9fa915bdef9371ec5953f6ba6496b11bec5803a9.tar.gz
opensim-SC_OLD-9fa915bdef9371ec5953f6ba6496b11bec5803a9.tar.bz2
opensim-SC_OLD-9fa915bdef9371ec5953f6ba6496b11bec5803a9.tar.xz
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs64
1 files changed, 42 insertions, 22 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..f55bd12 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)
@@ -7248,7 +7251,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7248 7251
7249 public void llSetLinkPrimitiveParamsFast(int linknumber, LSL_List rules) 7252 public void llSetLinkPrimitiveParamsFast(int linknumber, LSL_List rules)
7250 { 7253 {
7251 m_host.AddScriptLPS(1); 7254 m_host.AddScriptLPS(1);
7252 7255
7253 List<SceneObjectPart> parts = GetLinkParts(linknumber); 7256 List<SceneObjectPart> parts = GetLinkParts(linknumber);
7254 List<ScenePresence> avatars = GetLinkAvatars(linknumber); 7257 List<ScenePresence> avatars = GetLinkAvatars(linknumber);
@@ -7315,7 +7318,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7315 break; 7318 break;
7316 } 7319 }
7317 } 7320 }
7318
7319 } 7321 }
7320 7322
7321 protected void SetPrimParams(SceneObjectPart part, LSL_List rules) 7323 protected void SetPrimParams(SceneObjectPart part, LSL_List rules)
@@ -8965,17 +8967,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8965 * Convert separator and spacer lists to C# strings. 8967 * Convert separator and spacer lists to C# strings.
8966 * Also filter out null strings so we don't hang. 8968 * Also filter out null strings so we don't hang.
8967 */ 8969 */
8968 for (i = 0; i < seplen; i ++) { 8970 for (i = 0; i < seplen; i ++)
8971 {
8969 d = separray[i].ToString(); 8972 d = separray[i].ToString();
8970 if (d.Length > 0) { 8973 if (d.Length > 0)
8974 {
8971 delarray[dellen++] = d; 8975 delarray[dellen++] = d;
8972 } 8976 }
8973 } 8977 }
8974 seplen = dellen; 8978 seplen = dellen;
8975 8979
8976 for (i = 0; i < spclen; i ++) { 8980 for (i = 0; i < spclen; i ++)
8981 {
8977 d = spcarray[i].ToString(); 8982 d = spcarray[i].ToString();
8978 if (d.Length > 0) { 8983 if (d.Length > 0)
8984 {
8979 delarray[dellen++] = d; 8985 delarray[dellen++] = d;
8980 } 8986 }
8981 } 8987 }
@@ -8983,7 +8989,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8983 /* 8989 /*
8984 * Scan through source string from beginning to end. 8990 * Scan through source string from beginning to end.
8985 */ 8991 */
8986 for (i = 0;;) { 8992 for (i = 0;;)
8993 {
8987 8994
8988 /* 8995 /*
8989 * Find earliest delimeter in src starting at i (if any). 8996 * Find earliest delimeter in src starting at i (if any).
@@ -8991,13 +8998,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8991 int earliestDel = -1; 8998 int earliestDel = -1;
8992 int earliestSrc = srclen; 8999 int earliestSrc = srclen;
8993 string earliestStr = null; 9000 string earliestStr = null;
8994 for (j = 0; j < dellen; j ++) { 9001 for (j = 0; j < dellen; j ++)
9002 {
8995 d = delarray[j]; 9003 d = delarray[j];
8996 if (d != null) { 9004 if (d != null)
9005 {
8997 int index = src.IndexOf(d, i); 9006 int index = src.IndexOf(d, i);
8998 if (index < 0) { 9007 if (index < 0)
9008 {
8999 delarray[j] = null; // delim nowhere in src, don't check it anymore 9009 delarray[j] = null; // delim nowhere in src, don't check it anymore
9000 } else if (index < earliestSrc) { 9010 }
9011 else if (index < earliestSrc)
9012 {
9001 earliestSrc = index; // where delimeter starts in source string 9013 earliestSrc = index; // where delimeter starts in source string
9002 earliestDel = j; // where delimeter is in delarray[] 9014 earliestDel = j; // where delimeter is in delarray[]
9003 earliestStr = d; // the delimeter string from delarray[] 9015 earliestStr = d; // the delimeter string from delarray[]
@@ -9009,7 +9021,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9009 /* 9021 /*
9010 * Output source string starting at i through start of earliest delimeter. 9022 * Output source string starting at i through start of earliest delimeter.
9011 */ 9023 */
9012 if (keepNulls || (earliestSrc > i)) { 9024 if (keepNulls || (earliestSrc > i))
9025 {
9013 outarray[outlen++] = src.Substring(i, earliestSrc - i); 9026 outarray[outlen++] = src.Substring(i, earliestSrc - i);
9014 } 9027 }
9015 9028
@@ -9021,7 +9034,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9021 /* 9034 /*
9022 * If delimeter was a spacer, output the spacer. 9035 * If delimeter was a spacer, output the spacer.
9023 */ 9036 */
9024 if (earliestDel >= seplen) { 9037 if (earliestDel >= seplen)
9038 {
9025 outarray[outlen++] = earliestStr; 9039 outarray[outlen++] = earliestStr;
9026 } 9040 }
9027 9041
@@ -9035,7 +9049,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9035 * Make up an exact-sized output array suitable for an LSL_List object. 9049 * Make up an exact-sized output array suitable for an LSL_List object.
9036 */ 9050 */
9037 object[] outlist = new object[outlen]; 9051 object[] outlist = new object[outlen];
9038 for (i = 0; i < outlen; i ++) { 9052 for (i = 0; i < outlen; i ++)
9053 {
9039 outlist[i] = new LSL_String(outarray[i]); 9054 outlist[i] = new LSL_String(outarray[i]);
9040 } 9055 }
9041 return new LSL_List(outlist); 9056 return new LSL_List(outlist);
@@ -10002,12 +10017,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10002 10017
10003 SortedDictionary<int, float> parameters = new SortedDictionary<int, float>(); 10018 SortedDictionary<int, float> parameters = new SortedDictionary<int, float>();
10004 object[] data = rules.Data; 10019 object[] data = rules.Data;
10005 for (int i = 0; i < data.Length; ++i) { 10020 for (int i = 0; i < data.Length; ++i)
10021 {
10006 int type = Convert.ToInt32(data[i++].ToString()); 10022 int type = Convert.ToInt32(data[i++].ToString());
10007 if (i >= data.Length) break; // odd number of entries => ignore the last 10023 if (i >= data.Length) break; // odd number of entries => ignore the last
10008 10024
10009 // some special cases: Vector parameters are split into 3 float parameters (with type+1, type+2, type+3) 10025 // some special cases: Vector parameters are split into 3 float parameters (with type+1, type+2, type+3)
10010 switch (type) { 10026 switch (type)
10027 {
10011 case ScriptBaseClass.CAMERA_FOCUS: 10028 case ScriptBaseClass.CAMERA_FOCUS:
10012 case ScriptBaseClass.CAMERA_FOCUS_OFFSET: 10029 case ScriptBaseClass.CAMERA_FOCUS_OFFSET:
10013 case ScriptBaseClass.CAMERA_POSITION: 10030 case ScriptBaseClass.CAMERA_POSITION:
@@ -10213,12 +10230,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10213 Regex r = new Regex(authregex); 10230 Regex r = new Regex(authregex);
10214 int[] gnums = r.GetGroupNumbers(); 10231 int[] gnums = r.GetGroupNumbers();
10215 Match m = r.Match(url); 10232 Match m = r.Match(url);
10216 if (m.Success) { 10233 if (m.Success)
10217 for (int i = 1; i < gnums.Length; i++) { 10234 {
10235 for (int i = 1; i < gnums.Length; i++)
10236 {
10218 //System.Text.RegularExpressions.Group g = m.Groups[gnums[i]]; 10237 //System.Text.RegularExpressions.Group g = m.Groups[gnums[i]];
10219 //CaptureCollection cc = g.Captures; 10238 //CaptureCollection cc = g.Captures;
10220 } 10239 }
10221 if (m.Groups.Count == 5) { 10240 if (m.Groups.Count == 5)
10241 {
10222 httpHeaders["Authorization"] = String.Format("Basic {0}", Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(m.Groups[2].ToString() + ":" + m.Groups[3].ToString()))); 10242 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(); 10243 url = m.Groups[1].ToString() + m.Groups[4].ToString();
10224 } 10244 }