diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 83 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_Types.cs | 24 |
2 files changed, 41 insertions, 66 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index bac8f2a..96c919c 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -532,8 +532,6 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
532 | LLUUID.TryParse(id, out keyID); | 532 | LLUUID.TryParse(id, out keyID); |
533 | 533 | ||
534 | m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SenseOnce(m_localID, m_itemID, name, keyID, type, range, arc, m_host); | 534 | m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SenseOnce(m_localID, m_itemID, name, keyID, type, range, arc, m_host); |
535 | |||
536 | return; | ||
537 | } | 535 | } |
538 | 536 | ||
539 | public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate) | 537 | public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate) |
@@ -543,14 +541,12 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
543 | LLUUID.TryParse(id, out keyID); | 541 | LLUUID.TryParse(id, out keyID); |
544 | 542 | ||
545 | m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SetSenseRepeatEvent(m_localID, m_itemID, name, keyID, type, range, arc, rate, m_host); | 543 | m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SetSenseRepeatEvent(m_localID, m_itemID, name, keyID, type, range, arc, rate, m_host); |
546 | return; | ||
547 | } | 544 | } |
548 | 545 | ||
549 | public void llSensorRemove() | 546 | public void llSensorRemove() |
550 | { | 547 | { |
551 | m_host.AddScriptLPS(1); | 548 | m_host.AddScriptLPS(1); |
552 | m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.UnSetSenseRepeaterEvents(m_localID, m_itemID); | 549 | m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.UnSetSenseRepeaterEvents(m_localID, m_itemID); |
553 | return; | ||
554 | } | 550 | } |
555 | 551 | ||
556 | public string resolveName(LLUUID objecUUID) | 552 | public string resolveName(LLUUID objecUUID) |
@@ -762,7 +758,6 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
762 | { | 758 | { |
763 | m_host.AddScriptLPS(1); | 759 | m_host.AddScriptLPS(1); |
764 | World.DeleteSceneObjectGroup(m_host.ParentGroup); | 760 | World.DeleteSceneObjectGroup(m_host.ParentGroup); |
765 | return; | ||
766 | } | 761 | } |
767 | 762 | ||
768 | public double llGround(LSL_Types.Vector3 offset) | 763 | public double llGround(LSL_Types.Vector3 offset) |
@@ -849,7 +844,6 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
849 | m_host.SetAxisRotation(statusrotationaxis, value); | 844 | m_host.SetAxisRotation(statusrotationaxis, value); |
850 | 845 | ||
851 | } | 846 | } |
852 | return; | ||
853 | } | 847 | } |
854 | 848 | ||
855 | public LSL_Types.LSLInteger llGetStatus(int status) | 849 | public LSL_Types.LSLInteger llGetStatus(int status) |
@@ -921,7 +915,6 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
921 | tmp.Z = (float)scale.z; | 915 | tmp.Z = (float)scale.z; |
922 | part.Scale = tmp; | 916 | part.Scale = tmp; |
923 | part.SendFullUpdateToAllClients(); | 917 | part.SendFullUpdateToAllClients(); |
924 | return; | ||
925 | } | 918 | } |
926 | 919 | ||
927 | public LSL_Types.Vector3 llGetScale() | 920 | public LSL_Types.Vector3 llGetScale() |
@@ -2139,12 +2132,12 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2139 | if (World.m_innerScene.ScenePresences.ContainsKey(m_host.TaskInventory[invItemID].PermsGranter)) | 2132 | if (World.m_innerScene.ScenePresences.ContainsKey(m_host.TaskInventory[invItemID].PermsGranter)) |
2140 | { | 2133 | { |
2141 | ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[invItemID].PermsGranter]; | 2134 | ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[invItemID].PermsGranter]; |
2142 | // Do NOT try to parse LLUUID, animations cannot be triggered by ID | 2135 | // Do NOT try to parse LLUUID, animations cannot be triggered by ID |
2143 | LLUUID animID=InventoryKey(anim, (int)AssetType.Animation); | 2136 | LLUUID animID=InventoryKey(anim, (int)AssetType.Animation); |
2144 | if (animID == LLUUID.Zero) | 2137 | if (animID == LLUUID.Zero) |
2145 | presence.AddAnimation(anim); | 2138 | presence.AddAnimation(anim); |
2146 | else | 2139 | else |
2147 | presence.AddAnimation(animID); | 2140 | presence.AddAnimation(animID); |
2148 | } | 2141 | } |
2149 | } | 2142 | } |
2150 | } | 2143 | } |
@@ -2170,15 +2163,15 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2170 | } | 2163 | } |
2171 | 2164 | ||
2172 | if (animID == LLUUID.Zero) | 2165 | if (animID == LLUUID.Zero) |
2173 | return; | 2166 | return; |
2174 | 2167 | ||
2175 | if (World.m_innerScene.ScenePresences.ContainsKey(m_host.TaskInventory[invItemID].PermsGranter)) | 2168 | if (World.m_innerScene.ScenePresences.ContainsKey(m_host.TaskInventory[invItemID].PermsGranter)) |
2176 | { | 2169 | { |
2177 | ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[invItemID].PermsGranter]; | 2170 | ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[invItemID].PermsGranter]; |
2178 | if (animID == LLUUID.Zero) | 2171 | if (animID == LLUUID.Zero) |
2179 | presence.RemoveAnimation(anim); | 2172 | presence.RemoveAnimation(anim); |
2180 | else | 2173 | else |
2181 | presence.RemoveAnimation(animID); | 2174 | presence.RemoveAnimation(animID); |
2182 | } | 2175 | } |
2183 | } | 2176 | } |
2184 | } | 2177 | } |
@@ -2547,7 +2540,6 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2547 | 2540 | ||
2548 | public void llSetScriptState(string name, int run) | 2541 | public void llSetScriptState(string name, int run) |
2549 | { | 2542 | { |
2550 | |||
2551 | LLUUID item; | 2543 | LLUUID item; |
2552 | ScriptManager sm; | 2544 | ScriptManager sm; |
2553 | IScript script = null; | 2545 | IScript script = null; |
@@ -2576,11 +2568,8 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2576 | if (script == null) | 2568 | if (script == null) |
2577 | ShoutError("llSetScriptState: script "+name+" not found"); | 2569 | ShoutError("llSetScriptState: script "+name+" not found"); |
2578 | 2570 | ||
2579 | // If we didn;t find it, then it's safe to | 2571 | // If we didn't find it, then it's safe to |
2580 | // assume it is not running. | 2572 | // assume it is not running. |
2581 | |||
2582 | return; | ||
2583 | |||
2584 | } | 2573 | } |
2585 | 2574 | ||
2586 | public double llGetEnergy() | 2575 | public double llGetEnergy() |
@@ -4083,7 +4072,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4083 | break; | 4072 | break; |
4084 | 4073 | ||
4085 | // Xantor 03-May-2008 | 4074 | // Xantor 03-May-2008 |
4086 | // Wiki: PSYS_SRC_TEXTURE string inventory item name or key of the particle texture | 4075 | // Wiki: PSYS_SRC_TEXTURE string inventory item name or key of the particle texture |
4087 | // "" = default texture. | 4076 | // "" = default texture. |
4088 | case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_TEXTURE: | 4077 | case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_TEXTURE: |
4089 | LLUUID tkey = LLUUID.Zero; | 4078 | LLUUID tkey = LLUUID.Zero; |
@@ -4363,7 +4352,6 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4363 | 4352 | ||
4364 | public void llResetOtherScript(string name) | 4353 | public void llResetOtherScript(string name) |
4365 | { | 4354 | { |
4366 | |||
4367 | LLUUID item; | 4355 | LLUUID item; |
4368 | ScriptManager sm; | 4356 | ScriptManager sm; |
4369 | IScript script = null; | 4357 | IScript script = null; |
@@ -4382,16 +4370,12 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4382 | if (script == null) | 4370 | if (script == null) |
4383 | ShoutError("llResetOtherScript: script "+name+" not found"); | 4371 | ShoutError("llResetOtherScript: script "+name+" not found"); |
4384 | 4372 | ||
4385 | // If we didn;t find it, then it's safe to | 4373 | // If we didn't find it, then it's safe to |
4386 | // assume it is not running. | 4374 | // assume it is not running. |
4387 | |||
4388 | return; | ||
4389 | |||
4390 | } | 4375 | } |
4391 | 4376 | ||
4392 | public LSL_Types.LSLInteger llGetScriptState(string name) | 4377 | public LSL_Types.LSLInteger llGetScriptState(string name) |
4393 | { | 4378 | { |
4394 | |||
4395 | LLUUID item; | 4379 | LLUUID item; |
4396 | ScriptManager sm; | 4380 | ScriptManager sm; |
4397 | IScript script = null; | 4381 | IScript script = null; |
@@ -4417,11 +4401,10 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4417 | if (script == null) | 4401 | if (script == null) |
4418 | ShoutError("llGetScriptState: script "+name+" not found"); | 4402 | ShoutError("llGetScriptState: script "+name+" not found"); |
4419 | 4403 | ||
4420 | // If we didn;t find it, then it's safe to | 4404 | // If we didn't find it, then it's safe to |
4421 | // assume it is not running. | 4405 | // assume it is not running. |
4422 | 4406 | ||
4423 | return 0; | 4407 | return 0; |
4424 | |||
4425 | } | 4408 | } |
4426 | 4409 | ||
4427 | public void llRemoteLoadScript() | 4410 | public void llRemoteLoadScript() |
@@ -4503,27 +4486,26 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4503 | { | 4486 | { |
4504 | if ((partInst.LinkNum + 1) == linknumber) | 4487 | if ((partInst.LinkNum + 1) == linknumber) |
4505 | { | 4488 | { |
4506 | part=partInst; | 4489 | part = partInst; |
4507 | break; | 4490 | break; |
4508 | } | 4491 | } |
4509 | } | 4492 | } |
4510 | } | 4493 | } |
4511 | else | 4494 | else |
4512 | { | 4495 | { |
4513 | part=m_host; | 4496 | part = m_host; |
4514 | } | 4497 | } |
4515 | 4498 | ||
4516 | if (part == null) | 4499 | if (part == null) |
4517 | return; | 4500 | return; |
4518 | 4501 | ||
4502 | int idx = 0; | ||
4519 | 4503 | ||
4520 | int idx=0; | 4504 | while (idx < rules.Length) |
4521 | |||
4522 | while(idx < rules.Length) | ||
4523 | { | 4505 | { |
4524 | int code=Convert.ToInt32(rules.Data[idx++]); | 4506 | int code = Convert.ToInt32(rules.Data[idx++]); |
4525 | 4507 | ||
4526 | int remain=rules.Length-idx; | 4508 | int remain = rules.Length - idx; |
4527 | 4509 | ||
4528 | int face; | 4510 | int face; |
4529 | LSL_Types.Vector3 v; | 4511 | LSL_Types.Vector3 v; |
@@ -4586,7 +4568,6 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4586 | SetScale(part, v); | 4568 | SetScale(part, v); |
4587 | 4569 | ||
4588 | break; | 4570 | break; |
4589 | |||
4590 | } | 4571 | } |
4591 | } | 4572 | } |
4592 | } | 4573 | } |
@@ -4847,7 +4828,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4847 | switch(code) | 4828 | switch(code) |
4848 | { | 4829 | { |
4849 | case 2: // PRIM_MATERIAL | 4830 | case 2: // PRIM_MATERIAL |
4850 | res.Add(new LSL_Types.LSLInteger(m_host.Material)); | 4831 | res.Add(new LSL_Types.LSLInteger(m_host.Material)); |
4851 | break; | 4832 | break; |
4852 | 4833 | ||
4853 | case 3: // PRIM_PHYSICS | 4834 | case 3: // PRIM_PHYSICS |
@@ -4890,7 +4871,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4890 | m_host.RotationOffset.W)); | 4871 | m_host.RotationOffset.W)); |
4891 | break; | 4872 | break; |
4892 | 4873 | ||
4893 | case 9: // PRIM_TYPE | 4874 | case 9: // PRIM_TYPE |
4894 | // TODO-------------- | 4875 | // TODO-------------- |
4895 | res.Add(new LSL_Types.LSLInteger(0)); | 4876 | res.Add(new LSL_Types.LSLInteger(0)); |
4896 | break; | 4877 | break; |
@@ -4934,7 +4915,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4934 | res.Add(new LSL_Types.LSLFloat((texcolor.A * 255) / 255)); | 4915 | res.Add(new LSL_Types.LSLFloat((texcolor.A * 255) / 255)); |
4935 | break; | 4916 | break; |
4936 | 4917 | ||
4937 | case 19: // PRIM_BUMP_SHINY | 4918 | case 19: // PRIM_BUMP_SHINY |
4938 | // TODO-------------- | 4919 | // TODO-------------- |
4939 | if (remain < 1) | 4920 | if (remain < 1) |
4940 | return res; | 4921 | return res; |
@@ -4945,7 +4926,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4945 | res.Add(new LSL_Types.LSLInteger(0)); | 4926 | res.Add(new LSL_Types.LSLInteger(0)); |
4946 | break; | 4927 | break; |
4947 | 4928 | ||
4948 | case 20: // PRIM_FULLBRIGHT | 4929 | case 20: // PRIM_FULLBRIGHT |
4949 | // TODO-------------- | 4930 | // TODO-------------- |
4950 | if (remain < 1) | 4931 | if (remain < 1) |
4951 | return res; | 4932 | return res; |
@@ -4955,7 +4936,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4955 | res.Add(new LSL_Types.LSLInteger(0)); | 4936 | res.Add(new LSL_Types.LSLInteger(0)); |
4956 | break; | 4937 | break; |
4957 | 4938 | ||
4958 | case 21: // PRIM_FLEXIBLE | 4939 | case 21: // PRIM_FLEXIBLE |
4959 | PrimitiveBaseShape shape = m_host.Shape; | 4940 | PrimitiveBaseShape shape = m_host.Shape; |
4960 | 4941 | ||
4961 | if (shape.FlexiEntry) | 4942 | if (shape.FlexiEntry) |
@@ -4972,7 +4953,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4972 | shape.FlexiForceZ)); | 4953 | shape.FlexiForceZ)); |
4973 | break; | 4954 | break; |
4974 | 4955 | ||
4975 | case 22: // PRIM_TEXGEN | 4956 | case 22: // PRIM_TEXGEN |
4976 | // TODO-------------- | 4957 | // TODO-------------- |
4977 | // (PRIM_TEXGEN_DEFAULT, PRIM_TEXGEN_PLANAR) | 4958 | // (PRIM_TEXGEN_DEFAULT, PRIM_TEXGEN_PLANAR) |
4978 | if (remain < 1) | 4959 | if (remain < 1) |
@@ -4983,7 +4964,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4983 | res.Add(new LSL_Types.LSLInteger(0)); | 4964 | res.Add(new LSL_Types.LSLInteger(0)); |
4984 | break; | 4965 | break; |
4985 | 4966 | ||
4986 | case 23: // PRIM_POINT_LIGHT: | 4967 | case 23: // PRIM_POINT_LIGHT: |
4987 | shape = m_host.Shape; | 4968 | shape = m_host.Shape; |
4988 | 4969 | ||
4989 | if (shape.LightEntry) | 4970 | if (shape.LightEntry) |
@@ -4998,7 +4979,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4998 | res.Add(new LSL_Types.LSLFloat(shape.LightFalloff)); // falloff | 4979 | res.Add(new LSL_Types.LSLFloat(shape.LightFalloff)); // falloff |
4999 | break; | 4980 | break; |
5000 | 4981 | ||
5001 | case 24: // PRIM_GLOW | 4982 | case 24: // PRIM_GLOW |
5002 | // TODO-------------- | 4983 | // TODO-------------- |
5003 | if (remain < 1) | 4984 | if (remain < 1) |
5004 | return res; | 4985 | return res; |
@@ -5141,7 +5122,6 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5141 | 5122 | ||
5142 | public string llIntegerToBase64(int number) | 5123 | public string llIntegerToBase64(int number) |
5143 | { | 5124 | { |
5144 | |||
5145 | // uninitialized string | 5125 | // uninitialized string |
5146 | 5126 | ||
5147 | char[] imdt = new char[8]; | 5127 | char[] imdt = new char[8]; |
@@ -5160,7 +5140,6 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5160 | imdt[0] = i2ctable[number>>26 & 0x3F]; | 5140 | imdt[0] = i2ctable[number>>26 & 0x3F]; |
5161 | 5141 | ||
5162 | return new string(imdt); | 5142 | return new string(imdt); |
5163 | |||
5164 | } | 5143 | } |
5165 | 5144 | ||
5166 | // <summary> | 5145 | // <summary> |
@@ -5206,7 +5185,6 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5206 | 5185 | ||
5207 | public LSL_Types.LSLInteger llBase64ToInteger(string str) | 5186 | public LSL_Types.LSLInteger llBase64ToInteger(string str) |
5208 | { | 5187 | { |
5209 | |||
5210 | int number = 0; | 5188 | int number = 0; |
5211 | int digit; | 5189 | int digit; |
5212 | 5190 | ||
@@ -5263,7 +5241,6 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5263 | // ignore trailing padding | 5241 | // ignore trailing padding |
5264 | 5242 | ||
5265 | return number; | 5243 | return number; |
5266 | |||
5267 | } | 5244 | } |
5268 | 5245 | ||
5269 | public double llGetGMTclock() | 5246 | public double llGetGMTclock() |
@@ -5334,7 +5311,6 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5334 | 5311 | ||
5335 | public LSL_Types.list llParseStringKeepNulls(string src, LSL_Types.list separators, LSL_Types.list spacers) | 5312 | public LSL_Types.list llParseStringKeepNulls(string src, LSL_Types.list separators, LSL_Types.list spacers) |
5336 | { | 5313 | { |
5337 | |||
5338 | int beginning = 0; | 5314 | int beginning = 0; |
5339 | int srclen = src.Length; | 5315 | int srclen = src.Length; |
5340 | int seplen = separators.Length; | 5316 | int seplen = separators.Length; |
@@ -5456,7 +5432,6 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5456 | } | 5432 | } |
5457 | 5433 | ||
5458 | return tokens; | 5434 | return tokens; |
5459 | |||
5460 | } | 5435 | } |
5461 | 5436 | ||
5462 | public void llRezAtRoot(string inventory, LSL_Types.Vector3 position, LSL_Types.Vector3 velocity, | 5437 | public void llRezAtRoot(string inventory, LSL_Types.Vector3 position, LSL_Types.Vector3 velocity, |
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs index 4bdb0ba..14ee319 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs | |||
@@ -1157,10 +1157,10 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1157 | return new LSLString(d); | 1157 | return new LSLString(d); |
1158 | } | 1158 | } |
1159 | 1159 | ||
1160 | public static implicit operator Vector3(LSLString s) | 1160 | public static implicit operator Vector3(LSLString s) |
1161 | { | 1161 | { |
1162 | return new Vector3(s.m_string); | 1162 | return new Vector3(s.m_string); |
1163 | } | 1163 | } |
1164 | 1164 | ||
1165 | #endregion | 1165 | #endregion |
1166 | 1166 | ||
@@ -1287,15 +1287,15 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1287 | return (double)i.value; | 1287 | return (double)i.value; |
1288 | } | 1288 | } |
1289 | 1289 | ||
1290 | public static bool operator true(LSLInteger i) | 1290 | public static bool operator true(LSLInteger i) |
1291 | { | 1291 | { |
1292 | return i.value != 0; | 1292 | return i.value != 0; |
1293 | } | 1293 | } |
1294 | 1294 | ||
1295 | public static bool operator false(LSLInteger i) | 1295 | public static bool operator false(LSLInteger i) |
1296 | { | 1296 | { |
1297 | return i.value == 0; | 1297 | return i.value == 0; |
1298 | } | 1298 | } |
1299 | 1299 | ||
1300 | #region Overriders | 1300 | #region Overriders |
1301 | 1301 | ||