diff options
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 150 |
1 files changed, 132 insertions, 18 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 48a7953..f7c44d1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -46,6 +46,7 @@ using OpenSim.Region.CoreModules.World.Land; | |||
46 | using OpenSim.Region.CoreModules.World.Terrain; | 46 | using OpenSim.Region.CoreModules.World.Terrain; |
47 | using OpenSim.Region.Framework.Interfaces; | 47 | using OpenSim.Region.Framework.Interfaces; |
48 | using OpenSim.Region.Framework.Scenes; | 48 | using OpenSim.Region.Framework.Scenes; |
49 | using OpenSim.Region.Framework.Scenes.Serialization; | ||
49 | using OpenSim.Region.Framework.Scenes.Animation; | 50 | using OpenSim.Region.Framework.Scenes.Animation; |
50 | using OpenSim.Region.Physics.Manager; | 51 | using OpenSim.Region.Physics.Manager; |
51 | using OpenSim.Region.ScriptEngine.Shared; | 52 | using OpenSim.Region.ScriptEngine.Shared; |
@@ -3635,12 +3636,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3635 | return m_ScriptEngine.GetStartParameter(m_itemID); | 3636 | return m_ScriptEngine.GetStartParameter(m_itemID); |
3636 | } | 3637 | } |
3637 | 3638 | ||
3638 | public void llGodLikeRezObject(string inventory, LSL_Vector pos) | ||
3639 | { | ||
3640 | m_host.AddScriptLPS(1); | ||
3641 | NotImplemented("llGodLikeRezObject"); | ||
3642 | } | ||
3643 | |||
3644 | public void llRequestPermissions(string agent, int perm) | 3639 | public void llRequestPermissions(string agent, int perm) |
3645 | { | 3640 | { |
3646 | UUID agentID = new UUID(); | 3641 | UUID agentID = new UUID(); |
@@ -4305,7 +4300,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4305 | m_host.AbsolutePosition.ToString(), | 4300 | m_host.AbsolutePosition.ToString(), |
4306 | agentItem.ID, true, m_host.AbsolutePosition, | 4301 | agentItem.ID, true, m_host.AbsolutePosition, |
4307 | bucket); | 4302 | bucket); |
4308 | |||
4309 | if (m_TransferModule != null) | 4303 | if (m_TransferModule != null) |
4310 | m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); | 4304 | m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); |
4311 | 4305 | ||
@@ -4618,12 +4612,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4618 | m_host.CollisionSoundVolume = (float)impact_volume; | 4612 | m_host.CollisionSoundVolume = (float)impact_volume; |
4619 | } | 4613 | } |
4620 | 4614 | ||
4621 | public void llCollisionSprite(string impact_sprite) | ||
4622 | { | ||
4623 | m_host.AddScriptLPS(1); | ||
4624 | NotImplemented("llCollisionSprite"); | ||
4625 | } | ||
4626 | |||
4627 | public LSL_String llGetAnimation(string id) | 4615 | public LSL_String llGetAnimation(string id) |
4628 | { | 4616 | { |
4629 | // This should only return a value if the avatar is in the same region | 4617 | // This should only return a value if the avatar is in the same region |
@@ -4887,6 +4875,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4887 | return result; | 4875 | return result; |
4888 | } | 4876 | } |
4889 | 4877 | ||
4878 | public LSL_Integer llGetLinkNumberOfSides(int link) | ||
4879 | { | ||
4880 | m_host.AddScriptLPS(1); | ||
4881 | |||
4882 | SceneObjectPart linkedPart; | ||
4883 | |||
4884 | if (link == ScriptBaseClass.LINK_ROOT) | ||
4885 | linkedPart = m_host.ParentGroup.RootPart; | ||
4886 | else if (link == ScriptBaseClass.LINK_THIS) | ||
4887 | linkedPart = m_host; | ||
4888 | else | ||
4889 | linkedPart = m_host.ParentGroup.GetLinkNumPart(link); | ||
4890 | |||
4891 | return GetNumberOfSides(linkedPart); | ||
4892 | } | ||
4893 | |||
4890 | public LSL_Integer llGetNumberOfSides() | 4894 | public LSL_Integer llGetNumberOfSides() |
4891 | { | 4895 | { |
4892 | m_host.AddScriptLPS(1); | 4896 | m_host.AddScriptLPS(1); |
@@ -5947,11 +5951,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5947 | ScriptSleep(100); | 5951 | ScriptSleep(100); |
5948 | } | 5952 | } |
5949 | 5953 | ||
5950 | public void llSetSoundQueueing(int queue) | ||
5951 | { | ||
5952 | m_host.AddScriptLPS(1); | ||
5953 | } | ||
5954 | |||
5955 | public void llSetSoundRadius(double radius) | 5954 | public void llSetSoundRadius(double radius) |
5956 | { | 5955 | { |
5957 | m_host.AddScriptLPS(1); | 5956 | m_host.AddScriptLPS(1); |
@@ -10984,6 +10983,121 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10984 | { | 10983 | { |
10985 | m_SayShoutCount = 0; | 10984 | m_SayShoutCount = 0; |
10986 | } | 10985 | } |
10986 | |||
10987 | #region Not Implemented | ||
10988 | // | ||
10989 | // Listing the unimplemented lsl functions here, please move | ||
10990 | // them from this region as they are completed | ||
10991 | // | ||
10992 | public void llCastRay(LSL_Vector start, LSL_Vector end, LSL_List options) | ||
10993 | { | ||
10994 | m_host.AddScriptLPS(1); | ||
10995 | NotImplemented("llCastRay"); | ||
10996 | |||
10997 | } | ||
10998 | |||
10999 | public void llGetEnv(LSL_String name) | ||
11000 | { | ||
11001 | m_host.AddScriptLPS(1); | ||
11002 | NotImplemented("llGetEnv"); | ||
11003 | |||
11004 | } | ||
11005 | |||
11006 | public void llGetSPMaxMemory() | ||
11007 | { | ||
11008 | m_host.AddScriptLPS(1); | ||
11009 | NotImplemented("llGetSPMaxMemory"); | ||
11010 | |||
11011 | } | ||
11012 | |||
11013 | public virtual LSL_Integer llGetUsedMemory() | ||
11014 | { | ||
11015 | m_host.AddScriptLPS(1); | ||
11016 | NotImplemented("llGetUsedMemory"); | ||
11017 | return 0; | ||
11018 | } | ||
11019 | |||
11020 | public void llRegionSayTo( LSL_Key target, LSL_Integer channel, LSL_String msg ) | ||
11021 | { | ||
11022 | m_host.AddScriptLPS(1); | ||
11023 | NotImplemented("llRegionSayTo"); | ||
11024 | |||
11025 | } | ||
11026 | |||
11027 | public void llScriptProfiler( LSL_Integer flags ) | ||
11028 | { | ||
11029 | m_host.AddScriptLPS(1); | ||
11030 | //NotImplemented("llScriptProfiler"); | ||
11031 | |||
11032 | } | ||
11033 | |||
11034 | public void llSetSoundQueueing(int queue) | ||
11035 | { | ||
11036 | m_host.AddScriptLPS(1); | ||
11037 | } | ||
11038 | |||
11039 | public void llCollisionSprite(string impact_sprite) | ||
11040 | { | ||
11041 | m_host.AddScriptLPS(1); | ||
11042 | NotImplemented("llCollisionSprite"); | ||
11043 | } | ||
11044 | |||
11045 | public void llGodLikeRezObject(string inventory, LSL_Vector pos) | ||
11046 | { | ||
11047 | m_host.AddScriptLPS(1); | ||
11048 | |||
11049 | if (!World.Permissions.IsGod(m_host.OwnerID)) | ||
11050 | NotImplemented("llGodLikeRezObject"); | ||
11051 | |||
11052 | AssetBase rezAsset = World.AssetService.Get(inventory); | ||
11053 | if (rezAsset == null) | ||
11054 | { | ||
11055 | llSay(0, "Asset not found"); | ||
11056 | return; | ||
11057 | } | ||
11058 | |||
11059 | SceneObjectGroup group = null; | ||
11060 | |||
11061 | try | ||
11062 | { | ||
11063 | string xmlData = Utils.BytesToString(rezAsset.Data); | ||
11064 | group = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); | ||
11065 | } | ||
11066 | catch | ||
11067 | { | ||
11068 | llSay(0, "Asset not found"); | ||
11069 | return; | ||
11070 | } | ||
11071 | |||
11072 | if (group == null) | ||
11073 | { | ||
11074 | llSay(0, "Asset not found"); | ||
11075 | return; | ||
11076 | } | ||
11077 | |||
11078 | group.RootPart.AttachPoint = group.RootPart.Shape.State; | ||
11079 | group.RootPart.AttachOffset = group.AbsolutePosition; | ||
11080 | |||
11081 | group.ResetIDs(); | ||
11082 | |||
11083 | Vector3 llpos = new Vector3((float)pos.x, (float)pos.y, (float)pos.z); | ||
11084 | World.AddNewSceneObject(group, true, llpos, Quaternion.Identity, Vector3.Zero); | ||
11085 | group.CreateScriptInstances(0, true, World.DefaultScriptEngine, 3); | ||
11086 | group.ScheduleGroupForFullUpdate(); | ||
11087 | |||
11088 | // objects rezzed with this method are die_at_edge by default. | ||
11089 | group.RootPart.SetDieAtEdge(true); | ||
11090 | |||
11091 | group.ResumeScripts(); | ||
11092 | |||
11093 | m_ScriptEngine.PostObjectEvent(m_host.LocalId, new EventParams( | ||
11094 | "object_rez", new Object[] { | ||
11095 | new LSL_String( | ||
11096 | group.RootPart.UUID.ToString()) }, | ||
11097 | new DetectParams[0])); | ||
11098 | } | ||
11099 | |||
11100 | #endregion | ||
10987 | } | 11101 | } |
10988 | 11102 | ||
10989 | public class NotecardCache | 11103 | public class NotecardCache |