diff options
author | Charles Krinke | 2007-12-24 21:16:32 +0000 |
---|---|---|
committer | Charles Krinke | 2007-12-24 21:16:32 +0000 |
commit | fa2495ae6b39b8b1f98bed221d4d2660724018de (patch) | |
tree | b6f98251c94e6200de44b66c814187ec4953eb2f /OpenSim/Region/ScriptEngine | |
parent | Revert most of the regionName message stuff. (diff) | |
download | opensim-SC_OLD-fa2495ae6b39b8b1f98bed221d4d2660724018de.zip opensim-SC_OLD-fa2495ae6b39b8b1f98bed221d4d2660724018de.tar.gz opensim-SC_OLD-fa2495ae6b39b8b1f98bed221d4d2660724018de.tar.bz2 opensim-SC_OLD-fa2495ae6b39b8b1f98bed221d4d2660724018de.tar.xz |
Again, great thanks to Alondria for:
Adding:: llSetParcelMusicUrl(), llGetRootPosition(), llGetRootRotation(),
llGetGeometricCenter(), llSetLocalRot(), llListReplaceList(),
llGetObjectPrimCount(),llGetParcelDetails(), llGetParcelMaxPrims(),
llWater(), llGetLocalRot(), and llGetAccel()
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
3 files changed, 82 insertions, 25 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs index 34bac59..6ba7018 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs | |||
@@ -569,7 +569,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
569 | void llForceMouselook(int mouselook); | 569 | void llForceMouselook(int mouselook); |
570 | //wiki: double llGetObjectMass(key id) | 570 | //wiki: double llGetObjectMass(key id) |
571 | double llGetObjectMass(string id); | 571 | double llGetObjectMass(string id); |
572 | void llListReplaceList(); | 572 | LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end); |
573 | //wiki: llLoadURL(key avatar_id, string message, string url) | 573 | //wiki: llLoadURL(key avatar_id, string message, string url) |
574 | void llLoadURL(string avatar_id, string message, string url); | 574 | void llLoadURL(string avatar_id, string message, string url); |
575 | //wiki: llParcelMediaCommandList( list commandList ) | 575 | //wiki: llParcelMediaCommandList( list commandList ) |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs index 1657b74..a9297fd 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs | |||
@@ -1636,9 +1636,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
1636 | return m_LSL_Functions.llGetObjectMass(id); | 1636 | return m_LSL_Functions.llGetObjectMass(id); |
1637 | } | 1637 | } |
1638 | 1638 | ||
1639 | public void llListReplaceList() | 1639 | public LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end) |
1640 | { | 1640 | { |
1641 | m_LSL_Functions.llListReplaceList(); | 1641 | return m_LSL_Functions.llListReplaceList(dest,src,start,end); |
1642 | } | 1642 | } |
1643 | 1643 | ||
1644 | public void llLoadURL(string avatar_id, string message, string url) | 1644 | public void llLoadURL(string avatar_id, string message, string url) |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs index 909b4e3..eeecd21 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs | |||
@@ -34,6 +34,7 @@ using System.Text; | |||
34 | using System.Threading; | 34 | using System.Threading; |
35 | using Axiom.Math; | 35 | using Axiom.Math; |
36 | using libsecondlife; | 36 | using libsecondlife; |
37 | using libsecondlife.StructuredData; | ||
37 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
38 | using OpenSim.Region.Environment.Interfaces; | 39 | using OpenSim.Region.Environment.Interfaces; |
39 | using OpenSim.Region.Environment.Scenes; | 40 | using OpenSim.Region.Environment.Scenes; |
@@ -750,8 +751,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
750 | 751 | ||
751 | public LSL_Types.Quaternion llGetLocalRot() | 752 | public LSL_Types.Quaternion llGetLocalRot() |
752 | { | 753 | { |
753 | NotImplemented("llGetLocalRot"); | 754 | return new LSL_Types.Quaternion(m_host.RotationOffset.X, m_host.RotationOffset.Y, m_host.RotationOffset.Z, m_host.RotationOffset.W); |
754 | return new LSL_Types.Quaternion(); | ||
755 | } | 755 | } |
756 | 756 | ||
757 | public void llSetForce(LSL_Types.Vector3 force, int local) | 757 | public void llSetForce(LSL_Types.Vector3 force, int local) |
@@ -830,8 +830,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
830 | 830 | ||
831 | public LSL_Types.Vector3 llGetAccel() | 831 | public LSL_Types.Vector3 llGetAccel() |
832 | { | 832 | { |
833 | NotImplemented("llGetAccel"); | 833 | return new LSL_Types.Vector3(m_host.Acceleration.X, m_host.Acceleration.Y, m_host.Acceleration.Z); |
834 | return new LSL_Types.Vector3(); | ||
835 | } | 834 | } |
836 | 835 | ||
837 | public LSL_Types.Vector3 llGetOmega() | 836 | public LSL_Types.Vector3 llGetOmega() |
@@ -1346,8 +1345,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
1346 | 1345 | ||
1347 | public double llWater(LSL_Types.Vector3 offset) | 1346 | public double llWater(LSL_Types.Vector3 offset) |
1348 | { | 1347 | { |
1349 | NotImplemented("llWater"); | 1348 | return World.RegionInfo.EstateSettings.waterHeight; |
1350 | return 0; | ||
1351 | } | 1349 | } |
1352 | 1350 | ||
1353 | public void llPassTouches(int pass) | 1351 | public void llPassTouches(int pass) |
@@ -2360,19 +2358,26 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
2360 | 2358 | ||
2361 | public void llSetParcelMusicURL(string url) | 2359 | public void llSetParcelMusicURL(string url) |
2362 | { | 2360 | { |
2363 | NotImplemented("llSetParcelMusicURL"); | 2361 | LLUUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); |
2362 | if (landowner == null) | ||
2363 | { | ||
2364 | return; | ||
2365 | } | ||
2366 | if (landowner != m_host.ObjectOwner) | ||
2367 | { | ||
2368 | return; | ||
2369 | } | ||
2370 | World.SetLandMusicURL(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, url); | ||
2364 | } | 2371 | } |
2365 | 2372 | ||
2366 | public LSL_Types.Vector3 llGetRootPosition() | 2373 | public LSL_Types.Vector3 llGetRootPosition() |
2367 | { | 2374 | { |
2368 | NotImplemented("llGetRootPosition"); | 2375 | return new LSL_Types.Vector3(m_host.ParentGroup.AbsolutePosition.X, m_host.ParentGroup.AbsolutePosition.Y, m_host.ParentGroup.AbsolutePosition.Z); |
2369 | return new LSL_Types.Vector3(); | ||
2370 | } | 2376 | } |
2371 | 2377 | ||
2372 | public LSL_Types.Quaternion llGetRootRotation() | 2378 | public LSL_Types.Quaternion llGetRootRotation() |
2373 | { | 2379 | { |
2374 | NotImplemented("llGetRootRotation"); | 2380 | return new LSL_Types.Quaternion(m_host.ParentGroup.GroupRotation.X, m_host.ParentGroup.GroupRotation.Y, m_host.ParentGroup.GroupRotation.Z, m_host.ParentGroup.GroupRotation.W); |
2375 | return new LSL_Types.Quaternion(); | ||
2376 | } | 2381 | } |
2377 | 2382 | ||
2378 | public string llGetObjectDesc() | 2383 | public string llGetObjectDesc() |
@@ -2495,8 +2500,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
2495 | 2500 | ||
2496 | public LSL_Types.Vector3 llGetGeometricCenter() | 2501 | public LSL_Types.Vector3 llGetGeometricCenter() |
2497 | { | 2502 | { |
2498 | NotImplemented("llGetGeometricCenter"); | 2503 | return new LSL_Types.Vector3(m_host.GetGeometricCenter().X, m_host.GetGeometricCenter().Y, m_host.GetGeometricCenter().Z); |
2499 | return new LSL_Types.Vector3(); | ||
2500 | } | 2504 | } |
2501 | 2505 | ||
2502 | public void llGetPrimitiveParams() | 2506 | public void llGetPrimitiveParams() |
@@ -2528,7 +2532,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
2528 | 2532 | ||
2529 | public void llSetLocalRot(LSL_Types.Quaternion rot) | 2533 | public void llSetLocalRot(LSL_Types.Quaternion rot) |
2530 | { | 2534 | { |
2531 | NotImplemented("llSetLocalRot"); | 2535 | m_host.RotationOffset = new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); |
2532 | } | 2536 | } |
2533 | 2537 | ||
2534 | public LSL_Types.list llParseStringKeepNulls(string src, LSL_Types.list seperators, LSL_Types.list spacers) | 2538 | public LSL_Types.list llParseStringKeepNulls(string src, LSL_Types.list seperators, LSL_Types.list spacers) |
@@ -2594,9 +2598,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
2594 | return 0; | 2598 | return 0; |
2595 | } | 2599 | } |
2596 | 2600 | ||
2597 | public void llListReplaceList() | 2601 | public LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end) |
2598 | { | 2602 | { |
2599 | NotImplemented("llListReplaceList"); | 2603 | return dest.GetSublist(0, start - 1) + src + dest.GetSublist(end + 1, -1); |
2600 | } | 2604 | } |
2601 | 2605 | ||
2602 | public void llLoadURL(string avatar_id, string message, string url) | 2606 | public void llLoadURL(string avatar_id, string message, string url) |
@@ -2792,20 +2796,73 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
2792 | 2796 | ||
2793 | public int llGetObjectPrimCount(string object_id) | 2797 | public int llGetObjectPrimCount(string object_id) |
2794 | { | 2798 | { |
2795 | NotImplemented("llGetObjectPrimCount"); | 2799 | SceneObjectPart part = World.GetSceneObjectPart(new LLUUID(object_id)); |
2796 | return 0; | 2800 | if (part == null) |
2801 | { | ||
2802 | return 0; | ||
2803 | } | ||
2804 | else | ||
2805 | { | ||
2806 | return part.ParentGroup.Children.Count; | ||
2807 | } | ||
2797 | } | 2808 | } |
2798 | 2809 | ||
2799 | public int llGetParcelMaxPrims(LSL_Types.Vector3 pos, int sim_wide) | 2810 | public int llGetParcelMaxPrims(LSL_Types.Vector3 pos, int sim_wide) |
2800 | { | 2811 | { |
2801 | NotImplemented("llGetParcelMaxPrims"); | 2812 | // Alondria: This currently just is utilizing the normal grid's 0.22 prims/m2 calculation |
2802 | return 0; | 2813 | // Which probably will be irrelevent in OpenSim.... |
2814 | LandData land = World.GetLandData((float)pos.x, (float)pos.y); | ||
2815 | float bonusfactor = World.RegionInfo.EstateSettings.objectBonusFactor; | ||
2816 | if (land == null) | ||
2817 | { | ||
2818 | return 0; | ||
2819 | } | ||
2820 | if (sim_wide == 1) | ||
2821 | { | ||
2822 | decimal v = land.simwideArea * (decimal)(0.22) * (decimal)bonusfactor; | ||
2823 | return (int)v; | ||
2824 | } | ||
2825 | else | ||
2826 | { | ||
2827 | decimal v = land.area * (decimal)(0.22) * (decimal)bonusfactor; | ||
2828 | return (int)v; | ||
2829 | } | ||
2830 | |||
2803 | } | 2831 | } |
2804 | 2832 | ||
2805 | public LSL_Types.list llGetParcelDetails(LSL_Types.Vector3 pos, LSL_Types.list param) | 2833 | public LSL_Types.list llGetParcelDetails(LSL_Types.Vector3 pos, LSL_Types.list param) |
2806 | { | 2834 | { |
2807 | NotImplemented("llGetParcelDetails"); | 2835 | LandData land = World.GetLandData((float)pos.x, (float)pos.y); |
2808 | return new LSL_Types.list(); | 2836 | if (land == null) |
2837 | { | ||
2838 | return new LSL_Types.list(0); | ||
2839 | } | ||
2840 | LSL_Types.list ret = new LSL_Types.list(); | ||
2841 | foreach(object o in param.Data) | ||
2842 | { | ||
2843 | switch(o.ToString()) | ||
2844 | { | ||
2845 | case "0": | ||
2846 | ret = ret + new LSL_Types.list(land.landName); | ||
2847 | break; | ||
2848 | case "1": | ||
2849 | ret = ret + new LSL_Types.list(land.landDesc); | ||
2850 | break; | ||
2851 | case "2": | ||
2852 | ret = ret + new LSL_Types.list(land.ownerID.ToString()); | ||
2853 | break; | ||
2854 | case "3": | ||
2855 | ret = ret + new LSL_Types.list(land.groupID.ToString()); | ||
2856 | break; | ||
2857 | case "4": | ||
2858 | ret = ret + new LSL_Types.list(land.area); | ||
2859 | break; | ||
2860 | default: | ||
2861 | ret = ret + new LSL_Types.list(0); | ||
2862 | break; | ||
2863 | } | ||
2864 | } | ||
2865 | return ret; | ||
2809 | } | 2866 | } |
2810 | 2867 | ||
2811 | // | 2868 | // |