Add some additional checks to llTransferLindenDollars.
parent
9b4e83caa0
commit
2cffa71be2
|
@ -32,14 +32,13 @@ namespace OpenSim.Framework
|
||||||
public delegate void ObjectPaid(UUID objectID, UUID agentID, int amount);
|
public delegate void ObjectPaid(UUID objectID, UUID agentID, int amount);
|
||||||
public interface IMoneyModule
|
public interface IMoneyModule
|
||||||
{
|
{
|
||||||
bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID,
|
bool ObjectGiveMoney(UUID objectID, UUID fromID,
|
||||||
int amount, UUID txn, out string reason);
|
UUID toID, int amount, UUID txn, out string reason);
|
||||||
|
|
||||||
int GetBalance(UUID agentID);
|
int GetBalance(UUID agentID);
|
||||||
bool UploadCovered(UUID agentID, int amount);
|
bool UploadCovered(UUID agentID, int amount);
|
||||||
bool AmountCovered(UUID agentID, int amount);
|
bool AmountCovered(UUID agentID, int amount);
|
||||||
void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type);
|
void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type, string extraData = "");
|
||||||
void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type, string extraData);
|
|
||||||
void ApplyUploadCharge(UUID agentID, int amount, string text);
|
void ApplyUploadCharge(UUID agentID, int amount, string text);
|
||||||
void MoveMoney(UUID fromUser, UUID toUser, int amount, string text);
|
void MoveMoney(UUID fromUser, UUID toUser, int amount, string text);
|
||||||
|
|
||||||
|
|
|
@ -15678,6 +15678,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
if (amount <= 0)
|
||||||
|
{
|
||||||
|
replydata = "INVALID_AMOUNT";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
TaskInventoryItem item = m_item;
|
TaskInventoryItem item = m_item;
|
||||||
if (item == null)
|
if (item == null)
|
||||||
{
|
{
|
||||||
|
@ -15685,6 +15691,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_host.OwnerID == m_host.GroupID)
|
||||||
|
{
|
||||||
|
replydata = "GROUP_OWNED";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
if (item.PermsGranter == UUID.Zero)
|
if (item.PermsGranter == UUID.Zero)
|
||||||
|
@ -15707,6 +15719,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, toID);
|
||||||
|
if (account == null)
|
||||||
|
{
|
||||||
|
replydata = "LINDENDOLLAR_ENTITYDOESNOTEXIST";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
IMoneyModule money = World.RequestModuleInterface<IMoneyModule>();
|
IMoneyModule money = World.RequestModuleInterface<IMoneyModule>();
|
||||||
|
|
||||||
if (money == null)
|
if (money == null)
|
||||||
|
@ -15716,8 +15735,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
|
|
||||||
string reason;
|
string reason;
|
||||||
bool result = money.ObjectGiveMoney(
|
bool result = money.ObjectGiveMoney( m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount, txn, out reason);
|
||||||
m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount, txn, out reason);
|
|
||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue