mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
change llGivemoney (like last commit, so it runs on a limited threadpool not the main one
This commit is contained in:
@@ -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<IMoneyModule>();
|
||||
|
||||
if (money == null)
|
||||
{
|
||||
NotImplemented("llGiveMoney");
|
||||
return;
|
||||
}
|
||||
IMoneyModule money = World.RequestModuleInterface<IMoneyModule>();
|
||||
if (money == null)
|
||||
{
|
||||
NotImplemented("llGiveMoney");
|
||||
return 0;
|
||||
}
|
||||
|
||||
Action<string> 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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user