diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 6e3a3ab..b1c357c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -31,12 +31,14 @@ using System.Collections.Generic; | |||
31 | using System.Runtime.Remoting.Lifetime; | 31 | using System.Runtime.Remoting.Lifetime; |
32 | using System.Text; | 32 | using System.Text; |
33 | using System.Net; | 33 | using System.Net; |
34 | using System.Threading; | ||
34 | using OpenMetaverse; | 35 | using OpenMetaverse; |
35 | using Nini.Config; | 36 | using Nini.Config; |
36 | using OpenSim; | 37 | using OpenSim; |
37 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Communications.Cache; | 39 | using OpenSim.Framework.Communications.Cache; |
39 | using OpenSim.Framework.Console; | 40 | using OpenSim.Framework.Console; |
41 | using OpenSim.Region.CoreModules.Avatar.NPC; | ||
40 | using OpenSim.Region.Framework.Interfaces; | 42 | using OpenSim.Region.Framework.Interfaces; |
41 | using OpenSim.Region.Framework.Scenes; | 43 | using OpenSim.Region.Framework.Scenes; |
42 | using OpenSim.Region.Framework.Scenes.Hypergrid; | 44 | using OpenSim.Region.Framework.Scenes.Hypergrid; |
@@ -831,6 +833,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
831 | return drawList; | 833 | return drawList; |
832 | } | 834 | } |
833 | 835 | ||
836 | public string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y) | ||
837 | { | ||
838 | CheckThreatLevel(ThreatLevel.None, "osDrawFilledPolygon"); | ||
839 | |||
840 | m_host.AddScriptLPS(1); | ||
841 | |||
842 | if (x.Length != y.Length || x.Length < 3) | ||
843 | { | ||
844 | return ""; | ||
845 | } | ||
846 | drawList += "FillPolygon " + x.GetLSLStringItem(0) + "," + y.GetLSLStringItem(0); | ||
847 | for (int i = 1; i < x.Length; i++) | ||
848 | { | ||
849 | drawList += "," + x.GetLSLStringItem(i) + "," + y.GetLSLStringItem(i); | ||
850 | } | ||
851 | drawList += "; "; | ||
852 | return drawList; | ||
853 | } | ||
854 | |||
834 | public string osSetFontSize(string drawList, int fontSize) | 855 | public string osSetFontSize(string drawList, int fontSize) |
835 | { | 856 | { |
836 | CheckThreatLevel(ThreatLevel.None, "osSetFontSize"); | 857 | CheckThreatLevel(ThreatLevel.None, "osSetFontSize"); |
@@ -858,6 +879,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
858 | return drawList; | 879 | return drawList; |
859 | } | 880 | } |
860 | 881 | ||
882 | public string osSetPenCap(string drawList, string direction, string type) | ||
883 | { | ||
884 | CheckThreatLevel(ThreatLevel.None, "osSetPenColour"); | ||
885 | |||
886 | m_host.AddScriptLPS(1); | ||
887 | drawList += "PenCap " + direction + "," + type + "; "; | ||
888 | return drawList; | ||
889 | } | ||
890 | |||
861 | public string osDrawImage(string drawList, int width, int height, string imageUrl) | 891 | public string osDrawImage(string drawList, int width, int height, string imageUrl) |
862 | { | 892 | { |
863 | CheckThreatLevel(ThreatLevel.None, "osDrawImage"); | 893 | CheckThreatLevel(ThreatLevel.None, "osDrawImage"); |
@@ -1762,5 +1792,57 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1762 | return retVal; | 1792 | return retVal; |
1763 | } | 1793 | } |
1764 | 1794 | ||
1795 | public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, LSL_Key cloneFrom) | ||
1796 | { | ||
1797 | CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); | ||
1798 | //QueueUserWorkItem | ||
1799 | |||
1800 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | ||
1801 | if (module != null) | ||
1802 | { | ||
1803 | UUID x = module.CreateNPC(firstname, | ||
1804 | lastname, | ||
1805 | new Vector3((float) position.x, (float) position.y, (float) position.z), | ||
1806 | World, | ||
1807 | new UUID(cloneFrom)); | ||
1808 | |||
1809 | return new LSL_Key(x.ToString()); | ||
1810 | } | ||
1811 | return new LSL_Key(UUID.Zero.ToString()); | ||
1812 | } | ||
1813 | |||
1814 | public void osNpcMoveTo(LSL_Key npc, LSL_Vector position) | ||
1815 | { | ||
1816 | CheckThreatLevel(ThreatLevel.High, "osNpcMoveTo"); | ||
1817 | |||
1818 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | ||
1819 | if (module != null) | ||
1820 | { | ||
1821 | Vector3 pos = new Vector3((float) position.x, (float) position.y, (float) position.z); | ||
1822 | module.Autopilot(new UUID(npc.m_string), World, pos); | ||
1823 | } | ||
1824 | } | ||
1825 | |||
1826 | public void osNpcSay(LSL_Key npc, string message) | ||
1827 | { | ||
1828 | CheckThreatLevel(ThreatLevel.High, "osNpcSay"); | ||
1829 | |||
1830 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | ||
1831 | if (module != null) | ||
1832 | { | ||
1833 | module.Say(new UUID(npc.m_string), World, message); | ||
1834 | } | ||
1835 | } | ||
1836 | |||
1837 | public void osNpcRemove(LSL_Key npc) | ||
1838 | { | ||
1839 | CheckThreatLevel(ThreatLevel.High, "osNpcRemove"); | ||
1840 | |||
1841 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | ||
1842 | if (module != null) | ||
1843 | { | ||
1844 | module.DeleteNPC(new UUID(npc.m_string), World); | ||
1845 | } | ||
1846 | } | ||
1765 | } | 1847 | } |
1766 | } | 1848 | } |