diff options
author | Jeff Ames | 2008-08-18 00:39:10 +0000 |
---|---|---|
committer | Jeff Ames | 2008-08-18 00:39:10 +0000 |
commit | 6ef9d4da901a346c232458317cca6268da888e2e (patch) | |
tree | dd1d935b10f34f261839da9f9879c02322e8ede7 /OpenSim/Region/ScriptEngine/Shared | |
parent | Update svn properties, minor formatting cleanup. (diff) | |
download | opensim-SC-6ef9d4da901a346c232458317cca6268da888e2e.zip opensim-SC-6ef9d4da901a346c232458317cca6268da888e2e.tar.gz opensim-SC-6ef9d4da901a346c232458317cca6268da888e2e.tar.bz2 opensim-SC-6ef9d4da901a346c232458317cca6268da888e2e.tar.xz |
Formatting cleanup.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
12 files changed, 185 insertions, 187 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9604828..4de207a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -348,23 +348,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
348 | a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting | 348 | a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting |
349 | vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis. | 349 | vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis. |
350 | */ | 350 | */ |
351 | 351 | ||
352 | /* How we arrived at this llEuler2Rot | 352 | /* How we arrived at this llEuler2Rot |
353 | * | 353 | * |
354 | * Experiment in SL to determine conventions: | 354 | * Experiment in SL to determine conventions: |
355 | * llEuler2Rot(<PI,0,0>)=<1,0,0,0> | 355 | * llEuler2Rot(<PI,0,0>)=<1,0,0,0> |
356 | * llEuler2Rot(<0,PI,0>)=<0,1,0,0> | 356 | * llEuler2Rot(<0,PI,0>)=<0,1,0,0> |
357 | * llEuler2Rot(<0,0,PI>)=<0,0,1,0> | 357 | * llEuler2Rot(<0,0,PI>)=<0,0,1,0> |
358 | * | 358 | * |
359 | * Important facts about Quaternions | 359 | * Important facts about Quaternions |
360 | * - multiplication is non-commutative (a*b != b*a) | 360 | * - multiplication is non-commutative (a*b != b*a) |
361 | * - http://en.wikipedia.org/wiki/Quaternion#Basis_multiplication | 361 | * - http://en.wikipedia.org/wiki/Quaternion#Basis_multiplication |
362 | * | 362 | * |
363 | * Above SL experiment gives (c1,c2,c3,s1,s2,s3 as defined in our llEuler2Rot): | 363 | * Above SL experiment gives (c1,c2,c3,s1,s2,s3 as defined in our llEuler2Rot): |
364 | * Qx = c1+i*s1 | 364 | * Qx = c1+i*s1 |
365 | * Qy = c2+j*s2; | 365 | * Qy = c2+j*s2; |
366 | * Qz = c3+k*s3; | 366 | * Qz = c3+k*s3; |
367 | * | 367 | * |
368 | * Rotations applied in order (from above) Z, Y, X | 368 | * Rotations applied in order (from above) Z, Y, X |
369 | * Q = (Qz * Qy) * Qx | 369 | * Q = (Qz * Qy) * Qx |
370 | * ((c1+i*s1)*(c2+j*s2))*(c3+k*s3) | 370 | * ((c1+i*s1)*(c2+j*s2))*(c3+k*s3) |
@@ -376,23 +376,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
376 | * y=j*(c1*s2*c3-s1*c2*s3) | 376 | * y=j*(c1*s2*c3-s1*c2*s3) |
377 | * z=k*(s1*s2*c3+c1*c2*s3) | 377 | * z=k*(s1*s2*c3+c1*c2*s3) |
378 | * s= c1*c2*c3-s1*s2*s3 | 378 | * s= c1*c2*c3-s1*s2*s3 |
379 | * | 379 | * |
380 | * This implementation agrees with the functions found here: | 380 | * This implementation agrees with the functions found here: |
381 | * http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions | 381 | * http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions |
382 | * And with the results in SL. | 382 | * And with the results in SL. |
383 | * | 383 | * |
384 | * It's also possible to calculate llEuler2Rot by direct multiplication of | 384 | * It's also possible to calculate llEuler2Rot by direct multiplication of |
385 | * the Qz, Qy, and Qx vectors (as above - and done in the "accurate" function | 385 | * the Qz, Qy, and Qx vectors (as above - and done in the "accurate" function |
386 | * from the wiki). | 386 | * from the wiki). |
387 | * Apparently in some cases this is better from a numerical precision perspective? | 387 | * Apparently in some cases this is better from a numerical precision perspective? |
388 | */ | 388 | */ |
389 | 389 | ||
390 | public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) | 390 | public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) |
391 | { | 391 | { |
392 | m_host.AddScriptLPS(1); | 392 | m_host.AddScriptLPS(1); |
393 | 393 | ||
394 | double x,y,z,s; | 394 | double x,y,z,s; |
395 | 395 | ||
396 | double c1 = Math.Cos(v.x/2.0); | 396 | double c1 = Math.Cos(v.x/2.0); |
397 | double c2 = Math.Cos(v.y/2.0); | 397 | double c2 = Math.Cos(v.y/2.0); |
398 | double c3 = Math.Cos(v.z/2.0); | 398 | double c3 = Math.Cos(v.z/2.0); |
@@ -404,7 +404,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
404 | y = c1*s2*c3-s1*c2*s3; | 404 | y = c1*s2*c3-s1*c2*s3; |
405 | z = s1*s2*c3+c1*c2*s3; | 405 | z = s1*s2*c3+c1*c2*s3; |
406 | s = c1*c2*c3-s1*s2*s3; | 406 | s = c1*c2*c3-s1*s2*s3; |
407 | 407 | ||
408 | return new LSL_Types.Quaternion(x, y, z, s); | 408 | return new LSL_Types.Quaternion(x, y, z, s); |
409 | } | 409 | } |
410 | 410 | ||
@@ -414,7 +414,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
414 | double x, y, z, s; | 414 | double x, y, z, s; |
415 | int f = 0; | 415 | int f = 0; |
416 | // Important Note: q1=<x,y,z,s> is equal to q2=<-x,-y,-z,-s> | 416 | // Important Note: q1=<x,y,z,s> is equal to q2=<-x,-y,-z,-s> |
417 | // Computing quaternion x,y,z,s values | 417 | // Computing quaternion x,y,z,s values |
418 | x = ((fwd.x - left.y - up.z + 1) / 4); | 418 | x = ((fwd.x - left.y - up.z + 1) / 4); |
419 | x *= x; | 419 | x *= x; |
420 | x = Math.Sqrt(Math.Sqrt(x)); | 420 | x = Math.Sqrt(Math.Sqrt(x)); |
@@ -428,7 +428,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
428 | s *= s; | 428 | s *= s; |
429 | s = Math.Sqrt(Math.Sqrt(s)); | 429 | s = Math.Sqrt(Math.Sqrt(s)); |
430 | 430 | ||
431 | // Set f for signs detection | 431 | // Set f for signs detection |
432 | if (fwd.y + left.x >= 0) { f += 1; } | 432 | if (fwd.y + left.x >= 0) { f += 1; } |
433 | if (fwd.z + up.x >= 0) { f += 2; } | 433 | if (fwd.z + up.x >= 0) { f += 2; } |
434 | if (left.z - up.y >= 0) { f += 4; } | 434 | if (left.z - up.y >= 0) { f += 4; } |
@@ -1013,9 +1013,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1013 | return; | 1013 | return; |
1014 | } | 1014 | } |
1015 | } | 1015 | } |
1016 | 1016 | ||
1017 | public void SetGlow(SceneObjectPart part, int face, float glow) | 1017 | public void SetGlow(SceneObjectPart part, int face, float glow) |
1018 | { | 1018 | { |
1019 | LLObject.TextureEntry tex = part.Shape.Textures; | 1019 | LLObject.TextureEntry tex = part.Shape.Textures; |
1020 | if (face > -1) | 1020 | if (face > -1) |
1021 | { | 1021 | { |
@@ -1023,7 +1023,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1023 | tex.FaceTextures[face].Glow = glow; | 1023 | tex.FaceTextures[face].Glow = glow; |
1024 | part.UpdateTexture(tex); | 1024 | part.UpdateTexture(tex); |
1025 | return; | 1025 | return; |
1026 | } | 1026 | } |
1027 | else if (face == -1) | 1027 | else if (face == -1) |
1028 | { | 1028 | { |
1029 | for (uint i = 0; i < 32; i++) | 1029 | for (uint i = 0; i < 32; i++) |
@@ -1038,15 +1038,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1038 | return; | 1038 | return; |
1039 | } | 1039 | } |
1040 | } | 1040 | } |
1041 | 1041 | ||
1042 | public void SetShiny(SceneObjectPart part, int face, int shiny, Bumpiness bump) | 1042 | public void SetShiny(SceneObjectPart part, int face, int shiny, Bumpiness bump) |
1043 | { | 1043 | { |
1044 | 1044 | ||
1045 | Shininess sval = new Shininess(); | 1045 | Shininess sval = new Shininess(); |
1046 | 1046 | ||
1047 | switch (shiny) | 1047 | switch (shiny) |
1048 | { | 1048 | { |
1049 | case 0: | 1049 | case 0: |
1050 | sval = Shininess.None; | 1050 | sval = Shininess.None; |
1051 | break; | 1051 | break; |
1052 | case 1: | 1052 | case 1: |
@@ -1062,7 +1062,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1062 | sval = Shininess.None; | 1062 | sval = Shininess.None; |
1063 | break; | 1063 | break; |
1064 | } | 1064 | } |
1065 | 1065 | ||
1066 | LLObject.TextureEntry tex = part.Shape.Textures; | 1066 | LLObject.TextureEntry tex = part.Shape.Textures; |
1067 | if (face > -1) | 1067 | if (face > -1) |
1068 | { | 1068 | { |
@@ -1070,8 +1070,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1070 | tex.FaceTextures[face].Shiny = sval; | 1070 | tex.FaceTextures[face].Shiny = sval; |
1071 | tex.FaceTextures[face].Bump = bump; | 1071 | tex.FaceTextures[face].Bump = bump; |
1072 | part.UpdateTexture(tex); | 1072 | part.UpdateTexture(tex); |
1073 | return; | 1073 | return; |
1074 | } | 1074 | } |
1075 | else if (face == -1) | 1075 | else if (face == -1) |
1076 | { | 1076 | { |
1077 | for (uint i = 0; i < 32; i++) | 1077 | for (uint i = 0; i < 32; i++) |
@@ -1088,8 +1088,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1088 | return; | 1088 | return; |
1089 | } | 1089 | } |
1090 | } | 1090 | } |
1091 | 1091 | ||
1092 | public void SetFullBright(SceneObjectPart part, int face, bool bright) | 1092 | public void SetFullBright(SceneObjectPart part, int face, bool bright) |
1093 | { | 1093 | { |
1094 | LLObject.TextureEntry tex = part.Shape.Textures; | 1094 | LLObject.TextureEntry tex = part.Shape.Textures; |
1095 | if (face > -1) | 1095 | if (face > -1) |
@@ -1106,14 +1106,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1106 | if (tex.FaceTextures[i] != null) | 1106 | if (tex.FaceTextures[i] != null) |
1107 | { | 1107 | { |
1108 | tex.FaceTextures[i].Fullbright = bright; | 1108 | tex.FaceTextures[i].Fullbright = bright; |
1109 | } | 1109 | } |
1110 | } | 1110 | } |
1111 | tex.DefaultTexture.Fullbright = bright; | 1111 | tex.DefaultTexture.Fullbright = bright; |
1112 | part.UpdateTexture(tex); | 1112 | part.UpdateTexture(tex); |
1113 | return; | 1113 | return; |
1114 | } | 1114 | } |
1115 | } | 1115 | } |
1116 | 1116 | ||
1117 | public double llGetAlpha(int face) | 1117 | public double llGetAlpha(int face) |
1118 | { | 1118 | { |
1119 | m_host.AddScriptLPS(1); | 1119 | m_host.AddScriptLPS(1); |
@@ -1169,7 +1169,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1169 | 1169 | ||
1170 | /// <summary> | 1170 | /// <summary> |
1171 | /// Set flexi parameters of a part. | 1171 | /// Set flexi parameters of a part. |
1172 | /// | 1172 | /// |
1173 | /// FIXME: Much of this code should probably be within the part itself. | 1173 | /// FIXME: Much of this code should probably be within the part itself. |
1174 | /// </summary> | 1174 | /// </summary> |
1175 | /// <param name="part"></param> | 1175 | /// <param name="part"></param> |
@@ -1179,7 +1179,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1179 | /// <param name="friction"></param> | 1179 | /// <param name="friction"></param> |
1180 | /// <param name="wind"></param> | 1180 | /// <param name="wind"></param> |
1181 | /// <param name="tension"></param> | 1181 | /// <param name="tension"></param> |
1182 | /// <param name="Force"></param> | 1182 | /// <param name="Force"></param> |
1183 | private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, | 1183 | private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, |
1184 | float wind, float tension, LSL_Types.Vector3 Force) | 1184 | float wind, float tension, LSL_Types.Vector3 Force) |
1185 | { | 1185 | { |
@@ -1230,7 +1230,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1230 | 1230 | ||
1231 | /// <summary> | 1231 | /// <summary> |
1232 | /// Set a light point on a part | 1232 | /// Set a light point on a part |
1233 | /// | 1233 | /// |
1234 | /// FIXME: Much of this code should probably be in SceneObjectGroup | 1234 | /// FIXME: Much of this code should probably be in SceneObjectGroup |
1235 | /// </summary> | 1235 | /// </summary> |
1236 | /// <param name="part"></param> | 1236 | /// <param name="part"></param> |
@@ -1238,7 +1238,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1238 | /// <param name="color"></param> | 1238 | /// <param name="color"></param> |
1239 | /// <param name="intensity"></param> | 1239 | /// <param name="intensity"></param> |
1240 | /// <param name="radius"></param> | 1240 | /// <param name="radius"></param> |
1241 | /// <param name="falloff"></param> | 1241 | /// <param name="falloff"></param> |
1242 | private void SetPointLight(SceneObjectPart part, bool light, LSL_Types.Vector3 color, float intensity, float radius, float falloff) | 1242 | private void SetPointLight(SceneObjectPart part, bool light, LSL_Types.Vector3 color, float intensity, float radius, float falloff) |
1243 | { | 1243 | { |
1244 | if (part == null) | 1244 | if (part == null) |
@@ -2880,13 +2880,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2880 | bool found = false; | 2880 | bool found = false; |
2881 | LLUUID destId = LLUUID.Zero; | 2881 | LLUUID destId = LLUUID.Zero; |
2882 | LLUUID objId = LLUUID.Zero; | 2882 | LLUUID objId = LLUUID.Zero; |
2883 | 2883 | ||
2884 | if (!LLUUID.TryParse(destination, out destId)) | 2884 | if (!LLUUID.TryParse(destination, out destId)) |
2885 | { | 2885 | { |
2886 | llSay(0, "Could not parse key " + destination); | 2886 | llSay(0, "Could not parse key " + destination); |
2887 | return; | 2887 | return; |
2888 | } | 2888 | } |
2889 | 2889 | ||
2890 | // move the first object found with this inventory name | 2890 | // move the first object found with this inventory name |
2891 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) | 2891 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) |
2892 | { | 2892 | { |
@@ -4451,7 +4451,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4451 | private Primitive.ParticleSystem getNewParticleSystemWithSLDefaultValues() | 4451 | private Primitive.ParticleSystem getNewParticleSystemWithSLDefaultValues() |
4452 | { | 4452 | { |
4453 | Primitive.ParticleSystem ps = new Primitive.ParticleSystem(); | 4453 | Primitive.ParticleSystem ps = new Primitive.ParticleSystem(); |
4454 | 4454 | ||
4455 | // TODO find out about the other defaults and add them here | 4455 | // TODO find out about the other defaults and add them here |
4456 | ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); | 4456 | ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); |
4457 | ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); | 4457 | ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); |
@@ -4465,7 +4465,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4465 | ps.PartMaxAge = 10.0f; | 4465 | ps.PartMaxAge = 10.0f; |
4466 | return ps; | 4466 | return ps; |
4467 | } | 4467 | } |
4468 | 4468 | ||
4469 | public void llParticleSystem(LSL_Types.list rules) | 4469 | public void llParticleSystem(LSL_Types.list rules) |
4470 | { | 4470 | { |
4471 | m_host.AddScriptLPS(1); | 4471 | m_host.AddScriptLPS(1); |
@@ -4660,7 +4660,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4660 | itemList.Add(itemID); | 4660 | itemList.Add(itemID); |
4661 | } | 4661 | } |
4662 | } | 4662 | } |
4663 | 4663 | ||
4664 | if (itemList.Count == 0) | 4664 | if (itemList.Count == 0) |
4665 | return; | 4665 | return; |
4666 | 4666 | ||
@@ -4936,11 +4936,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4936 | m_host.AddScriptLPS(1); | 4936 | m_host.AddScriptLPS(1); |
4937 | return Util.Md5Hash(src + ":" + nonce.ToString()); | 4937 | return Util.Md5Hash(src + ":" + nonce.ToString()); |
4938 | } | 4938 | } |
4939 | 4939 | ||
4940 | private ObjectShapePacket.ObjectDataBlock SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist) | 4940 | private ObjectShapePacket.ObjectDataBlock SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist) |
4941 | { | 4941 | { |
4942 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); | 4942 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); |
4943 | 4943 | ||
4944 | if (holeshape != (int)ScriptBaseClass.PRIM_HOLE_DEFAULT && | 4944 | if (holeshape != (int)ScriptBaseClass.PRIM_HOLE_DEFAULT && |
4945 | holeshape != (int)ScriptBaseClass.PRIM_HOLE_CIRCLE && | 4945 | holeshape != (int)ScriptBaseClass.PRIM_HOLE_CIRCLE && |
4946 | holeshape != (int)ScriptBaseClass.PRIM_HOLE_SQUARE && | 4946 | holeshape != (int)ScriptBaseClass.PRIM_HOLE_SQUARE && |
@@ -4998,23 +4998,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4998 | } | 4998 | } |
4999 | shapeBlock.PathTwistBegin = (sbyte)(200 * twist.x); | 4999 | shapeBlock.PathTwistBegin = (sbyte)(200 * twist.x); |
5000 | shapeBlock.PathTwist = (sbyte)(200 * twist.y); | 5000 | shapeBlock.PathTwist = (sbyte)(200 * twist.y); |
5001 | 5001 | ||
5002 | shapeBlock.ObjectLocalID = m_host.LocalId; | 5002 | shapeBlock.ObjectLocalID = m_host.LocalId; |
5003 | 5003 | ||
5004 | // retain pathcurve | 5004 | // retain pathcurve |
5005 | shapeBlock.PathCurve = m_host.Shape.PathCurve; | 5005 | shapeBlock.PathCurve = m_host.Shape.PathCurve; |
5006 | 5006 | ||
5007 | return shapeBlock; | 5007 | return shapeBlock; |
5008 | } | 5008 | } |
5009 | 5009 | ||
5010 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 taper_b, LSL_Types.Vector3 topshear, byte fudge) | 5010 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 taper_b, LSL_Types.Vector3 topshear, byte fudge) |
5011 | { | 5011 | { |
5012 | ObjectShapePacket.ObjectDataBlock shapeBlock; | 5012 | ObjectShapePacket.ObjectDataBlock shapeBlock; |
5013 | 5013 | ||
5014 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); | 5014 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); |
5015 | 5015 | ||
5016 | shapeBlock.ProfileCurve += fudge; | 5016 | shapeBlock.ProfileCurve += fudge; |
5017 | 5017 | ||
5018 | if (taper_b.x < 0f) | 5018 | if (taper_b.x < 0f) |
5019 | { | 5019 | { |
5020 | taper_b.x = 0f; | 5020 | taper_b.x = 0f; |
@@ -5051,25 +5051,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5051 | } | 5051 | } |
5052 | shapeBlock.PathShearX = (byte)(100 * topshear.x); | 5052 | shapeBlock.PathShearX = (byte)(100 * topshear.x); |
5053 | shapeBlock.PathShearY = (byte)(100 * topshear.y); | 5053 | shapeBlock.PathShearY = (byte)(100 * topshear.y); |
5054 | 5054 | ||
5055 | m_host.UpdateShape(shapeBlock); | 5055 | m_host.UpdateShape(shapeBlock); |
5056 | } | 5056 | } |
5057 | 5057 | ||
5058 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 dimple, byte fudge) | 5058 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 dimple, byte fudge) |
5059 | { | 5059 | { |
5060 | ObjectShapePacket.ObjectDataBlock shapeBlock; | 5060 | ObjectShapePacket.ObjectDataBlock shapeBlock; |
5061 | 5061 | ||
5062 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); | 5062 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); |
5063 | 5063 | ||
5064 | // profile/path swapped for a sphere | 5064 | // profile/path swapped for a sphere |
5065 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; | 5065 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; |
5066 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; | 5066 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; |
5067 | 5067 | ||
5068 | shapeBlock.ProfileCurve += fudge; | 5068 | shapeBlock.ProfileCurve += fudge; |
5069 | 5069 | ||
5070 | shapeBlock.PathScaleX = 100; | 5070 | shapeBlock.PathScaleX = 100; |
5071 | shapeBlock.PathScaleY = 100; | 5071 | shapeBlock.PathScaleY = 100; |
5072 | 5072 | ||
5073 | if (dimple.x < 0f) | 5073 | if (dimple.x < 0f) |
5074 | { | 5074 | { |
5075 | dimple.x = 0f; | 5075 | dimple.x = 0f; |
@@ -5092,22 +5092,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5092 | } | 5092 | } |
5093 | shapeBlock.ProfileBegin = (ushort)(50000 * dimple.x); | 5093 | shapeBlock.ProfileBegin = (ushort)(50000 * dimple.x); |
5094 | shapeBlock.ProfileEnd = (ushort)(50000 * (1 - dimple.y)); | 5094 | shapeBlock.ProfileEnd = (ushort)(50000 * (1 - dimple.y)); |
5095 | 5095 | ||
5096 | m_host.UpdateShape(shapeBlock); | 5096 | m_host.UpdateShape(shapeBlock); |
5097 | } | 5097 | } |
5098 | 5098 | ||
5099 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 holesize, LSL_Types.Vector3 topshear, LSL_Types.Vector3 profilecut, LSL_Types.Vector3 taper_a, float revolutions, float radiusoffset, float skew, byte fudge) | 5099 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 holesize, LSL_Types.Vector3 topshear, LSL_Types.Vector3 profilecut, LSL_Types.Vector3 taper_a, float revolutions, float radiusoffset, float skew, byte fudge) |
5100 | { | 5100 | { |
5101 | ObjectShapePacket.ObjectDataBlock shapeBlock; | 5101 | ObjectShapePacket.ObjectDataBlock shapeBlock; |
5102 | 5102 | ||
5103 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); | 5103 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); |
5104 | 5104 | ||
5105 | shapeBlock.ProfileCurve += fudge; | 5105 | shapeBlock.ProfileCurve += fudge; |
5106 | 5106 | ||
5107 | // profile/path swapped for a torrus, tube, ring | 5107 | // profile/path swapped for a torrus, tube, ring |
5108 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; | 5108 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; |
5109 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; | 5109 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; |
5110 | 5110 | ||
5111 | if (holesize.x < 0.05f) | 5111 | if (holesize.x < 0.05f) |
5112 | { | 5112 | { |
5113 | holesize.x = 0.05f; | 5113 | holesize.x = 0.05f; |
@@ -5212,15 +5212,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5212 | skew = 0.95f; | 5212 | skew = 0.95f; |
5213 | } | 5213 | } |
5214 | shapeBlock.PathSkew = (sbyte)(100 * skew); | 5214 | shapeBlock.PathSkew = (sbyte)(100 * skew); |
5215 | 5215 | ||
5216 | m_host.UpdateShape(shapeBlock); | 5216 | m_host.UpdateShape(shapeBlock); |
5217 | } | 5217 | } |
5218 | 5218 | ||
5219 | private void SetPrimitiveShapeParams(string map, int type) | 5219 | private void SetPrimitiveShapeParams(string map, int type) |
5220 | { | 5220 | { |
5221 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); | 5221 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); |
5222 | LLUUID sculptId; | 5222 | LLUUID sculptId; |
5223 | 5223 | ||
5224 | if (!LLUUID.TryParse(map, out sculptId)) | 5224 | if (!LLUUID.TryParse(map, out sculptId)) |
5225 | { | 5225 | { |
5226 | llSay(0, "Could not parse key " + map); | 5226 | llSay(0, "Could not parse key " + map); |
@@ -5230,7 +5230,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5230 | shapeBlock.ObjectLocalID = m_host.LocalId; | 5230 | shapeBlock.ObjectLocalID = m_host.LocalId; |
5231 | shapeBlock.PathScaleX = 100; | 5231 | shapeBlock.PathScaleX = 100; |
5232 | shapeBlock.PathScaleY = 150; | 5232 | shapeBlock.PathScaleY = 150; |
5233 | 5233 | ||
5234 | if (type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER && | 5234 | if (type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER && |
5235 | type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE && | 5235 | type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE && |
5236 | type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE && | 5236 | type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE && |
@@ -5239,7 +5239,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5239 | // default | 5239 | // default |
5240 | type = (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE; | 5240 | type = (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE; |
5241 | } | 5241 | } |
5242 | 5242 | ||
5243 | // retain pathcurve | 5243 | // retain pathcurve |
5244 | shapeBlock.PathCurve = m_host.Shape.PathCurve; | 5244 | shapeBlock.PathCurve = m_host.Shape.PathCurve; |
5245 | 5245 | ||
@@ -5256,7 +5256,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5256 | public void llSetLinkPrimitiveParams(int linknumber, LSL_Types.list rules) | 5256 | public void llSetLinkPrimitiveParams(int linknumber, LSL_Types.list rules) |
5257 | { | 5257 | { |
5258 | m_host.AddScriptLPS(1); | 5258 | m_host.AddScriptLPS(1); |
5259 | 5259 | ||
5260 | if (m_host.ParentGroup == null) | 5260 | if (m_host.ParentGroup == null) |
5261 | return; | 5261 | return; |
5262 | 5262 | ||
@@ -5302,13 +5302,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5302 | SetRot(part, q); | 5302 | SetRot(part, q); |
5303 | 5303 | ||
5304 | break; | 5304 | break; |
5305 | 5305 | ||
5306 | case (int)ScriptBaseClass.PRIM_TYPE: | 5306 | case (int)ScriptBaseClass.PRIM_TYPE: |
5307 | if (remain < 3) | 5307 | if (remain < 3) |
5308 | return; | 5308 | return; |
5309 | 5309 | ||
5310 | code = Convert.ToInt32(rules.Data[idx++]); | 5310 | code = Convert.ToInt32(rules.Data[idx++]); |
5311 | 5311 | ||
5312 | remain = rules.Length - idx; | 5312 | remain = rules.Length - idx; |
5313 | float hollow; | 5313 | float hollow; |
5314 | LSL_Types.Vector3 twist; | 5314 | LSL_Types.Vector3 twist; |
@@ -5319,9 +5319,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5319 | float skew; | 5319 | float skew; |
5320 | LSL_Types.Vector3 holesize; | 5320 | LSL_Types.Vector3 holesize; |
5321 | LSL_Types.Vector3 profilecut; | 5321 | LSL_Types.Vector3 profilecut; |
5322 | 5322 | ||
5323 | switch (code) | 5323 | switch (code) |
5324 | { | 5324 | { |
5325 | case (int)ScriptBaseClass.PRIM_TYPE_BOX: | 5325 | case (int)ScriptBaseClass.PRIM_TYPE_BOX: |
5326 | if (remain < 6) | 5326 | if (remain < 6) |
5327 | return; | 5327 | return; |
@@ -5335,7 +5335,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5335 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; | 5335 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; |
5336 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 1); | 5336 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 1); |
5337 | break; | 5337 | break; |
5338 | 5338 | ||
5339 | case (int)ScriptBaseClass.PRIM_TYPE_CYLINDER: | 5339 | case (int)ScriptBaseClass.PRIM_TYPE_CYLINDER: |
5340 | if (remain < 6) | 5340 | if (remain < 6) |
5341 | return; | 5341 | return; |
@@ -5350,12 +5350,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5350 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; | 5350 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; |
5351 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 0); | 5351 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 0); |
5352 | break; | 5352 | break; |
5353 | 5353 | ||
5354 | case (int)ScriptBaseClass.PRIM_TYPE_PRISM: | 5354 | case (int)ScriptBaseClass.PRIM_TYPE_PRISM: |
5355 | if (remain < 6) | 5355 | if (remain < 6) |
5356 | return; | 5356 | return; |
5357 | 5357 | ||
5358 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | 5358 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape |
5359 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5359 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut |
5360 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | 5360 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); |
5361 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5361 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
@@ -5377,12 +5377,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5377 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | 5377 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; |
5378 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, 5); | 5378 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, 5); |
5379 | break; | 5379 | break; |
5380 | 5380 | ||
5381 | case (int)ScriptBaseClass.PRIM_TYPE_TORUS: | 5381 | case (int)ScriptBaseClass.PRIM_TYPE_TORUS: |
5382 | if (remain < 11) | 5382 | if (remain < 11) |
5383 | return; | 5383 | return; |
5384 | 5384 | ||
5385 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | 5385 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape |
5386 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5386 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut |
5387 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | 5387 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); |
5388 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5388 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
@@ -5396,12 +5396,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5396 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | 5396 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; |
5397 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); | 5397 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); |
5398 | break; | 5398 | break; |
5399 | 5399 | ||
5400 | case (int)ScriptBaseClass.PRIM_TYPE_TUBE: | 5400 | case (int)ScriptBaseClass.PRIM_TYPE_TUBE: |
5401 | if (remain < 11) | 5401 | if (remain < 11) |
5402 | return; | 5402 | return; |
5403 | 5403 | ||
5404 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | 5404 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape |
5405 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5405 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut |
5406 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | 5406 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); |
5407 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5407 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
@@ -5415,12 +5415,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5415 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | 5415 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; |
5416 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); | 5416 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); |
5417 | break; | 5417 | break; |
5418 | 5418 | ||
5419 | case (int)ScriptBaseClass.PRIM_TYPE_RING: | 5419 | case (int)ScriptBaseClass.PRIM_TYPE_RING: |
5420 | if (remain < 11) | 5420 | if (remain < 11) |
5421 | return; | 5421 | return; |
5422 | 5422 | ||
5423 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | 5423 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape |
5424 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | 5424 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut |
5425 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | 5425 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); |
5426 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | 5426 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); |
@@ -5434,7 +5434,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5434 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | 5434 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; |
5435 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); | 5435 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); |
5436 | break; | 5436 | break; |
5437 | 5437 | ||
5438 | case (int)ScriptBaseClass.PRIM_TYPE_SCULPT: | 5438 | case (int)ScriptBaseClass.PRIM_TYPE_SCULPT: |
5439 | if (remain < 2) | 5439 | if (remain < 2) |
5440 | return; | 5440 | return; |
@@ -5445,7 +5445,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5445 | SetPrimitiveShapeParams(map, face); | 5445 | SetPrimitiveShapeParams(map, face); |
5446 | break; | 5446 | break; |
5447 | } | 5447 | } |
5448 | 5448 | ||
5449 | break; | 5449 | break; |
5450 | 5450 | ||
5451 | case (int)ScriptBaseClass.PRIM_TEXTURE: | 5451 | case (int)ScriptBaseClass.PRIM_TEXTURE: |
@@ -5509,31 +5509,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5509 | return; | 5509 | return; |
5510 | face = Convert.ToInt32(rules.Data[idx++]); | 5510 | face = Convert.ToInt32(rules.Data[idx++]); |
5511 | float glow = (float)Convert.ToDouble(rules.Data[idx++]); | 5511 | float glow = (float)Convert.ToDouble(rules.Data[idx++]); |
5512 | 5512 | ||
5513 | SetGlow(part, face, glow); | 5513 | SetGlow(part, face, glow); |
5514 | 5514 | ||
5515 | break; | 5515 | break; |
5516 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: | 5516 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: |
5517 | if (remain < 3) | 5517 | if (remain < 3) |
5518 | return; | 5518 | return; |
5519 | face = Convert.ToInt32(rules.Data[idx++]); | 5519 | face = Convert.ToInt32(rules.Data[idx++]); |
5520 | int shiny = Convert.ToInt32(rules.Data[idx++]); | 5520 | int shiny = Convert.ToInt32(rules.Data[idx++]); |
5521 | Bumpiness bump = (Bumpiness)Convert.ToByte(rules.Data[idx++]); | 5521 | Bumpiness bump = (Bumpiness)Convert.ToByte(rules.Data[idx++]); |
5522 | 5522 | ||
5523 | SetShiny(part, face, shiny, bump); | 5523 | SetShiny(part, face, shiny, bump); |
5524 | 5524 | ||
5525 | break; | 5525 | break; |
5526 | case (int)ScriptBaseClass.PRIM_FULLBRIGHT: | 5526 | case (int)ScriptBaseClass.PRIM_FULLBRIGHT: |
5527 | if (remain < 2) | 5527 | if (remain < 2) |
5528 | return; | 5528 | return; |
5529 | face = Convert.ToInt32(rules.Data[idx++]); | 5529 | face = Convert.ToInt32(rules.Data[idx++]); |
5530 | string bv = rules.Data[idx++].ToString(); | 5530 | string bv = rules.Data[idx++].ToString(); |
5531 | bool st; | 5531 | bool st; |
5532 | if (bv.Equals("1")) | 5532 | if (bv.Equals("1")) |
5533 | st = true; | 5533 | st = true; |
5534 | else | 5534 | else |
5535 | st = false; | 5535 | st = false; |
5536 | 5536 | ||
5537 | SetFullBright(part, face , st); | 5537 | SetFullBright(part, face , st); |
5538 | break; | 5538 | break; |
5539 | case (int)ScriptBaseClass.PRIM_MATERIAL: | 5539 | case (int)ScriptBaseClass.PRIM_MATERIAL: |
@@ -5552,29 +5552,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5552 | case (int)ScriptBaseClass.PRIM_PHANTOM: | 5552 | case (int)ScriptBaseClass.PRIM_PHANTOM: |
5553 | if (remain < 1) | 5553 | if (remain < 1) |
5554 | return; | 5554 | return; |
5555 | 5555 | ||
5556 | string ph = rules.Data[idx++].ToString(); | 5556 | string ph = rules.Data[idx++].ToString(); |
5557 | bool phantom; | 5557 | bool phantom; |
5558 | 5558 | ||
5559 | if (ph.Equals("1")) | 5559 | if (ph.Equals("1")) |
5560 | phantom = true; | 5560 | phantom = true; |
5561 | else | 5561 | else |
5562 | phantom = false; | 5562 | phantom = false; |
5563 | 5563 | ||
5564 | part.ScriptSetPhantomStatus(phantom); | 5564 | part.ScriptSetPhantomStatus(phantom); |
5565 | part.ScheduleFullUpdate(); | 5565 | part.ScheduleFullUpdate(); |
5566 | break; | 5566 | break; |
5567 | case (int)ScriptBaseClass.PRIM_PHYSICS: | 5567 | case (int)ScriptBaseClass.PRIM_PHYSICS: |
5568 | if (remain < 1) | 5568 | if (remain < 1) |
5569 | return; | 5569 | return; |
5570 | string phy = rules.Data[idx++].ToString(); | 5570 | string phy = rules.Data[idx++].ToString(); |
5571 | bool physics; | 5571 | bool physics; |
5572 | 5572 | ||
5573 | if (phy.Equals("1")) | 5573 | if (phy.Equals("1")) |
5574 | physics = true; | 5574 | physics = true; |
5575 | else | 5575 | else |
5576 | physics = false; | 5576 | physics = false; |
5577 | 5577 | ||
5578 | m_host.ScriptSetPhysicsStatus(physics); | 5578 | m_host.ScriptSetPhysicsStatus(physics); |
5579 | part.ScheduleFullUpdate(); | 5579 | part.ScheduleFullUpdate(); |
5580 | break; | 5580 | break; |
@@ -5645,7 +5645,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5645 | public LSL_Types.list llGetAnimationList( string id ) | 5645 | public LSL_Types.list llGetAnimationList( string id ) |
5646 | { | 5646 | { |
5647 | m_host.AddScriptLPS(1); | 5647 | m_host.AddScriptLPS(1); |
5648 | 5648 | ||
5649 | LSL_Types.list l = new LSL_Types.list(); | 5649 | LSL_Types.list l = new LSL_Types.list(); |
5650 | ScenePresence av = World.GetScenePresence(id); | 5650 | ScenePresence av = World.GetScenePresence(id); |
5651 | if (av == null) | 5651 | if (av == null) |
@@ -6758,7 +6758,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6758 | //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) | 6758 | //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) |
6759 | m_host.AddScriptLPS(1); | 6759 | m_host.AddScriptLPS(1); |
6760 | for (int i = 0; i < commandList.Data.Length; i++) | 6760 | for (int i = 0; i < commandList.Data.Length; i++) |
6761 | { | 6761 | { |
6762 | switch ((ParcelMediaCommandEnum)commandList.Data[i]) | 6762 | switch ((ParcelMediaCommandEnum)commandList.Data[i]) |
6763 | { | 6763 | { |
6764 | case ParcelMediaCommandEnum.Play: | 6764 | case ParcelMediaCommandEnum.Play: |
@@ -6768,7 +6768,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6768 | if (!agent.IsChildAgent) | 6768 | if (!agent.IsChildAgent) |
6769 | { | 6769 | { |
6770 | agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); | 6770 | agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); |
6771 | } | 6771 | } |
6772 | } | 6772 | } |
6773 | break; | 6773 | break; |
6774 | case ParcelMediaCommandEnum.Stop: | 6774 | case ParcelMediaCommandEnum.Stop: |
@@ -6799,7 +6799,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6799 | { | 6799 | { |
6800 | //Set the new media URL only if the user is the owner of the land | 6800 | //Set the new media URL only if the user is the owner of the land |
6801 | osSetParcelMediaURL(commandList.Data[i + 1].ToString()); | 6801 | osSetParcelMediaURL(commandList.Data[i + 1].ToString()); |
6802 | 6802 | ||
6803 | List<ScenePresence> scenePresenceList = World.GetScenePresences(); | 6803 | List<ScenePresence> scenePresenceList = World.GetScenePresences(); |
6804 | LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); | 6804 | LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); |
6805 | //Send an update of the mediaURL to all the clients that are in the parcel | 6805 | //Send an update of the mediaURL to all the clients that are in the parcel |
@@ -6810,8 +6810,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6810 | //Send parcel media update to the client | 6810 | //Send parcel media update to the client |
6811 | agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1); | 6811 | agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1); |
6812 | } | 6812 | } |
6813 | } | 6813 | } |
6814 | 6814 | ||
6815 | } | 6815 | } |
6816 | i++; | 6816 | i++; |
6817 | } | 6817 | } |
@@ -6821,7 +6821,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6821 | NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString()); | 6821 | NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString()); |
6822 | break; | 6822 | break; |
6823 | }//end switch | 6823 | }//end switch |
6824 | 6824 | ||
6825 | } | 6825 | } |
6826 | 6826 | ||
6827 | 6827 | ||
@@ -6864,7 +6864,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6864 | } | 6864 | } |
6865 | } | 6865 | } |
6866 | return list; | 6866 | return list; |
6867 | 6867 | ||
6868 | } | 6868 | } |
6869 | 6869 | ||
6870 | public LSL_Types.LSLInteger llModPow(int a, int b, int c) | 6870 | public LSL_Types.LSLInteger llModPow(int a, int b, int c) |
@@ -6908,7 +6908,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6908 | { | 6908 | { |
6909 | m_host.AddScriptLPS(1); | 6909 | m_host.AddScriptLPS(1); |
6910 | LLUUID invItemID=InventorySelf(); | 6910 | LLUUID invItemID=InventorySelf(); |
6911 | if (invItemID == LLUUID.Zero) | 6911 | if (invItemID == LLUUID.Zero) |
6912 | return new LSL_Types.Vector3(); | 6912 | return new LSL_Types.Vector3(); |
6913 | if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) | 6913 | if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) |
6914 | return new LSL_Types.Vector3(); | 6914 | return new LSL_Types.Vector3(); |
@@ -7036,8 +7036,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7036 | public void llSetCameraParams(LSL_Types.list rules) | 7036 | public void llSetCameraParams(LSL_Types.list rules) |
7037 | { | 7037 | { |
7038 | m_host.AddScriptLPS(1); | 7038 | m_host.AddScriptLPS(1); |
7039 | 7039 | ||
7040 | // our key in the object we are in | 7040 | // our key in the object we are in |
7041 | LLUUID invItemID=InventorySelf(); | 7041 | LLUUID invItemID=InventorySelf(); |
7042 | if (invItemID == LLUUID.Zero) return; | 7042 | if (invItemID == LLUUID.Zero) return; |
7043 | 7043 | ||
@@ -7051,10 +7051,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7051 | if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; | 7051 | if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; |
7052 | 7052 | ||
7053 | ScenePresence presence = World.GetScenePresence(agentID); | 7053 | ScenePresence presence = World.GetScenePresence(agentID); |
7054 | 7054 | ||
7055 | // we are not interested in child-agents | 7055 | // we are not interested in child-agents |
7056 | if (presence.IsChildAgent) return; | 7056 | if (presence.IsChildAgent) return; |
7057 | 7057 | ||
7058 | SortedDictionary<int, float> parameters = new SortedDictionary<int, float>(); | 7058 | SortedDictionary<int, float> parameters = new SortedDictionary<int, float>(); |
7059 | object[] data = rules.Data; | 7059 | object[] data = rules.Data; |
7060 | for (int i = 0; i < data.Length; ++i) { | 7060 | for (int i = 0; i < data.Length; ++i) { |
@@ -7067,8 +7067,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7067 | case ScriptBaseClass.CAMERA_FOCUS_OFFSET: | 7067 | case ScriptBaseClass.CAMERA_FOCUS_OFFSET: |
7068 | case ScriptBaseClass.CAMERA_POSITION: | 7068 | case ScriptBaseClass.CAMERA_POSITION: |
7069 | LSL_Types.Vector3 v = (LSL_Types.Vector3)data[i]; | 7069 | LSL_Types.Vector3 v = (LSL_Types.Vector3)data[i]; |
7070 | parameters.Add(type + 1, (float)v.x); | 7070 | parameters.Add(type + 1, (float)v.x); |
7071 | parameters.Add(type + 2, (float)v.y); | 7071 | parameters.Add(type + 2, (float)v.y); |
7072 | parameters.Add(type + 3, (float)v.z); | 7072 | parameters.Add(type + 3, (float)v.z); |
7073 | break; | 7073 | break; |
7074 | default: | 7074 | default: |
@@ -7088,7 +7088,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7088 | { | 7088 | { |
7089 | m_host.AddScriptLPS(1); | 7089 | m_host.AddScriptLPS(1); |
7090 | 7090 | ||
7091 | // our key in the object we are in | 7091 | // our key in the object we are in |
7092 | LLUUID invItemID=InventorySelf(); | 7092 | LLUUID invItemID=InventorySelf(); |
7093 | if (invItemID == LLUUID.Zero) return; | 7093 | if (invItemID == LLUUID.Zero) return; |
7094 | 7094 | ||
@@ -7102,10 +7102,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7102 | if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; | 7102 | if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; |
7103 | 7103 | ||
7104 | ScenePresence presence = World.GetScenePresence(agentID); | 7104 | ScenePresence presence = World.GetScenePresence(agentID); |
7105 | 7105 | ||
7106 | // we are not interested in child-agents | 7106 | // we are not interested in child-agents |
7107 | if (presence.IsChildAgent) return; | 7107 | if (presence.IsChildAgent) return; |
7108 | 7108 | ||
7109 | presence.ControllingClient.SendClearFollowCamProperties(objectID); | 7109 | presence.ControllingClient.SendClearFollowCamProperties(objectID); |
7110 | } | 7110 | } |
7111 | 7111 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs index 6c88ae86..52d277e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs | |||
@@ -89,7 +89,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
89 | { | 89 | { |
90 | if (!DataserverRequests.ContainsKey(identifier)) | 90 | if (!DataserverRequests.ContainsKey(identifier)) |
91 | return; | 91 | return; |
92 | 92 | ||
93 | ds=DataserverRequests[identifier]; | 93 | ds=DataserverRequests[identifier]; |
94 | DataserverRequests.Remove(identifier); | 94 | DataserverRequests.Remove(identifier); |
95 | } | 95 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs index 89bf51c..3f3cf39 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
70 | new LSL_Types.LSLInteger(rInfo.GetIntValue()), | 70 | new LSL_Types.LSLInteger(rInfo.GetIntValue()), |
71 | new LSL_Types.LSLString(rInfo.GetStrVal()) | 71 | new LSL_Types.LSLString(rInfo.GetStrVal()) |
72 | }; | 72 | }; |
73 | 73 | ||
74 | foreach (AsyncCommandManager m in m_CmdManager.Managers) | 74 | foreach (AsyncCommandManager m in m_CmdManager.Managers) |
75 | { | 75 | { |
76 | if (m.m_ScriptEngine.PostScriptEvent( | 76 | if (m.m_ScriptEngine.PostScriptEvent( |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs index 5b32cde..c28aa9a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs | |||
@@ -81,7 +81,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
81 | return; | 81 | return; |
82 | 82 | ||
83 | MethodInfo mi = inits[api]; | 83 | MethodInfo mi = inits[api]; |
84 | 84 | ||
85 | Object[] args = new Object[1]; | 85 | Object[] args = new Object[1]; |
86 | args[0] = data; | 86 | args[0] = data; |
87 | 87 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs index 681b2f2..d6a339b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
54 | { | 54 | { |
55 | _arity = arity; | 55 | _arity = arity; |
56 | } | 56 | } |
57 | 57 | ||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Append the answer to the list and update the indexes, if any. | 59 | /// Append the answer to the list and update the indexes, if any. |
60 | /// Elements of answer must be ground, since arguments with unbound variables make this | 60 | /// Elements of answer must be ground, since arguments with unbound variables make this |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs index a2fe7ec..9f5ae3d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs | |||
@@ -1,20 +1,20 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2008, Jeff Thompson | 2 | * Copyright (C) 2007-2008, Jeff Thompson |
3 | * | 3 | * |
4 | * All rights reserved. | 4 | * All rights reserved. |
5 | * | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions are met: | 7 | * modification, are permitted provided that the following conditions are met: |
8 | * | 8 | * |
9 | * * Redistributions of source code must retain the above copyright | 9 | * * Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * * Redistributions in binary form must reproduce the above copyright | 11 | * * Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. |
14 | * * Neither the name of the copyright holder nor the names of its contributors | 14 | * * Neither the name of the copyright holder nor the names of its contributors |
15 | * may be used to endorse or promote products derived from this software | 15 | * may be used to endorse or promote products derived from this software |
16 | * without specific prior written permission. | 16 | * without specific prior written permission. |
17 | * | 17 | * |
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
@@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
54 | /// This uses YP.makeCopy to copy the ErrorTerm and Message so that they are valid after unbinding. | 54 | /// This uses YP.makeCopy to copy the ErrorTerm and Message so that they are valid after unbinding. |
55 | /// </summary> | 55 | /// </summary> |
56 | /// <param name="ErrorTerm">the error term of the error</param> | 56 | /// <param name="ErrorTerm">the error term of the error</param> |
57 | /// <param name="Messsage">the message term of the error. If this is a string, it is converted to an | 57 | /// <param name="Messsage">the message term of the error. If this is a string, it is converted to an |
58 | /// Atom so it can be used by Prolog code. | 58 | /// Atom so it can be used by Prolog code. |
59 | /// Message, converted to a string, is use as the printable exception message. | 59 | /// Message, converted to a string, is use as the printable exception message. |
60 | /// </param> | 60 | /// </param> |
@@ -66,7 +66,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
66 | _term = YP.makeCopy(new Functor2(Atom.a("error"), ErrorTerm, Message), new Variable.CopyStore()); | 66 | _term = YP.makeCopy(new Functor2(Atom.a("error"), ErrorTerm, Message), new Variable.CopyStore()); |
67 | } | 67 | } |
68 | 68 | ||
69 | public class TypeErrorInfo | 69 | public class TypeErrorInfo |
70 | { | 70 | { |
71 | public readonly Atom _Type; | 71 | public readonly Atom _Type; |
72 | public readonly object _Culprit; | 72 | public readonly object _Culprit; |
@@ -116,14 +116,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
116 | /// <returns></returns> | 116 | /// <returns></returns> |
117 | public object getProcedureName() | 117 | public object getProcedureName() |
118 | { | 118 | { |
119 | if (!(_Type._name == "procedure" && | 119 | if (!(_Type._name == "procedure" && |
120 | _Culprit is Functor2 && ((Functor2)_Culprit)._name == Atom.SLASH)) | 120 | _Culprit is Functor2 && ((Functor2)_Culprit)._name == Atom.SLASH)) |
121 | return null; | 121 | return null; |
122 | return ((Functor2)_Culprit)._arg1; | 122 | return ((Functor2)_Culprit)._arg1; |
123 | } | 123 | } |
124 | 124 | ||
125 | /// <summary> | 125 | /// <summary> |
126 | /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. | 126 | /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. |
127 | /// Otherwise return -1. | 127 | /// Otherwise return -1. |
128 | /// </summary> | 128 | /// </summary> |
129 | /// <returns></returns> | 129 | /// <returns></returns> |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs index 97c9087..2e90d74 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs | |||
@@ -1,20 +1,20 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2008, Jeff Thompson | 2 | * Copyright (C) 2007-2008, Jeff Thompson |
3 | * | 3 | * |
4 | * All rights reserved. | 4 | * All rights reserved. |
5 | * | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions are met: | 7 | * modification, are permitted provided that the following conditions are met: |
8 | * | 8 | * |
9 | * * Redistributions of source code must retain the above copyright | 9 | * * Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * * Redistributions in binary form must reproduce the above copyright | 11 | * * Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. |
14 | * * Neither the name of the copyright holder nor the names of its contributors | 14 | * * Neither the name of the copyright holder nor the names of its contributors |
15 | * may be used to endorse or promote products derived from this software | 15 | * may be used to endorse or promote products derived from this software |
16 | * without specific prior written permission. | 16 | * without specific prior written permission. |
17 | * | 17 | * |
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
@@ -147,7 +147,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
147 | /// <summary> | 147 | /// <summary> |
148 | /// Convert term to an int. | 148 | /// Convert term to an int. |
149 | /// If term is a single-element List, use its first element | 149 | /// If term is a single-element List, use its first element |
150 | /// (to handle the char types like "a"). | 150 | /// (to handle the char types like "a"). |
151 | /// If can't convert, throw a PrologException for type_error evaluable (because this is only | 151 | /// If can't convert, throw a PrologException for type_error evaluable (because this is only |
152 | /// called from arithmetic functions). | 152 | /// called from arithmetic functions). |
153 | /// </summary> | 153 | /// </summary> |
@@ -172,8 +172,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
172 | { | 172 | { |
173 | throw new PrologException | 173 | throw new PrologException |
174 | (new Functor2 | 174 | (new Functor2 |
175 | ("type_error", Atom.a("evaluable"), | 175 | ("type_error", Atom.a("evaluable"), |
176 | new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), | 176 | new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), |
177 | "Term must be an integer"); | 177 | "Term must be an integer"); |
178 | } | 178 | } |
179 | } | 179 | } |
@@ -181,7 +181,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
181 | /// <summary> | 181 | /// <summary> |
182 | /// Convert term to a double. This may convert an int to a double, etc. | 182 | /// Convert term to a double. This may convert an int to a double, etc. |
183 | /// If term is a single-element List, use its first element | 183 | /// If term is a single-element List, use its first element |
184 | /// (to handle the char types like "a"). | 184 | /// (to handle the char types like "a"). |
185 | /// If can't convert, throw a PrologException for type_error evaluable (because this is only | 185 | /// If can't convert, throw a PrologException for type_error evaluable (because this is only |
186 | /// called from arithmetic functions). | 186 | /// called from arithmetic functions). |
187 | /// </summary> | 187 | /// </summary> |
@@ -195,7 +195,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
195 | // Assume it is a char type like "a". | 195 | // Assume it is a char type like "a". |
196 | term = YP.getValue(((Functor2)term)._arg1); | 196 | term = YP.getValue(((Functor2)term)._arg1); |
197 | if (term is Variable) | 197 | if (term is Variable) |
198 | throw new PrologException(Atom.a("instantiation_error"), | 198 | throw new PrologException(Atom.a("instantiation_error"), |
199 | "Expected a number but the argument is an unbound variable"); | 199 | "Expected a number but the argument is an unbound variable"); |
200 | 200 | ||
201 | try | 201 | try |
@@ -776,8 +776,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
776 | if (term1TypeCode == -2) | 776 | if (term1TypeCode == -2) |
777 | { | 777 | { |
778 | // Variable. | 778 | // Variable. |
779 | // We always check for equality first because we want to be sure | 779 | // We always check for equality first because we want to be sure |
780 | // that less than returns false if the terms are equal, in | 780 | // that less than returns false if the terms are equal, in |
781 | // case that the less than check really behaves like less than or equal. | 781 | // case that the less than check really behaves like less than or equal. |
782 | if ((Variable)Term1 != (Variable)Term2) | 782 | if ((Variable)Term1 != (Variable)Term2) |
783 | // The hash code should be unique to a Variable object. | 783 | // The hash code should be unique to a Variable object. |
@@ -820,8 +820,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
820 | } | 820 | } |
821 | 821 | ||
822 | /// <summary> | 822 | /// <summary> |
823 | /// Type code is -2 if term is a Variable, 0 if it is an Atom, | 823 | /// Type code is -2 if term is a Variable, 0 if it is an Atom, |
824 | /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, | 824 | /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, |
825 | /// 4 if it is Functor. | 825 | /// 4 if it is Functor. |
826 | /// Otherwise, type code is -1. | 826 | /// Otherwise, type code is -1. |
827 | /// This does not call YP.getValue(term). | 827 | /// This does not call YP.getValue(term). |
@@ -1167,7 +1167,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1167 | "Arg 2 List has an element which is an unbound variable"); | 1167 | "Arg 2 List has an element which is an unbound variable"); |
1168 | if (!(listAtom is Atom && ((Atom)listAtom)._name.Length == 1)) | 1168 | if (!(listAtom is Atom && ((Atom)listAtom)._name.Length == 1)) |
1169 | throw new PrologException | 1169 | throw new PrologException |
1170 | (new Functor2("type_error", Atom.a("character"), listAtom), | 1170 | (new Functor2("type_error", Atom.a("character"), listAtom), |
1171 | "Arg 2 List has an element which is not a one character atom"); | 1171 | "Arg 2 List has an element which is not a one character atom"); |
1172 | charArray[i] = ((Atom)listAtom)._name[0]; | 1172 | charArray[i] = ((Atom)listAtom)._name[0]; |
1173 | } | 1173 | } |
@@ -1209,7 +1209,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1209 | int codeInt; | 1209 | int codeInt; |
1210 | if (!getInt(codeArray[i], out codeInt) || codeInt < 0) | 1210 | if (!getInt(codeArray[i], out codeInt) || codeInt < 0) |
1211 | throw new PrologException | 1211 | throw new PrologException |
1212 | (new Functor1("representation_error", Atom.a("character_code")), | 1212 | (new Functor1("representation_error", Atom.a("character_code")), |
1213 | "Element of Arg 2 List is not a character code"); | 1213 | "Element of Arg 2 List is not a character code"); |
1214 | charArray[i] = (char)codeInt; | 1214 | charArray[i] = (char)codeInt; |
1215 | } | 1215 | } |
@@ -1323,7 +1323,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1323 | { | 1323 | { |
1324 | if (!YP.number(Number)) | 1324 | if (!YP.number(Number)) |
1325 | throw new PrologException | 1325 | throw new PrologException |
1326 | (new Functor2("type_error", Atom.a("number"), Number), | 1326 | (new Functor2("type_error", Atom.a("number"), Number), |
1327 | "Arg 1 Number is not var or number"); | 1327 | "Arg 1 Number is not var or number"); |
1328 | // We just checked, so convertDouble shouldn't throw an exception. | 1328 | // We just checked, so convertDouble shouldn't throw an exception. |
1329 | numberString = YP.doubleToString(YP.convertDouble(Number)); | 1329 | numberString = YP.doubleToString(YP.convertDouble(Number)); |
@@ -1413,7 +1413,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1413 | { | 1413 | { |
1414 | if (!(Char is Atom) || ((Atom)Char)._name.Length != 1) | 1414 | if (!(Char is Atom) || ((Atom)Char)._name.Length != 1) |
1415 | throw new PrologException | 1415 | throw new PrologException |
1416 | (new Functor2("type_error", Atom.a("character"), Char), | 1416 | (new Functor2("type_error", Atom.a("character"), Char), |
1417 | "Arg 1 Char is not var or one-character atom"); | 1417 | "Arg 1 Char is not var or one-character atom"); |
1418 | 1418 | ||
1419 | if (Code is Variable) | 1419 | if (Code is Variable) |
@@ -1795,7 +1795,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1795 | IndexedAnswers indexedAnswers; | 1795 | IndexedAnswers indexedAnswers; |
1796 | if (!_predicatesStore.TryGetValue(nameArity, out clauses)) | 1796 | if (!_predicatesStore.TryGetValue(nameArity, out clauses)) |
1797 | { | 1797 | { |
1798 | // Create an IndexedAnswers as the only clause of the predicate. | 1798 | // Create an IndexedAnswers as the only clause of the predicate. |
1799 | _predicatesStore[nameArity] = (clauses = new List<IClause>()); | 1799 | _predicatesStore[nameArity] = (clauses = new List<IClause>()); |
1800 | clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); | 1800 | clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); |
1801 | } | 1801 | } |
@@ -1826,7 +1826,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1826 | IndexedAnswers indexedAnswers; | 1826 | IndexedAnswers indexedAnswers; |
1827 | if (!_predicatesStore.TryGetValue(nameArity, out clauses)) | 1827 | if (!_predicatesStore.TryGetValue(nameArity, out clauses)) |
1828 | { | 1828 | { |
1829 | // Create an IndexedAnswers as the only clause of the predicate. | 1829 | // Create an IndexedAnswers as the only clause of the predicate. |
1830 | _predicatesStore[nameArity] = (clauses = new List<IClause>()); | 1830 | _predicatesStore[nameArity] = (clauses = new List<IClause>()); |
1831 | clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); | 1831 | clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); |
1832 | } | 1832 | } |
@@ -1855,7 +1855,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1855 | { | 1855 | { |
1856 | List<IClause> clauses; | 1856 | List<IClause> clauses; |
1857 | if (!_predicatesStore.TryGetValue(new NameArity(name, arguments.Length), out clauses)) | 1857 | if (!_predicatesStore.TryGetValue(new NameArity(name, arguments.Length), out clauses)) |
1858 | return unknownPredicate(name, arguments.Length, | 1858 | return unknownPredicate(name, arguments.Length, |
1859 | "Undefined dynamic predicate: " + name + "/" + arguments.Length); | 1859 | "Undefined dynamic predicate: " + name + "/" + arguments.Length); |
1860 | 1860 | ||
1861 | if (clauses.Count == 1) | 1861 | if (clauses.Count == 1) |
@@ -1889,7 +1889,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1889 | } | 1889 | } |
1890 | 1890 | ||
1891 | /// <summary> | 1891 | /// <summary> |
1892 | /// If _prologFlags["unknown"] is fail then return fail(), else if | 1892 | /// If _prologFlags["unknown"] is fail then return fail(), else if |
1893 | /// _prologFlags["unknown"] is warning then write the message to YP.write and | 1893 | /// _prologFlags["unknown"] is warning then write the message to YP.write and |
1894 | /// return fail(), else throw a PrologException for existence_error. . | 1894 | /// return fail(), else throw a PrologException for existence_error. . |
1895 | /// </summary> | 1895 | /// </summary> |
@@ -1917,7 +1917,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1917 | } | 1917 | } |
1918 | 1918 | ||
1919 | /// <summary> | 1919 | /// <summary> |
1920 | /// This is deprecated and just calls matchDynamic. This matches all clauses, | 1920 | /// This is deprecated and just calls matchDynamic. This matches all clauses, |
1921 | /// not just the ones defined with assertFact. | 1921 | /// not just the ones defined with assertFact. |
1922 | /// </summary> | 1922 | /// </summary> |
1923 | /// <param name="name"></param> | 1923 | /// <param name="name"></param> |
@@ -2066,7 +2066,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2066 | /// dynamic predicate. | 2066 | /// dynamic predicate. |
2067 | /// </summary> | 2067 | /// </summary> |
2068 | /// <param name="NameSlashArity"></param> | 2068 | /// <param name="NameSlashArity"></param> |
2069 | /// <param name="declaringClass">if not null, used to resolve references to the default | 2069 | /// <param name="declaringClass">if not null, used to resolve references to the default |
2070 | /// module Atom.a("")</param> | 2070 | /// module Atom.a("")</param> |
2071 | /// <returns></returns> | 2071 | /// <returns></returns> |
2072 | public static IEnumerable<bool> current_predicate(object NameSlashArity, Type declaringClass) | 2072 | public static IEnumerable<bool> current_predicate(object NameSlashArity, Type declaringClass) |
@@ -2078,7 +2078,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2078 | Functor2 NameArityFunctor = NameSlashArity as Functor2; | 2078 | Functor2 NameArityFunctor = NameSlashArity as Functor2; |
2079 | if (!(NameArityFunctor != null && NameArityFunctor._name == Atom.SLASH)) | 2079 | if (!(NameArityFunctor != null && NameArityFunctor._name == Atom.SLASH)) |
2080 | throw new PrologException | 2080 | throw new PrologException |
2081 | (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), | 2081 | (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), |
2082 | "Must be a name/arity predicate indicator"); | 2082 | "Must be a name/arity predicate indicator"); |
2083 | object name = YP.getValue(NameArityFunctor._arg1); | 2083 | object name = YP.getValue(NameArityFunctor._arg1); |
2084 | object arity = YP.getValue(NameArityFunctor._arg2); | 2084 | object arity = YP.getValue(NameArityFunctor._arg2); |
@@ -2163,12 +2163,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2163 | } | 2163 | } |
2164 | 2164 | ||
2165 | /// <summary> | 2165 | /// <summary> |
2166 | /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from | 2166 | /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from |
2167 | /// YP.getFunctorArgs(Goal). If not found, this throws a PrologException for existence_error. | 2167 | /// YP.getFunctorArgs(Goal). If not found, this throws a PrologException for existence_error. |
2168 | /// Otherwise, compile the goal as a single clause predicate and invoke it. | 2168 | /// Otherwise, compile the goal as a single clause predicate and invoke it. |
2169 | /// </summary> | 2169 | /// </summary> |
2170 | /// <param name="Goal"></param> | 2170 | /// <param name="Goal"></param> |
2171 | /// <param name="declaringClass">if not null, used to resolve references to the default | 2171 | /// <param name="declaringClass">if not null, used to resolve references to the default |
2172 | /// module Atom.a("")</param> | 2172 | /// module Atom.a("")</param> |
2173 | /// <returns></returns> | 2173 | /// <returns></returns> |
2174 | public static IEnumerable<bool> getIterator(object Goal, Type declaringClass) | 2174 | public static IEnumerable<bool> getIterator(object Goal, Type declaringClass) |
@@ -2259,7 +2259,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2259 | (new Functor2("type_error", Atom.a("atom"), Key), "Arg 1 Key is not an atom"); | 2259 | (new Functor2("type_error", Atom.a("atom"), Key), "Arg 1 Key is not an atom"); |
2260 | if (!_prologFlags.ContainsKey(((Atom)Key)._name)) | 2260 | if (!_prologFlags.ContainsKey(((Atom)Key)._name)) |
2261 | throw new PrologException | 2261 | throw new PrologException |
2262 | (new Functor2("domain_error", Atom.a("prolog_flag"), Key), | 2262 | (new Functor2("domain_error", Atom.a("prolog_flag"), Key), |
2263 | "Arg 1 Key is not a recognized flag"); | 2263 | "Arg 1 Key is not a recognized flag"); |
2264 | 2264 | ||
2265 | foreach (bool l1 in YP.unify(Value, _prologFlags[((Atom)Key)._name])) | 2265 | foreach (bool l1 in YP.unify(Value, _prologFlags[((Atom)Key)._name])) |
@@ -2343,7 +2343,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2343 | string results = ""; | 2343 | string results = ""; |
2344 | for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) | 2344 | for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) |
2345 | { | 2345 | { |
2346 | //Console.WriteLine( m ); | 2346 | //Console.WriteLine( m ); |
2347 | results += presep+ m + postsep; | 2347 | results += presep+ m + postsep; |
2348 | } | 2348 | } |
2349 | return results; | 2349 | return results; |
@@ -2662,7 +2662,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2662 | #pragma warning restore 0168 | 2662 | #pragma warning restore 0168 |
2663 | } | 2663 | } |
2664 | } | 2664 | } |
2665 | 2665 | ||
2666 | /// <summary> | 2666 | /// <summary> |
2667 | /// CodeListReader extends TextReader and overrides Read to read the next code from | 2667 | /// CodeListReader extends TextReader and overrides Read to read the next code from |
2668 | /// the CodeList which is a Prolog list of integer character codes. | 2668 | /// the CodeList which is a Prolog list of integer character codes. |
@@ -2683,7 +2683,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2683 | /// <returns></returns> | 2683 | /// <returns></returns> |
2684 | public override int Read() | 2684 | public override int Read() |
2685 | { | 2685 | { |
2686 | Functor2 CodeListPair = _CodeList as Functor2; | 2686 | Functor2 CodeListPair = _CodeList as Functor2; |
2687 | int code; | 2687 | int code; |
2688 | if (!(CodeListPair != null && CodeListPair._name == Atom.DOT && | 2688 | if (!(CodeListPair != null && CodeListPair._name == Atom.DOT && |
2689 | getInt(CodeListPair._arg1, out code))) | 2689 | getInt(CodeListPair._arg1, out code))) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs b/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs index f9b160d..0f79019 100644 --- a/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs +++ b/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs | |||
@@ -54,11 +54,11 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
54 | { | 54 | { |
55 | string path = Path.Combine(Directory.GetCurrentDirectory(), | 55 | string path = Path.Combine(Directory.GetCurrentDirectory(), |
56 | Path.Combine(s, assemblyName))+".dll"; | 56 | Path.Combine(s, assemblyName))+".dll"; |
57 | 57 | ||
58 | if (File.Exists(path)) | 58 | if (File.Exists(path)) |
59 | return Assembly.LoadFrom(path); | 59 | return Assembly.LoadFrom(path); |
60 | } | 60 | } |
61 | 61 | ||
62 | return null; | 62 | return null; |
63 | } | 63 | } |
64 | } | 64 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index 4962023..db90f3e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | |||
@@ -412,8 +412,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
412 | 412 | ||
413 | private static string CreateYPCompilerScript(string compileScript) | 413 | private static string CreateYPCompilerScript(string compileScript) |
414 | { | 414 | { |
415 | |||
416 | |||
417 | compileScript = String.Empty + | 415 | compileScript = String.Empty + |
418 | "using OpenSim.Region.ScriptEngine.Shared.YieldProlog; " + | 416 | "using OpenSim.Region.ScriptEngine.Shared.YieldProlog; " + |
419 | "using OpenSim.Region.ScriptEngine.Shared; using System.Collections.Generic;\r\n" + | 417 | "using OpenSim.Region.ScriptEngine.Shared; using System.Collections.Generic;\r\n" + |
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs index 57e8776..45f92e3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs | |||
@@ -87,9 +87,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
87 | string quote = String.Empty; | 87 | string quote = String.Empty; |
88 | bool last_was_escape = false; | 88 | bool last_was_escape = false; |
89 | int quote_replaced_count = 0; | 89 | int quote_replaced_count = 0; |
90 | 90 | ||
91 | string removefwnoncomments = nonCommentFwsl.Replace(Script, "\"\";"); | 91 | string removefwnoncomments = nonCommentFwsl.Replace(Script, "\"\";"); |
92 | 92 | ||
93 | string removecomments = conelinecomments.Replace(removefwnoncomments, ""); | 93 | string removecomments = conelinecomments.Replace(removefwnoncomments, ""); |
94 | removecomments = cstylecomments.Replace(removecomments, ""); | 94 | removecomments = cstylecomments.Replace(removecomments, ""); |
95 | string[] localscript = removecomments.Split('"'); | 95 | string[] localscript = removecomments.Split('"'); |
@@ -120,7 +120,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
120 | // checks for alpha.alpha way of referring to objects in C# | 120 | // checks for alpha.alpha way of referring to objects in C# |
121 | // ignores alpha.x alpha.y, alpha.z for refering to vector components | 121 | // ignores alpha.x alpha.y, alpha.z for refering to vector components |
122 | Match SecurityM; | 122 | Match SecurityM; |
123 | 123 | ||
124 | // BROKEN: this check is very wrong. It block's any url in strings. | 124 | // BROKEN: this check is very wrong. It block's any url in strings. |
125 | SecurityM = Regex.Match(checkscript, @"(?:[a-zA-Z])\.(?:[a-rt-wA-Z]|[a-zA-Z][a-zA-Z])", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 125 | SecurityM = Regex.Match(checkscript, @"(?:[a-zA-Z])\.(?:[a-rt-wA-Z]|[a-zA-Z][a-zA-Z])", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
126 | 126 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs index 831b918..22b3742 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs | |||
@@ -61,7 +61,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
61 | myCode = myCode.Substring(0, cs_pointer); | 61 | myCode = myCode.Substring(0, cs_pointer); |
62 | } | 62 | } |
63 | myCode.Replace("//yp", "%YPCode"); | 63 | myCode.Replace("//yp", "%YPCode"); |
64 | 64 | ||
65 | StringWriter myCS_SW = new StringWriter(); | 65 | StringWriter myCS_SW = new StringWriter(); |
66 | StringReader myCode_SR = new StringReader(" yp_nop_header_nop. \n "+myCode + "\n"); | 66 | StringReader myCode_SR = new StringReader(" yp_nop_header_nop. \n "+myCode + "\n"); |
67 | 67 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 8326e16..5497e2c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | |||
@@ -1335,22 +1335,22 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1335 | bool ret = i1.value != i2.value; | 1335 | bool ret = i1.value != i2.value; |
1336 | return ret; | 1336 | return ret; |
1337 | } | 1337 | } |
1338 | 1338 | ||
1339 | static public LSLInteger operator +(LSLInteger i1, int i2) | 1339 | static public LSLInteger operator +(LSLInteger i1, int i2) |
1340 | { | 1340 | { |
1341 | return new LSLInteger(i1.value + i2); | 1341 | return new LSLInteger(i1.value + i2); |
1342 | } | 1342 | } |
1343 | 1343 | ||
1344 | static public LSLInteger operator -(LSLInteger i1, int i2) | 1344 | static public LSLInteger operator -(LSLInteger i1, int i2) |
1345 | { | 1345 | { |
1346 | return new LSLInteger(i1.value - i2); | 1346 | return new LSLInteger(i1.value - i2); |
1347 | } | 1347 | } |
1348 | 1348 | ||
1349 | static public LSLInteger operator *(LSLInteger i1, int i2) | 1349 | static public LSLInteger operator *(LSLInteger i1, int i2) |
1350 | { | 1350 | { |
1351 | return new LSLInteger(i1.value * i2); | 1351 | return new LSLInteger(i1.value * i2); |
1352 | } | 1352 | } |
1353 | 1353 | ||
1354 | static public LSLInteger operator /(LSLInteger i1, int i2) | 1354 | static public LSLInteger operator /(LSLInteger i1, int i2) |
1355 | { | 1355 | { |
1356 | return new LSLInteger(i1.value / i2); | 1356 | return new LSLInteger(i1.value / i2); |
@@ -1360,22 +1360,22 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1360 | { | 1360 | { |
1361 | return new LSLFloat((double)i1.value + f); | 1361 | return new LSLFloat((double)i1.value + f); |
1362 | } | 1362 | } |
1363 | 1363 | ||
1364 | static public LSLFloat operator -(LSLInteger i1, double f) | 1364 | static public LSLFloat operator -(LSLInteger i1, double f) |
1365 | { | 1365 | { |
1366 | return new LSLFloat((double)i1.value - f); | 1366 | return new LSLFloat((double)i1.value - f); |
1367 | } | 1367 | } |
1368 | 1368 | ||
1369 | static public LSLFloat operator *(LSLInteger i1, double f) | 1369 | static public LSLFloat operator *(LSLInteger i1, double f) |
1370 | { | 1370 | { |
1371 | return new LSLFloat((double)i1.value * f); | 1371 | return new LSLFloat((double)i1.value * f); |
1372 | } | 1372 | } |
1373 | 1373 | ||
1374 | static public LSLFloat operator /(LSLInteger i1, double f) | 1374 | static public LSLFloat operator /(LSLInteger i1, double f) |
1375 | { | 1375 | { |
1376 | return new LSLFloat((double)i1.value / f); | 1376 | return new LSLFloat((double)i1.value / f); |
1377 | } | 1377 | } |
1378 | 1378 | ||
1379 | static public LSLInteger operator -(LSLInteger i) | 1379 | static public LSLInteger operator -(LSLInteger i) |
1380 | { | 1380 | { |
1381 | return new LSLInteger(-i.value); | 1381 | return new LSLInteger(-i.value); |
@@ -1536,17 +1536,17 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1536 | f.value--; | 1536 | f.value--; |
1537 | return f; | 1537 | return f; |
1538 | } | 1538 | } |
1539 | 1539 | ||
1540 | static public LSLFloat operator +(LSLFloat f, int i) | 1540 | static public LSLFloat operator +(LSLFloat f, int i) |
1541 | { | 1541 | { |
1542 | return new LSLFloat(f.value + (double)i); | 1542 | return new LSLFloat(f.value + (double)i); |
1543 | } | 1543 | } |
1544 | 1544 | ||
1545 | static public LSLFloat operator -(LSLFloat f, int i) | 1545 | static public LSLFloat operator -(LSLFloat f, int i) |
1546 | { | 1546 | { |
1547 | return new LSLFloat(f.value - (double)i); | 1547 | return new LSLFloat(f.value - (double)i); |
1548 | } | 1548 | } |
1549 | 1549 | ||
1550 | static public LSLFloat operator *(LSLFloat f, int i) | 1550 | static public LSLFloat operator *(LSLFloat f, int i) |
1551 | { | 1551 | { |
1552 | return new LSLFloat(f.value * (double)i); | 1552 | return new LSLFloat(f.value * (double)i); |