From 84b0a23e193b220d61b5a67e90df32138441c1e8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 4 Mar 2010 10:38:03 +0000 Subject: Remove a superfluous array creation --- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index e87b1f4..1ea52c5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -416,7 +416,6 @@ namespace OpenSim.Region.ScriptEngine.Shared public list(params object[] args) { - m_data = new object[args.Length]; m_data = args; } -- cgit v1.1 From 62dd83f473fefb3ff2a7b64728a40337ae0e395e Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 4 Mar 2010 10:38:03 +0000 Subject: Remove a superfluous array creation --- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index e87b1f4..1ea52c5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -416,7 +416,6 @@ namespace OpenSim.Region.ScriptEngine.Shared public list(params object[] args) { - m_data = new object[args.Length]; m_data = args; } -- cgit v1.1 From 83929c69e35d156d99be46a6ee50b0d3fe5c9f25 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 6 Mar 2010 00:56:55 -0600 Subject: - implementing server 1.38 functions Signed-off-by: Melanie --- .../Shared/Api/Implementation/LSL_Api.cs | 99 +++++++++++++++++++--- .../ScriptEngine/Shared/Api/Interface/ILSL_Api.cs | 4 + .../Shared/Api/Runtime/LSL_Constants.cs | 1 + .../ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | 20 +++++ 4 files changed, 114 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index aa876ec..a373046 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -5406,12 +5406,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate) { m_host.AddScriptLPS(1); + + SetTextureAnim(m_host, mode, face, sizex, sizey, start, length, rate); + } + + public void llSetLinkTextureAnim(int linknumber, int mode, int face, int sizex, int sizey, double start, double length, double rate) + { + m_host.AddScriptLPS(1); + + List parts = GetLinkParts(linknumber); + + foreach (var part in parts) + { + SetTextureAnim(part, mode, face, sizex, sizey, start, length, rate); + } + } + + private void SetTextureAnim(SceneObjectPart part, int mode, int face, int sizex, int sizey, double start, double length, double rate) + { + Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation(); pTexAnim.Flags = (Primitive.TextureAnimMode)mode; //ALL_SIDES if (face == ScriptBaseClass.ALL_SIDES) - face = 255; + face = 255; pTexAnim.Face = (uint)face; pTexAnim.Length = (float)length; @@ -5420,9 +5439,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api pTexAnim.SizeY = (uint)sizey; pTexAnim.Start = (float)start; - m_host.AddTextureAnimation(pTexAnim); - m_host.SendFullUpdateToAllClients(); - m_host.ParentGroup.HasGroupChanged = true; + part.AddTextureAnimation(pTexAnim); + part.SendFullUpdateToAllClients(); + part.ParentGroup.HasGroupChanged = true; } public void llTriggerSoundLimited(string sound, double volume, LSL_Vector top_north_east, @@ -5819,13 +5838,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return ps; } + public void llLinkParticleSystem(int linknumber, LSL_List rules) + { + m_host.AddScriptLPS(1); + + List parts = GetLinkParts(linknumber); + + foreach (var part in parts) + { + SetParticleSystem(part, rules); + } + } + public void llParticleSystem(LSL_List rules) { m_host.AddScriptLPS(1); + SetParticleSystem(m_host, rules); + } + + private void SetParticleSystem(SceneObjectPart part, LSL_List rules) { + + if (rules.Length == 0) { - m_host.RemoveParticleSystem(); - m_host.ParentGroup.HasGroupChanged = true; + part.RemoveParticleSystem(); + part.ParentGroup.HasGroupChanged = true; } else { @@ -5936,7 +5973,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else { - prules.Target = m_host.UUID; + prules.Target = part.UUID; } break; @@ -5962,10 +5999,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } prules.CRC = 1; - m_host.AddNewParticleSystem(prules); - m_host.ParentGroup.HasGroupChanged = true; + part.AddNewParticleSystem(prules); + part.ParentGroup.HasGroupChanged = true; } - m_host.SendFullUpdateToAllClients(); + part.SendFullUpdateToAllClients(); } public void llGroundRepel(double height, int water, double tau) @@ -6759,6 +6796,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SetPrimParams(part, rules); } + public void llSetLinkPrimitiveParamsFast(int linknumber, LSL_List rules) + { + llSetLinkPrimitiveParams(linknumber, rules); + } + protected void SetPrimParams(SceneObjectPart part, LSL_List rules) { int idx = 0; @@ -7115,6 +7157,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api int style = rules.GetLSLIntegerItem(idx++); SetTexGen(part, face, style); break; + case (int)ScriptBaseClass.PRIM_TEXT: + if (remain < 3) + return; + string primText = rules.GetLSLStringItem(idx++); + LSL_Vector primTextColor = rules.GetVector3Item(idx++); + LSL_Float primTextAlpha = rules.GetLSLFloatItem(idx++); + Vector3 av3 = new Vector3(Util.Clip((float)primTextColor.x, 0.0f, 1.0f), + Util.Clip((float)primTextColor.y, 0.0f, 1.0f), + Util.Clip((float)primTextColor.z, 0.0f, 1.0f)); + part.SetText(primText, av3, Util.Clip((float)primTextAlpha, 0.0f, 1.0f)); + + break; } } } @@ -7358,6 +7412,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return GetLinkPrimitiveParams(m_host, rules); } + public LSL_List llGetLinkPrimitiveParams(int linknumber, LSL_List rules) + { + m_host.AddScriptLPS(1); + + List parts = GetLinkParts(linknumber); + + LSL_List res = new LSL_List(); + + foreach (var part in parts) + { + LSL_List partRes = GetLinkPrimitiveParams(part, rules); + res += partRes; + } + + return res; + } + public LSL_List GetLinkPrimitiveParams(SceneObjectPart part, LSL_List rules) { LSL_List res = new LSL_List(); @@ -7635,6 +7706,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api res.Add(new LSL_Float(0)); break; + case (int)ScriptBaseClass.PRIM_TEXT: + Color4 textColor = part.GetTextColor(); + res.Add(part.Text); + res.Add(new LSL_Vector(textColor.R, + textColor.G, + textColor.B)); + res.Add(new LSL_Float(textColor.A)); + break; } } return res; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index a74e8da..7ab04a3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs @@ -135,6 +135,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces LSL_Key llGetLinkKey(int linknum); LSL_String llGetLinkName(int linknum); LSL_Integer llGetLinkNumber(); + LSL_List llGetLinkPrimitiveParams(int linknum, LSL_List rules); LSL_Integer llGetListEntryType(LSL_List src, int index); LSL_Integer llGetListLength(LSL_List src); LSL_Vector llGetLocalPos(); @@ -206,6 +207,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces void llInstantMessage(string user, string message); LSL_String llIntegerToBase64(int number); LSL_String llKey2Name(string id); + void llLinkParticleSystem(int linknum, LSL_List rules); LSL_String llList2CSV(LSL_List src); LSL_Float llList2Float(LSL_List src, int index); LSL_Integer llList2Integer(LSL_List src, int index); @@ -322,6 +324,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces void llSetLinkColor(int linknumber, LSL_Vector color, int face); void llSetLinkPrimitiveParams(int linknumber, LSL_List rules); void llSetLinkTexture(int linknumber, string texture, int face); + void llSetLinkTextureAnim(int linknum, int mode, int face, int sizex, int sizey, double start, double length, double rate); void llSetLocalRot(LSL_Rotation rot); void llSetObjectDesc(string desc); void llSetObjectName(string name); @@ -330,6 +333,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces void llSetPayPrice(int price, LSL_List quick_pay_buttons); void llSetPos(LSL_Vector pos); void llSetPrimitiveParams(LSL_List rules); + void llSetLinkPrimitiveParamsFast(int linknum, LSL_List rules); void llSetPrimURL(string url); void llSetRemoteScriptAccessPin(int pin); void llSetRot(LSL_Rotation rot); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index 7cf82b2..ee35fa4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs @@ -313,6 +313,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int PRIM_CAST_SHADOWS = 24; // Not implemented, here for completeness sake public const int PRIM_POINT_LIGHT = 23; // Huh? public const int PRIM_GLOW = 25; + public const int PRIM_TEXT = 26; public const int PRIM_TEXGEN_DEFAULT = 0; public const int PRIM_TEXGEN_PLANAR = 1; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index a28e97b..3339995 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs @@ -674,6 +674,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_LSL_Functions.llGetPrimitiveParams(rules); } + public LSL_List llGetLinkPrimitiveParams(int linknum, LSL_List rules) + { + return m_LSL_Functions.llGetLinkPrimitiveParams(linknum, rules); + } + public LSL_Integer llGetRegionAgentCount() { return m_LSL_Functions.llGetRegionAgentCount(); @@ -889,6 +894,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_LSL_Functions.llKey2Name(id); } + public void llLinkParticleSystem(int linknum, LSL_List rules) + { + m_LSL_Functions.llLinkParticleSystem(linknum, rules); + } + public LSL_String llList2CSV(LSL_List src) { return m_LSL_Functions.llList2CSV(src); @@ -1468,6 +1478,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase m_LSL_Functions.llSetLinkTexture(linknumber, texture, face); } + public void llSetLinkTextureAnim(int linknum, int mode, int face, int sizex, int sizey, double start, double length, double rate) + { + m_LSL_Functions.llSetLinkTextureAnim(linknum, mode, face, sizex, sizey, start, length, rate); + } + public void llSetLocalRot(LSL_Rotation rot) { m_LSL_Functions.llSetLocalRot(rot); @@ -1508,6 +1523,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase m_LSL_Functions.llSetPrimitiveParams(rules); } + public void llSetLinkPrimitiveParamsFast(int linknum, LSL_List rules) + { + m_LSL_Functions.llSetLinkPrimitiveParamsFast(linknum, rules); + } + public void llSetPrimURL(string url) { m_LSL_Functions.llSetPrimURL(url); -- cgit v1.1 From c8c608acc8509ebc1651b4c2dd9094cbe64dcfb8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 7 Mar 2010 16:05:24 +0000 Subject: Small consistency change --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 3154f9e..180fba9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6065,7 +6065,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api for (int i = 0; i < rules.Length; i += 2) { - switch (Convert.ToInt32(rules.Data[i])) + switch (rules.GetLSLIntegerItem(i)) { case (int)ScriptBaseClass.PSYS_PART_FLAGS: prules.PartDataFlags = (Primitive.ParticleSystem.ParticleDataFlags)(uint)rules.GetLSLIntegerItem(i + 1); -- cgit v1.1 From 80e4068b3e85625234270cd7f3735cfd1b4e83dc Mon Sep 17 00:00:00 2001 From: CasperW Date: Sat, 13 Mar 2010 15:13:19 +0100 Subject: Fix the delay in llGiveInventory so that it only takes effect when giving inventory to an avatar (this now replicates SL behaviour) --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 180fba9..0117fa0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4014,14 +4014,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api bucket); if (m_TransferModule != null) - m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); + m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); + + //This delay should only occur when giving inventory to avatars. + ScriptSleep(3000); } else { // destination is an object World.MoveTaskInventoryItem(destId, m_host, objId); } - ScriptSleep(3000); + } [DebuggerNonUserCode] -- cgit v1.1 From 819806261026cccd68dee649f11938ae5bf10029 Mon Sep 17 00:00:00 2001 From: Kitto Flora Date: Sun, 14 Mar 2010 16:22:13 -0400 Subject: RotLookAt repaired; debug msg cleanup. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 180fba9..83f7db0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2899,10 +2899,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // the angles of rotation in radians into rotation value LSL_Types.Quaternion rot = llEuler2Rot(angle); + /* Quaternion rotation = new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); m_host.startLookAt(rotation, (float)damping, (float)strength); + This would only work if your physics system contains an APID controller */ // Orient the object to the angle calculated - //llSetRot(rot); + llSetRot(rot); } public void llRotLookAt(LSL_Rotation target, double strength, double damping) -- cgit v1.1