From 575825193b51d13c6576aabe1bbaf1f3dda1fad8 Mon Sep 17 00:00:00 2001 From: Mandarinka Tasty Date: Fri, 9 Dec 2016 20:46:27 +0100 Subject: The new string-parameter: "region_object_bonus" for llGetEnv(string name); Signed-off-by: Mandarinka Tasty Signed-off-by: UbitUmarov --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 4 ++++ 1 file changed, 4 insertions(+) (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 71e8ca9..7efdc62 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6307,6 +6307,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { return World.RegionInfo.ObjectCapacity.ToString(); } + else if (name == "region_object_bonus") + { + return World.RegionInfo.RegionSettings.ObjectBonus.ToString(); + } else { return ""; -- cgit v1.1 From ec883d0f1504e8573f763882231cb1da06bdc2a1 Mon Sep 17 00:00:00 2001 From: Mandarinka Tasty Date: Wed, 14 Dec 2016 01:14:23 +0100 Subject: New OSSL function: osNpcSetProfileImage(LSL_Key npc, string image); This patch gives possibility to set image in created NPC's profile. You can use UUID of the texture or name of texture included in prim's inventory. Signed-off-by: Mandarinka Tasty Signed-off-by: UbitUmarov --- .../Shared/Api/Implementation/OSSL_Api.cs | 29 ++++++++++++++++++++++ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 1 + .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 5 ++++ 3 files changed, 35 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 b101cf9..dd4da0a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -3018,6 +3018,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } + public void osNpcSetProfileImage(LSL_Key npc, string image) + { + CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); + m_host.AddScriptLPS(1); + + INPCModule module = World.RequestModuleInterface(); + if (module != null) + { + UUID npcId = new UUID(npc.m_string); + + if (!module.CheckPermissions(npcId, m_host.OwnerID)) + return; + + UUID ImageID = new UUID(); + + ImageID = ScriptUtils.GetAssetIdFromItemName(m_host, image, (int)AssetType.Texture); + + if (ImageID == null || ImageID == UUID.Zero) + { + if (!UUID.TryParse(image, out ImageID)) + return; + } + + ScenePresence sp = World.GetScenePresence(npcId); + if (sp != null) + ((INPC)(sp.ControllingClient)).profileImage = ImageID; + } + } + public void osNpcSay(LSL_Key npc, string message) { osNpcSay(npc, 0, message); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 87b0967..cf3e6df 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -344,6 +344,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces void osNpcSetRot(LSL_Key npc, rotation rot); void osNpcStopMoveToTarget(LSL_Key npc); void osNpcSetProfileAbout(LSL_Key npc, string about); + void osNpcSetProfileImage(LSL_Key npc, string image); void osNpcSay(key npc, string message); void osNpcSay(key npc, int channel, string message); void osNpcShout(key npc, int channel, string message); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 5bc998e..2e8a76c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -642,6 +642,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase m_OSSL_Functions.osNpcSetProfileAbout(npc, about); } + public void osNpcSetProfileImage(LSL_Key npc, string image) + { + m_OSSL_Functions.osNpcSetProfileImage(npc, image); + } + public void osNpcSay(key npc, string message) { m_OSSL_Functions.osNpcSay(npc, message); -- cgit v1.1 From a75c16e1bfee8679f61e513426e876635b3345cf Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 14 Dec 2016 01:00:48 +0000 Subject: Fox threat level line on SetProfileImage. It is ALWAYS the name of the function! Low is justified because setting an image requires having a NPC in the first place.... --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_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/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index dd4da0a..a827e30 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -3020,7 +3020,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcSetProfileImage(LSL_Key npc, string image) { - CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); + CheckThreatLevel(ThreatLevel.Low, "osNpcSetProfileImage"); m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); -- cgit v1.1 From 1c08b3d8f9e10ba11b70e99a92b7ca1272079a94 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 14 Dec 2016 01:16:21 +0000 Subject: also fox chekc threat level on osNpcSetProfileAbout --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_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/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index a827e30..bdecf72 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -3001,7 +3001,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcSetProfileAbout(LSL_Key npc, string about) { - CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); + CheckThreatLevel(ThreatLevel.High, "osNpcSetProfileAbout"); m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); -- cgit v1.1 From 1ffc81c8690b039a578155fb76bbbd2307ae3ebc Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 14 Dec 2016 01:31:16 +0000 Subject: also reduce check threat level of osNpcSetProfileAbout to Low; update osslEnable.ini --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_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/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index bdecf72..9742119 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -3001,7 +3001,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcSetProfileAbout(LSL_Key npc, string about) { - CheckThreatLevel(ThreatLevel.High, "osNpcSetProfileAbout"); + CheckThreatLevel(ThreatLevel.Low, "osNpcSetProfileAbout"); m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); -- cgit v1.1