aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs50
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs5
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs38
3 files changed, 48 insertions, 45 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index ce7d97c..fd6d64c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -5050,7 +5050,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5050 } 5050 }
5051 } 5051 }
5052 5052
5053 result.Add(src.Substring(start,length).Trim()); 5053 result.Add(new LSL_String(src.Substring(start,length).Trim()));
5054 5054
5055 return result; 5055 return result;
5056 } 5056 }
@@ -6900,7 +6900,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6900 // retain pathcurve 6900 // retain pathcurve
6901 shapeBlock.PathCurve = part.Shape.PathCurve; 6901 shapeBlock.PathCurve = part.Shape.PathCurve;
6902 6902
6903 part.Shape.SetSculptData((byte)type, sculptId); 6903 part.Shape.SetSculptProperties((byte)type, sculptId);
6904 part.Shape.SculptEntry = true; 6904 part.Shape.SculptEntry = true;
6905 part.UpdateShape(shapeBlock); 6905 part.UpdateShape(shapeBlock);
6906 } 6906 }
@@ -7391,7 +7391,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7391 UUID[] anims; 7391 UUID[] anims;
7392 anims = av.Animator.GetAnimationArray(); 7392 anims = av.Animator.GetAnimationArray();
7393 foreach (UUID foo in anims) 7393 foreach (UUID foo in anims)
7394 l.Add(foo.ToString()); 7394 l.Add(new LSL_Key(foo.ToString()));
7395 return l; 7395 return l;
7396 } 7396 }
7397 7397
@@ -7926,17 +7926,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7926 7926
7927 case (int)ScriptBaseClass.PRIM_TEXT: 7927 case (int)ScriptBaseClass.PRIM_TEXT:
7928 Color4 textColor = part.GetTextColor(); 7928 Color4 textColor = part.GetTextColor();
7929 res.Add(part.Text); 7929 res.Add(new LSL_String(part.Text));
7930 res.Add(new LSL_Vector(textColor.R, 7930 res.Add(new LSL_Vector(textColor.R,
7931 textColor.G, 7931 textColor.G,
7932 textColor.B)); 7932 textColor.B));
7933 res.Add(new LSL_Float(textColor.A)); 7933 res.Add(new LSL_Float(textColor.A));
7934 break; 7934 break;
7935 case (int)ScriptBaseClass.PRIM_NAME: 7935 case (int)ScriptBaseClass.PRIM_NAME:
7936 res.Add(part.Name); 7936 res.Add(new LSL_String(part.Name));
7937 break; 7937 break;
7938 case (int)ScriptBaseClass.PRIM_DESC: 7938 case (int)ScriptBaseClass.PRIM_DESC:
7939 res.Add(part.Description); 7939 res.Add(new LSL_String(part.Description));
7940 break; 7940 break;
7941 case (int)ScriptBaseClass.PRIM_ROT_LOCAL: 7941 case (int)ScriptBaseClass.PRIM_ROT_LOCAL:
7942 res.Add(new LSL_Rotation(part.RotationOffset.X, part.RotationOffset.Y, part.RotationOffset.Z, part.RotationOffset.W)); 7942 res.Add(new LSL_Rotation(part.RotationOffset.X, part.RotationOffset.Y, part.RotationOffset.Z, part.RotationOffset.W));
@@ -9895,8 +9895,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9895 { 9895 {
9896 foreach (KeyValuePair<UUID, int> detectedParams in land.GetLandObjectOwners()) 9896 foreach (KeyValuePair<UUID, int> detectedParams in land.GetLandObjectOwners())
9897 { 9897 {
9898 ret.Add(detectedParams.Key.ToString()); 9898 ret.Add(new LSL_String(detectedParams.Key.ToString()));
9899 ret.Add(detectedParams.Value); 9899 ret.Add(new LSL_Integer(detectedParams.Value));
9900 } 9900 }
9901 } 9901 }
9902 ScriptSleep(2000); 9902 ScriptSleep(2000);
@@ -9946,25 +9946,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9946 switch (o.ToString()) 9946 switch (o.ToString())
9947 { 9947 {
9948 case "0": 9948 case "0":
9949 ret = ret + new LSL_List(land.Name); 9949 ret.Add(new LSL_String(land.Name));
9950 break; 9950 break;
9951 case "1": 9951 case "1":
9952 ret = ret + new LSL_List(land.Description); 9952 ret.Add(new LSL_String(land.Description));
9953 break; 9953 break;
9954 case "2": 9954 case "2":
9955 ret = ret + new LSL_List(land.OwnerID.ToString()); 9955 ret.Add(new LSL_Key(land.OwnerID.ToString()));
9956 break; 9956 break;
9957 case "3": 9957 case "3":
9958 ret = ret + new LSL_List(land.GroupID.ToString()); 9958 ret.Add(new LSL_Key(land.GroupID.ToString()));
9959 break; 9959 break;
9960 case "4": 9960 case "4":
9961 ret = ret + new LSL_List(land.Area); 9961 ret.Add(new LSL_Integer(land.Area));
9962 break; 9962 break;
9963 case "5": 9963 case "5":
9964 ret = ret + new LSL_List(land.GlobalID); 9964 ret.Add(new LSL_Key(land.GlobalID.ToString()));
9965 break; 9965 break;
9966 default: 9966 default:
9967 ret = ret + new LSL_List(0); 9967 ret.Add(new LSL_Integer(0));
9968 break; 9968 break;
9969 } 9969 }
9970 } 9970 }
@@ -9996,10 +9996,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9996 switch (o.ToString()) 9996 switch (o.ToString())
9997 { 9997 {
9998 case "1": 9998 case "1":
9999 ret.Add(av.Firstname + " " + av.Lastname); 9999 ret.Add(new LSL_String(av.Firstname + " " + av.Lastname));
10000 break; 10000 break;
10001 case "2": 10001 case "2":
10002 ret.Add(""); 10002 ret.Add(new LSL_String(""));
10003 break; 10003 break;
10004 case "3": 10004 case "3":
10005 ret.Add(new LSL_Vector((double)av.AbsolutePosition.X, (double)av.AbsolutePosition.Y, (double)av.AbsolutePosition.Z)); 10005 ret.Add(new LSL_Vector((double)av.AbsolutePosition.X, (double)av.AbsolutePosition.Y, (double)av.AbsolutePosition.Z));
@@ -10011,13 +10011,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10011 ret.Add(new LSL_Vector(av.Velocity.X, av.Velocity.Y, av.Velocity.Z)); 10011 ret.Add(new LSL_Vector(av.Velocity.X, av.Velocity.Y, av.Velocity.Z));
10012 break; 10012 break;
10013 case "6": 10013 case "6":
10014 ret.Add(id); 10014 ret.Add(new LSL_String(id));
10015 break; 10015 break;
10016 case "7": 10016 case "7":
10017 ret.Add(UUID.Zero.ToString()); 10017 ret.Add(new LSL_String(UUID.Zero.ToString()));
10018 break; 10018 break;
10019 case "8": 10019 case "8":
10020 ret.Add(UUID.Zero.ToString()); 10020 ret.Add(new LSL_String(UUID.Zero.ToString()));
10021 break; 10021 break;
10022 } 10022 }
10023 } 10023 }
@@ -10031,10 +10031,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10031 switch (o.ToString()) 10031 switch (o.ToString())
10032 { 10032 {
10033 case "1": 10033 case "1":
10034 ret.Add(obj.Name); 10034 ret.Add(new LSL_String(obj.Name));
10035 break; 10035 break;
10036 case "2": 10036 case "2":
10037 ret.Add(obj.Description); 10037 ret.Add(new LSL_String(obj.Description));
10038 break; 10038 break;
10039 case "3": 10039 case "3":
10040 ret.Add(new LSL_Vector(obj.AbsolutePosition.X, obj.AbsolutePosition.Y, obj.AbsolutePosition.Z)); 10040 ret.Add(new LSL_Vector(obj.AbsolutePosition.X, obj.AbsolutePosition.Y, obj.AbsolutePosition.Z));
@@ -10046,13 +10046,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10046 ret.Add(new LSL_Vector(obj.Velocity.X, obj.Velocity.Y, obj.Velocity.Z)); 10046 ret.Add(new LSL_Vector(obj.Velocity.X, obj.Velocity.Y, obj.Velocity.Z));
10047 break; 10047 break;
10048 case "6": 10048 case "6":
10049 ret.Add(obj.OwnerID.ToString()); 10049 ret.Add(new LSL_String(obj.OwnerID.ToString()));
10050 break; 10050 break;
10051 case "7": 10051 case "7":
10052 ret.Add(obj.GroupID.ToString()); 10052 ret.Add(new LSL_String(obj.GroupID.ToString()));
10053 break; 10053 break;
10054 case "8": 10054 case "8":
10055 ret.Add(obj.CreatorID.ToString()); 10055 ret.Add(new LSL_String(obj.CreatorID.ToString()));
10056 break; 10056 break;
10057 } 10057 }
10058 } 10058 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
index 645566e..80daf5b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
@@ -130,7 +130,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
130 int idx = 0; 130 int idx = 0;
131 while (idx < rules.Length) 131 while (idx < rules.Length)
132 { 132 {
133 uint rule = (uint)rules.GetLSLIntegerItem(idx); 133 LSL_Integer ruleInt = rules.GetLSLIntegerItem(idx);
134 uint rule = (uint)ruleInt;
134 LSL_List toadd = new LSL_List(); 135 LSL_List toadd = new LSL_List();
135 136
136 switch (rule) 137 switch (rule)
@@ -247,7 +248,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
247 248
248 if (toadd.Length > 0) 249 if (toadd.Length > 0)
249 { 250 {
250 values.Add(rule); 251 values.Add(ruleInt);
251 values.Add(toadd.Data[0]); 252 values.Add(toadd.Data[0]);
252 } 253 }
253 idx++; 254 idx++;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 64931d0..b710229 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -38,7 +38,6 @@ using OpenSim;
38using OpenSim.Framework; 38using OpenSim.Framework;
39 39
40using OpenSim.Framework.Console; 40using OpenSim.Framework.Console;
41using OpenSim.Region.CoreModules.Avatar.NPC;
42using OpenSim.Region.Framework.Interfaces; 41using OpenSim.Region.Framework.Interfaces;
43using OpenSim.Region.Framework.Scenes; 42using OpenSim.Region.Framework.Scenes;
44using OpenSim.Region.ScriptEngine.Shared; 43using OpenSim.Region.ScriptEngine.Shared;
@@ -812,7 +811,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
812 World.ForEachScenePresence(delegate(ScenePresence sp) 811 World.ForEachScenePresence(delegate(ScenePresence sp)
813 { 812 {
814 if (!sp.IsChildAgent) 813 if (!sp.IsChildAgent)
815 result.Add(sp.Name); 814 result.Add(new LSL_String(sp.Name));
816 }); 815 });
817 return result; 816 return result;
818 } 817 }
@@ -970,7 +969,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
970 969
971 public string osDrawPolygon(string drawList, LSL_List x, LSL_List y) 970 public string osDrawPolygon(string drawList, LSL_List x, LSL_List y)
972 { 971 {
973 CheckThreatLevel(ThreatLevel.None, "osDrawFilledPolygon"); 972 CheckThreatLevel(ThreatLevel.None, "osDrawPolygon");
974 973
975 m_host.AddScriptLPS(1); 974 m_host.AddScriptLPS(1);
976 975
@@ -1241,7 +1240,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1241 return String.Empty; 1240 return String.Empty;
1242 } 1241 }
1243 1242
1244 public void osSetWindParam(string plugin, string param, float value) 1243 public void osSetWindParam(string plugin, string param, LSL_Float value)
1245 { 1244 {
1246 CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam"); 1245 CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam");
1247 m_host.AddScriptLPS(1); 1246 m_host.AddScriptLPS(1);
@@ -1251,13 +1250,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1251 { 1250 {
1252 try 1251 try
1253 { 1252 {
1254 module.WindParamSet(plugin, param, value); 1253 module.WindParamSet(plugin, param, (float)value);
1255 } 1254 }
1256 catch (Exception) { } 1255 catch (Exception) { }
1257 } 1256 }
1258 } 1257 }
1259 1258
1260 public float osGetWindParam(string plugin, string param) 1259 public LSL_Float osGetWindParam(string plugin, string param)
1261 { 1260 {
1262 CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam"); 1261 CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam");
1263 m_host.AddScriptLPS(1); 1262 m_host.AddScriptLPS(1);
@@ -1409,7 +1408,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1409 { 1408 {
1410 // What actually is the difference to the LL function? 1409 // What actually is the difference to the LL function?
1411 // 1410 //
1412 CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelMediaURL"); 1411 CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelSIPAddress");
1413 1412
1414 m_host.AddScriptLPS(1); 1413 m_host.AddScriptLPS(1);
1415 1414
@@ -1910,8 +1909,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1910 }; 1909 };
1911 1910
1912 return NotecardCache.GetLines(assetID); 1911 return NotecardCache.GetLines(assetID);
1913
1914
1915 } 1912 }
1916 1913
1917 public string osAvatarName2Key(string firstname, string lastname) 1914 public string osAvatarName2Key(string firstname, string lastname)
@@ -2025,16 +2022,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2025 // Find matches beginning at start position 2022 // Find matches beginning at start position
2026 Regex matcher = new Regex(pattern); 2023 Regex matcher = new Regex(pattern);
2027 Match match = matcher.Match(src, start); 2024 Match match = matcher.Match(src, start);
2028 if (match.Success) 2025 while (match.Success)
2029 { 2026 {
2030 foreach (System.Text.RegularExpressions.Group g in match.Groups) 2027 foreach (System.Text.RegularExpressions.Group g in match.Groups)
2031 { 2028 {
2032 if (g.Success) 2029 if (g.Success)
2033 { 2030 {
2034 result.Add(g.Value); 2031 result.Add(new LSL_String(g.Value));
2035 result.Add(g.Index); 2032 result.Add(new LSL_Integer(g.Index));
2036 } 2033 }
2037 } 2034 }
2035
2036 match = match.NextMatch();
2038 } 2037 }
2039 2038
2040 return result; 2039 return result;
@@ -2209,12 +2208,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2209 return (int)pws; 2208 return (int)pws;
2210 } 2209 }
2211 2210
2212 public void osSetSpeed(string UUID, float SpeedModifier) 2211 public void osSetSpeed(string UUID, LSL_Float SpeedModifier)
2213 { 2212 {
2214 CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); 2213 CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed");
2215 m_host.AddScriptLPS(1); 2214 m_host.AddScriptLPS(1);
2216 ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); 2215 ScenePresence avatar = World.GetScenePresence(new UUID(UUID));
2217 avatar.SpeedModifier = SpeedModifier; 2216 avatar.SpeedModifier = (float)SpeedModifier;
2218 } 2217 }
2219 2218
2220 public void osKickAvatar(string FirstName,string SurName,string alert) 2219 public void osKickAvatar(string FirstName,string SurName,string alert)
@@ -2295,14 +2294,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2295 { 2294 {
2296 CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams"); 2295 CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams");
2297 m_host.AddScriptLPS(1); 2296 m_host.AddScriptLPS(1);
2297 InitLSL();
2298 2298
2299 return m_LSL_Api.GetLinkPrimitiveParamsEx(prim, rules); 2299 return m_LSL_Api.GetLinkPrimitiveParamsEx(prim, rules);
2300 } 2300 }
2301 2301
2302 public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules) 2302 public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules)
2303 { 2303 {
2304 CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams"); 2304 CheckThreatLevel(ThreatLevel.High, "osSetPrimitiveParams");
2305 m_host.AddScriptLPS(1); 2305 m_host.AddScriptLPS(1);
2306 InitLSL();
2306 2307
2307 m_LSL_Api.SetPrimitiveParamsEx(prim, rules); 2308 m_LSL_Api.SetPrimitiveParamsEx(prim, rules);
2308 } 2309 }
@@ -2364,9 +2365,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2364 { 2365 {
2365 if (avatar.IsChildAgent == false) 2366 if (avatar.IsChildAgent == false)
2366 { 2367 {
2367 result.Add(avatar.UUID); 2368 result.Add(new LSL_String(avatar.UUID.ToString()));
2368 result.Add(avatar.AbsolutePosition); 2369 OpenMetaverse.Vector3 ap = avatar.AbsolutePosition;
2369 result.Add(avatar.Name); 2370 result.Add(new LSL_Vector(ap.X, ap.Y, ap.Z));
2371 result.Add(new LSL_String(avatar.Name));
2370 } 2372 }
2371 } 2373 }
2372 }); 2374 });