From 3ddaa3a9e6d50d048838f00de5922ce5b3a5b1bf Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 15 Aug 2020 22:25:29 +0100 Subject: [PATCH] change llGivemoney (like last commit, so it runs on a limited threadpool not the main one --- .../Shared/Api/Implementation/LSL_Api.cs | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 62c021f54d..8cab070e9c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3468,39 +3468,39 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGiveMoney(LSL_Key destination, LSL_Integer amount) { - Util.FireAndForget(x => + m_host.AddScriptLPS(1); + + if (m_item.PermsGranter == UUID.Zero) + return 0; + + if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_DEBIT) == 0) { - m_host.AddScriptLPS(1); + Error("llGiveMoney", "No permissions to give money"); + return 0; + } - if (m_item.PermsGranter == UUID.Zero) - return; + UUID toID = new UUID(); - if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_DEBIT) == 0) - { - Error("llGiveMoney", "No permissions to give money"); - return; - } + if (!UUID.TryParse(destination, out toID)) + { + Error("llGiveMoney", "Bad key in llGiveMoney"); + return 0; + } - UUID toID = new UUID(); - - if (!UUID.TryParse(destination, out toID)) - { - Error("llGiveMoney", "Bad key in llGiveMoney"); - return; - } - - IMoneyModule money = World.RequestModuleInterface(); - - if (money == null) - { - NotImplemented("llGiveMoney"); - return; - } + IMoneyModule money = World.RequestModuleInterface(); + if (money == null) + { + NotImplemented("llGiveMoney"); + return 0; + } + Action act = dontcare => + { money.ObjectGiveMoney(m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount,UUID.Zero, out string reason); - }, null, "LSL_Api.llGiveMoney"); + }; + m_AsyncCommands.DataserverPlugin.RegisterRequest(m_host.LocalId, m_item.ItemID, act); return 0; }