From 32cc00ec7b26290e4b65e326164510ad6fc831d3 Mon Sep 17 00:00:00 2001 From: Jeff Lee Date: Tue, 18 Aug 2009 00:41:38 -0400 Subject: osGetLinkPrimitiveParams fix --- .../Shared/Api/Implementation/LSL_Api.cs | 26 +++++++++++++++++++++- 1 file changed, 25 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 2dbbf70..4e665e9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1978,6 +1978,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return new LSL_Rotation(q.X, q.Y, q.Z, q.W); } + private LSL_Rotation GetPartRot( SceneObjectPart part ) + { + Quaternion q; + if (part.LinkNum == 0 || part.LinkNum == 1) // unlinked or root prim + { + if (part.ParentGroup.RootPart.AttachmentPoint != 0) + { + ScenePresence avatar = World.GetScenePresence(part.AttachedAvatar); + if (avatar != null) + if ((avatar.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0) + q = avatar.CameraRotation; // Mouselook + else + q = avatar.Rotation; // Currently infrequently updated so may be inaccurate + else + q = part.ParentGroup.GroupRotation; // Likely never get here but just in case + } + else + q = part.ParentGroup.GroupRotation; // just the group rotation + return new LSL_Rotation(q.X, q.Y, q.Z, q.W); + } + q = part.GetWorldRotation(); + return new LSL_Rotation(q.X, q.Y, q.Z, q.W); + } + public LSL_Rotation llGetLocalRot() { m_host.AddScriptLPS(1); @@ -7299,7 +7323,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api break; case (int)ScriptBaseClass.PRIM_ROTATION: - res.Add(llGetRot()); + res.Add(GetPartRot(part)); break; case (int)ScriptBaseClass.PRIM_TYPE: -- cgit v1.1 From e83b00a3dfc5410f5ca6bd2eed3d8565ebbffecf Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 21 Aug 2009 08:51:43 +1000 Subject: * Implements a bunch of stuff in NPCModule --- .../Shared/Api/Implementation/LSL_Api.cs | 48 +++++++++++----------- 1 file changed, 24 insertions(+), 24 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 4e665e9..972e71c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1978,30 +1978,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return new LSL_Rotation(q.X, q.Y, q.Z, q.W); } - private LSL_Rotation GetPartRot( SceneObjectPart part ) - { - Quaternion q; - if (part.LinkNum == 0 || part.LinkNum == 1) // unlinked or root prim - { - if (part.ParentGroup.RootPart.AttachmentPoint != 0) - { - ScenePresence avatar = World.GetScenePresence(part.AttachedAvatar); - if (avatar != null) - if ((avatar.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0) - q = avatar.CameraRotation; // Mouselook - else - q = avatar.Rotation; // Currently infrequently updated so may be inaccurate - else - q = part.ParentGroup.GroupRotation; // Likely never get here but just in case - } - else - q = part.ParentGroup.GroupRotation; // just the group rotation - return new LSL_Rotation(q.X, q.Y, q.Z, q.W); - } - q = part.GetWorldRotation(); - return new LSL_Rotation(q.X, q.Y, q.Z, q.W); - } - + private LSL_Rotation GetPartRot( SceneObjectPart part ) + { + Quaternion q; + if (part.LinkNum == 0 || part.LinkNum == 1) // unlinked or root prim + { + if (part.ParentGroup.RootPart.AttachmentPoint != 0) + { + ScenePresence avatar = World.GetScenePresence(part.AttachedAvatar); + if (avatar != null) + if ((avatar.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0) + q = avatar.CameraRotation; // Mouselook + else + q = avatar.Rotation; // Currently infrequently updated so may be inaccurate + else + q = part.ParentGroup.GroupRotation; // Likely never get here but just in case + } + else + q = part.ParentGroup.GroupRotation; // just the group rotation + return new LSL_Rotation(q.X, q.Y, q.Z, q.W); + } + q = part.GetWorldRotation(); + return new LSL_Rotation(q.X, q.Y, q.Z, q.W); + } + public LSL_Rotation llGetLocalRot() { m_host.AddScriptLPS(1); -- cgit v1.1 From 01f394d2037be62a3d74e2d28ab9e5644f86a9a2 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 21 Aug 2009 11:14:55 +1000 Subject: * Fleshes more of NPCModule out. * Implements some OSSL commands: key osNpcCreate(string user, string name, vector position, key cloneFrom); void osNpcMoveTo(key npc, vector position); void osNpcSay(key npc, string message); void osNpcRemove(key npc); * Untested. Requires ThreatLevel.High. --- .../Shared/Api/Implementation/OSSL_Api.cs | 52 ++++++++++++++++++++++ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 6 +++ 2 files changed, 58 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 6e3a3ab..fcfa9fc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -37,6 +37,7 @@ using OpenSim; using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Console; +using OpenSim.Region.CoreModules.Avatar.NPC; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes.Hypergrid; @@ -1762,5 +1763,56 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return retVal; } + public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, LSL_Key cloneFrom) + { + CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); + + INPCModule module = World.RequestModuleInterface(); + if (module != null) + { + UUID x = module.CreateNPC(firstname, + lastname, + new Vector3((float) position.x, (float) position.y, (float) position.z), + World, + new UUID(cloneFrom)); + + return new LSL_Key(x.ToString()); + } + return new LSL_Key(UUID.Zero.ToString()); + } + + public void osNpcMoveTo(LSL_Key npc, LSL_Vector position) + { + CheckThreatLevel(ThreatLevel.High, "osNpcMoveTo"); + + INPCModule module = World.RequestModuleInterface(); + if (module != null) + { + Vector3 pos = new Vector3((float) position.x, (float) position.y, (float) position.z); + module.Autopilot(new UUID(npc.m_string), World, pos); + } + } + + public void osNpcSay(LSL_Key npc, string message) + { + CheckThreatLevel(ThreatLevel.High, "osNpcSay"); + + INPCModule module = World.RequestModuleInterface(); + if (module != null) + { + module.Say(new UUID(npc.m_string), World, message); + } + } + + public void osNpcRemove(LSL_Key npc) + { + CheckThreatLevel(ThreatLevel.High, "osNpcRemove"); + + INPCModule module = World.RequestModuleInterface(); + if (module != null) + { + module.DeleteNPC(new UUID(npc.m_string), World); + } + } } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 0be29f2..c24dae8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -149,5 +149,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules); + + key osNpcCreate(string user, string name, vector position, key cloneFrom); + void osNpcMoveTo(key npc, vector position); + void osNpcSay(key npc, string message); + void osNpcRemove(key npc); + } } -- cgit v1.1 From c7e140171e107f373d43d45f2b5969410d4b2d7f Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 21 Aug 2009 11:35:19 +1000 Subject: * Addendum to previous --- .../Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index abdba05..1227ec4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -393,6 +393,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osGetLinkPrimitiveParams(linknumber, rules); } + key osNpcCreate(string user, string name, vector position, key cloneFrom) + { + return m_OSSL_Functions.osNpcCreate(user, name, position, cloneFrom); + } + void osNpcMoveTo(key npc, vector position) + { + m_OSSL_Functions.osNpcMoveTo(npc, position); + } + + void osNpcSay(key npc, string message) + { + m_OSSL_Functions.osNpcSay(npc, message); + } + void osNpcRemove(key npc) + { + m_OSSL_Functions.osNpcRemove(npc); + } public OSSLPrim Prim; -- cgit v1.1 From 7ef3e5f41cf226a5c5ba13fe5ee2f1d1d6ccc7ea Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 21 Aug 2009 11:43:45 +1000 Subject: * Protip: Declare publically accessible functions, as public functions. --- OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 1227ec4..605f67b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -393,20 +393,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osGetLinkPrimitiveParams(linknumber, rules); } - key osNpcCreate(string user, string name, vector position, key cloneFrom) + public key osNpcCreate(string user, string name, vector position, key cloneFrom) { return m_OSSL_Functions.osNpcCreate(user, name, position, cloneFrom); } - void osNpcMoveTo(key npc, vector position) + + public void osNpcMoveTo(key npc, vector position) { m_OSSL_Functions.osNpcMoveTo(npc, position); } - void osNpcSay(key npc, string message) + public void osNpcSay(key npc, string message) { m_OSSL_Functions.osNpcSay(npc, message); } - void osNpcRemove(key npc) + + public void osNpcRemove(key npc) { m_OSSL_Functions.osNpcRemove(npc); } -- cgit v1.1 From f7c5eca978717c0adc16ad28b30b02678ba75892 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 21 Aug 2009 15:12:50 +1000 Subject: * Moves NPC Creation across AppDomains to prevent a major perfomance issue. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index fcfa9fc..6190349 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -31,6 +31,7 @@ using System.Collections.Generic; using System.Runtime.Remoting.Lifetime; using System.Text; using System.Net; +using System.Threading; using OpenMetaverse; using Nini.Config; using OpenSim; @@ -1766,6 +1767,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, LSL_Key cloneFrom) { CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); + //QueueUserWorkItem INPCModule module = World.RequestModuleInterface(); if (module != null) -- cgit v1.1 From 158ad39df0de1c569d24d4ea28dc3952402df101 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Fri, 21 Aug 2009 15:42:36 +0900 Subject: Add copyright header. Formatting cleanup. --- .../Shared/Api/Implementation/LSL_Api.cs | 32 ++++++++++++---------- 1 file changed, 17 insertions(+), 15 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 972e71c..16dd834 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1978,25 +1978,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return new LSL_Rotation(q.X, q.Y, q.Z, q.W); } - private LSL_Rotation GetPartRot( SceneObjectPart part ) + private LSL_Rotation GetPartRot(SceneObjectPart part) { Quaternion q; if (part.LinkNum == 0 || part.LinkNum == 1) // unlinked or root prim { - if (part.ParentGroup.RootPart.AttachmentPoint != 0) - { - ScenePresence avatar = World.GetScenePresence(part.AttachedAvatar); - if (avatar != null) - if ((avatar.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0) - q = avatar.CameraRotation; // Mouselook - else - q = avatar.Rotation; // Currently infrequently updated so may be inaccurate - else - q = part.ParentGroup.GroupRotation; // Likely never get here but just in case - } - else - q = part.ParentGroup.GroupRotation; // just the group rotation - return new LSL_Rotation(q.X, q.Y, q.Z, q.W); + if (part.ParentGroup.RootPart.AttachmentPoint != 0) + { + ScenePresence avatar = World.GetScenePresence(part.AttachedAvatar); + if (avatar != null) + { + if ((avatar.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0) + q = avatar.CameraRotation; // Mouselook + else + q = avatar.Rotation; // Currently infrequently updated so may be inaccurate + } + else + q = part.ParentGroup.GroupRotation; // Likely never get here but just in case + } + else + q = part.ParentGroup.GroupRotation; // just the group rotation + return new LSL_Rotation(q.X, q.Y, q.Z, q.W); } q = part.GetWorldRotation(); return new LSL_Rotation(q.X, q.Y, q.Z, q.W); -- cgit v1.1 From 7923fd29a019eae168b6793ed6e388bc27bc288e Mon Sep 17 00:00:00 2001 From: Arthur Valadares Date: Fri, 21 Aug 2009 21:12:22 -0300 Subject: Adds osDrawPolygon to OSSL. Works a little different then other OS Drawing functions, this one has no start and end point, but a number of points that will form the desired polygon. Only FilledPolygon implemented so far. * Also added some LSL transparent type conversion, as it's done in LSL scripting (string to integer, float to string, etc) --- .../Shared/Api/Implementation/OSSL_Api.cs | 19 ++++++++++ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 1 + .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 5 +++ OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 43 ++++++++++++++++++---- 4 files changed, 61 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 6190349..b40e441 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -833,6 +833,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return drawList; } + public string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y) + { + CheckThreatLevel(ThreatLevel.None, "osDrawFilledPolygon"); + + m_host.AddScriptLPS(1); + + if (x.Length != y.Length || x.Length < 3) + { + return ""; + } + drawList += "FillPolygon " + x.GetLSLStringItem(0) + "," + y.GetLSLStringItem(0); + for (int i = 1; i < x.Length; i++) + { + drawList += "," + x.GetLSLStringItem(i) + "," + y.GetLSLStringItem(i); + } + drawList += "; "; + return drawList; + } + public string osSetFontSize(string drawList, int fontSize) { CheckThreatLevel(ThreatLevel.None, "osSetFontSize"); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index c24dae8..202bf41 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -97,6 +97,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces string osDrawEllipse(string drawList, int width, int height); string osDrawRectangle(string drawList, int width, int height); string osDrawFilledRectangle(string drawList, int width, int height); + string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y); string osSetFontSize(string drawList, int fontSize); string osSetPenSize(string drawList, int penSize); string osSetPenColour(string drawList, string colour); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 605f67b..b6bfb43 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -267,6 +267,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osDrawFilledRectangle(drawList, width, height); } + public string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y) + { + return m_OSSL_Functions.osDrawFilledPolygon(drawList, x, y); + } + public string osSetFontSize(string drawList, int fontSize) { return m_OSSL_Functions.osSetFontSize(drawList, fontSize); diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index bdacf8b..2842f6b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -439,6 +439,13 @@ namespace OpenSim.Region.ScriptEngine.Shared set {m_data = value; } } + // Function to obtain LSL type from an index. This is needed + // because LSL lists allow for multiple types, and safely + // iterating in them requires a type check. + public Type GetLSLListItemType(int itemIndex) + { + return m_data[itemIndex].GetType(); + } // Member functions to obtain item as specific types. // For cases where implicit conversions would apply if items @@ -465,6 +472,10 @@ namespace OpenSim.Region.ScriptEngine.Shared { return new LSL_Types.LSLFloat((Double)m_data[itemIndex]); } + else if (m_data[itemIndex] is LSL_Types.LSLString) + { + return new LSL_Types.LSLFloat(m_data[itemIndex].ToString()); + } else { return (LSL_Types.LSLFloat)m_data[itemIndex]; @@ -481,20 +492,32 @@ namespace OpenSim.Region.ScriptEngine.Shared { return new LSL_Types.LSLString((string)m_data[itemIndex]); } + else if (m_data[itemIndex] is LSL_Types.LSLFloat) + { + return new LSL_Types.LSLString((LSLFloat)m_data[itemIndex]); + } + else if (m_data[itemIndex] is LSL_Types.LSLInteger) + { + return new LSL_Types.LSLString((LSLInteger)m_data[itemIndex]); + } else { - return (LSL_Types.LSLString)m_data[itemIndex]; + return (LSL_Types.LSLString)m_data[itemIndex]; } } public LSL_Types.LSLInteger GetLSLIntegerItem(int itemIndex) { - if (m_data[itemIndex] is LSL_Types.LSLInteger) - return (LSL_Types.LSLInteger)m_data[itemIndex]; - else if (m_data[itemIndex] is Int32) - return new LSLInteger((int)m_data[itemIndex]); - else - throw new InvalidCastException(); + if (m_data[itemIndex] is LSL_Types.LSLInteger) + return (LSL_Types.LSLInteger)m_data[itemIndex]; + if (m_data[itemIndex] is LSL_Types.LSLFloat) + return new LSLInteger((int)m_data[itemIndex]); + else if (m_data[itemIndex] is Int32) + return new LSLInteger((int)m_data[itemIndex]); + else if (m_data[itemIndex] is LSL_Types.LSLString) + return new LSLInteger((string)m_data[itemIndex]); + else + throw new InvalidCastException(); } public LSL_Types.Vector3 GetVector3Item(int itemIndex) @@ -1331,6 +1354,12 @@ namespace OpenSim.Region.ScriptEngine.Shared m_string=s; } + public LSLString(LSLInteger i) + { + string s = String.Format("{0}", i); + m_string = s; + } + #endregion #region Operators -- cgit v1.1 From efb287f28f89eee06c6b90ad13297a2d33058409 Mon Sep 17 00:00:00 2001 From: Arthur Valadares Date: Tue, 25 Aug 2009 10:32:45 -0300 Subject: Implemented osPenCap, that sets EndCap and StartCap to Pen. This allows using arrow, diamond, round and flat caps. * Made image request safer, if it can't find an image for any reason, draws a square where the image should be and a message alerting the user. --- .../Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 9 +++++++++ OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 1 + OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 5 +++++ 3 files changed, 15 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index b40e441..b1c357c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -879,6 +879,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return drawList; } + public string osSetPenCap(string drawList, string direction, string type) + { + CheckThreatLevel(ThreatLevel.None, "osSetPenColour"); + + m_host.AddScriptLPS(1); + drawList += "PenCap " + direction + "," + type + "; "; + return drawList; + } + public string osDrawImage(string drawList, int width, int height, string imageUrl) { CheckThreatLevel(ThreatLevel.None, "osDrawImage"); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 202bf41..2365bee 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -101,6 +101,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces string osSetFontSize(string drawList, int fontSize); string osSetPenSize(string drawList, int penSize); string osSetPenColour(string drawList, string colour); + string osSetPenCap(string drawList, string direction, string type); string osDrawImage(string drawList, int width, int height, string imageUrl); vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize); void osSetStateEvents(int events); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index b6bfb43..f877acb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -282,6 +282,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osSetPenSize(drawList, penSize); } + public string osSetPenCap(string drawList, string direction, string type) + { + return m_OSSL_Functions.osSetPenCap(drawList, direction, type); + } + public string osSetPenColour(string drawList, string colour) { return m_OSSL_Functions.osSetPenColour(drawList, colour); -- cgit v1.1