aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs156
1 files changed, 132 insertions, 24 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs b/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs
index 3fb0ff9..bf0e14e 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs
@@ -31,8 +31,10 @@ using System.Collections.Generic;
31using System.Runtime.Remoting.Lifetime; 31using System.Runtime.Remoting.Lifetime;
32using System.Text; 32using System.Text;
33using System.Threading; 33using System.Threading;
34using Nini.Config;
34using Axiom.Math; 35using Axiom.Math;
35using libsecondlife; 36using libsecondlife;
37using OpenSim;
36using OpenSim.Framework; 38using OpenSim.Framework;
37using OpenSim.Region.Environment; 39using OpenSim.Region.Environment;
38using OpenSim.Region.Environment.Interfaces; 40using OpenSim.Region.Environment.Interfaces;
@@ -973,6 +975,78 @@ namespace OpenSim.Region.ScriptEngine.XEngine
973 } 975 }
974 } 976 }
975 977
978 private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction,
979 float wind, float tension, LSL_Types.Vector3 Force)
980 {
981 if (part == null)
982 return;
983
984 bool needs_fakedelete = false;
985 if (flexi)
986 {
987 if (!part.Shape.FlexiEntry)
988 {
989 needs_fakedelete = true;
990 }
991 part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do
992 // work once the prim is already flexi
993 part.Shape.FlexiSoftness = softness;
994 part.Shape.FlexiGravity = gravity;
995 part.Shape.FlexiDrag = friction;
996 part.Shape.FlexiWind = wind;
997 part.Shape.FlexiTension = tension;
998 part.Shape.FlexiForceX = (float)Force.x;
999 part.Shape.FlexiForceY = (float)Force.y;
1000 part.Shape.FlexiForceZ = (float)Force.z;
1001 part.Shape.PathCurve = 0x80;
1002
1003 }
1004 else
1005 {
1006 if (part.Shape.FlexiEntry)
1007 {
1008 needs_fakedelete = true;
1009 }
1010 part.Shape.FlexiEntry = false;
1011 }
1012
1013 needs_fakedelete = false;
1014 if (needs_fakedelete)
1015 {
1016 if (part.ParentGroup != null)
1017 {
1018 part.ParentGroup.FakeDeleteGroup();
1019 }
1020 }
1021
1022 part.ScheduleFullUpdate();
1023 }
1024
1025 private void SetPointLight(SceneObjectPart part, bool light, LSL_Types.Vector3 color, float intensity, float radius, float falloff)
1026 {
1027 if (part == null)
1028 return;
1029
1030 if (light)
1031 {
1032 part.Shape.LightEntry = true;
1033 part.Shape.LightColorR = (float)color.x;
1034 part.Shape.LightColorG = (float)color.y;
1035 part.Shape.LightColorB = (float)color.z;
1036 part.Shape.LightIntensity = intensity;
1037 part.Shape.LightRadius = radius;
1038 part.Shape.LightFalloff = falloff;
1039 }
1040 else
1041 {
1042 part.Shape.LightEntry = false;
1043 }
1044
1045 part.ScheduleFullUpdate();
1046 }
1047
1048
1049
976 public LSL_Types.Vector3 llGetColor(int face) 1050 public LSL_Types.Vector3 llGetColor(int face)
977 { 1051 {
978 m_host.AddScriptLPS(1); 1052 m_host.AddScriptLPS(1);
@@ -4516,7 +4590,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine
4516 SetPos(part, v); 4590 SetPos(part, v);
4517 4591
4518 break; 4592 break;
4593 case 7: // PRIM_SIZE
4594 if (remain < 1)
4595 return;
4519 4596
4597 v=new LSL_Types.Vector3(rules.Data[idx++].ToString());
4598 SetScale(part, v);
4599
4600 break;
4520 case 8: // PRIM_ROTATION 4601 case 8: // PRIM_ROTATION
4521 if (remain < 1) 4602 if (remain < 1)
4522 return; 4603 return;
@@ -4555,13 +4636,31 @@ namespace OpenSim.Region.ScriptEngine.XEngine
4555 SetAlpha(part, alpha, face); 4636 SetAlpha(part, alpha, face);
4556 4637
4557 break; 4638 break;
4558 4639 case 21: // PRIM_FLEXI
4559 case 7: // PRIM_SIZE 4640 if (remain < 7)
4560 if (remain < 1)
4561 return; 4641 return;
4562 4642
4563 v=new LSL_Types.Vector3(rules.Data[idx++].ToString()); 4643 int flexi = Convert.ToInt32(rules.Data[idx++]);
4564 SetScale(part, v); 4644 int softness = Convert.ToInt32(rules.Data[idx++]);
4645 float gravity = (float)Convert.ToDouble(rules.Data[idx++]);
4646 float friction = (float)Convert.ToDouble(rules.Data[idx++]);
4647 float wind = (float)Convert.ToDouble(rules.Data[idx++]);
4648 float tension = (float)Convert.ToDouble(rules.Data[idx++]);
4649 LSL_Types.Vector3 force =new LSL_Types.Vector3(rules.Data[idx++].ToString());
4650
4651 SetFlexi(part, (flexi == 1), softness, gravity, friction, wind, tension, force);
4652
4653 break;
4654 case 23: // PRIM_POINT_LIGHT
4655 if (remain < 5)
4656 return;
4657 int light = Convert.ToInt32(rules.Data[idx++]);
4658 LSL_Types.Vector3 lightcolor =new LSL_Types.Vector3(rules.Data[idx++].ToString());
4659 float intensity = (float)Convert.ToDouble(rules.Data[idx++]);
4660 float radius = (float)Convert.ToDouble(rules.Data[idx++]);
4661 float falloff = (float)Convert.ToDouble(rules.Data[idx++]);
4662
4663 SetPointLight(part, (light == 1), lightcolor, intensity, radius, falloff);
4565 4664
4566 break; 4665 break;
4567 } 4666 }
@@ -5466,30 +5565,39 @@ namespace OpenSim.Region.ScriptEngine.XEngine
5466 public void llSetObjectPermMask(int mask, int value) 5565 public void llSetObjectPermMask(int mask, int value)
5467 { 5566 {
5468 m_host.AddScriptLPS(1); 5567 m_host.AddScriptLPS(1);
5469 5568 IConfigSource config = new IniConfigSource(Application.iniFilePath);
5470 if (mask == BuiltIn_Commands_BaseClass.MASK_BASE)//0 5569 if (config.Configs["XEngine"] == null)
5570 config.AddConfig("XEngine");
5571
5572 if (config.Configs["XEngine"].GetBoolean("AllowGodFunctions", false))
5471 { 5573 {
5472 m_host.BaseMask = (uint)value; 5574 if (World.ExternalChecks.ExternalChecksCanRunConsoleCommand(m_host.OwnerID))
5473 } 5575 {
5576 if (mask == BuiltIn_Commands_BaseClass.MASK_BASE)//0
5577 {
5578 m_host.BaseMask = (uint)value;
5579 }
5474 5580
5475 else if (mask == BuiltIn_Commands_BaseClass.MASK_OWNER)//1 5581 else if (mask == BuiltIn_Commands_BaseClass.MASK_OWNER)//1
5476 { 5582 {
5477 m_host.OwnerMask = (uint)value; 5583 m_host.OwnerMask = (uint)value;
5478 } 5584 }
5479 5585
5480 else if (mask == BuiltIn_Commands_BaseClass.MASK_GROUP)//2 5586 else if (mask == BuiltIn_Commands_BaseClass.MASK_GROUP)//2
5481 { 5587 {
5482 m_host.GroupMask = (uint)value; 5588 m_host.GroupMask = (uint)value;
5483 } 5589 }
5484 5590
5485 else if (mask == BuiltIn_Commands_BaseClass.MASK_EVERYONE)//3 5591 else if (mask == BuiltIn_Commands_BaseClass.MASK_EVERYONE)//3
5486 { 5592 {
5487 m_host.EveryoneMask = (uint)value; 5593 m_host.EveryoneMask = (uint)value;
5488 } 5594 }
5489 5595
5490 else if (mask == BuiltIn_Commands_BaseClass.MASK_NEXT)//4 5596 else if (mask == BuiltIn_Commands_BaseClass.MASK_NEXT)//4
5491 { 5597 {
5492 m_host.NextOwnerMask = (uint)value; 5598 m_host.NextOwnerMask = (uint)value;
5599 }
5600 }
5493 } 5601 }
5494 } 5602 }
5495 5603