diff options
author | Melanie Thielker | 2016-07-18 11:12:14 +0100 |
---|---|---|
committer | Melanie Thielker | 2016-07-18 11:12:14 +0100 |
commit | 2cffa71be20fe6d35d7ba4d54d4fd3476dd68cda (patch) | |
tree | 874aacb99103723bc028a71a305a24c9c40031d2 /OpenSim | |
parent | dont try dequeues if didnt reacquired lock (diff) | |
download | opensim-SC_OLD-2cffa71be20fe6d35d7ba4d54d4fd3476dd68cda.zip opensim-SC_OLD-2cffa71be20fe6d35d7ba4d54d4fd3476dd68cda.tar.gz opensim-SC_OLD-2cffa71be20fe6d35d7ba4d54d4fd3476dd68cda.tar.bz2 opensim-SC_OLD-2cffa71be20fe6d35d7ba4d54d4fd3476dd68cda.tar.xz |
Add some additional checks to llTransferLindenDollars.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/IMoneyModule.cs | 7 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 22 |
2 files changed, 23 insertions, 6 deletions
diff --git a/OpenSim/Framework/IMoneyModule.cs b/OpenSim/Framework/IMoneyModule.cs index 55c9613..be45438 100644 --- a/OpenSim/Framework/IMoneyModule.cs +++ b/OpenSim/Framework/IMoneyModule.cs | |||
@@ -32,14 +32,13 @@ namespace OpenSim.Framework | |||
32 | public delegate void ObjectPaid(UUID objectID, UUID agentID, int amount); | 32 | public delegate void ObjectPaid(UUID objectID, UUID agentID, int amount); |
33 | public interface IMoneyModule | 33 | public interface IMoneyModule |
34 | { | 34 | { |
35 | bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, | 35 | bool ObjectGiveMoney(UUID objectID, UUID fromID, |
36 | int amount, UUID txn, out string reason); | 36 | UUID toID, int amount, UUID txn, out string reason); |
37 | 37 | ||
38 | int GetBalance(UUID agentID); | 38 | int GetBalance(UUID agentID); |
39 | bool UploadCovered(UUID agentID, int amount); | 39 | bool UploadCovered(UUID agentID, int amount); |
40 | bool AmountCovered(UUID agentID, int amount); | 40 | bool AmountCovered(UUID agentID, int amount); |
41 | void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type); | 41 | void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type, string extraData = ""); |
42 | void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type, string extraData); | ||
43 | void ApplyUploadCharge(UUID agentID, int amount, string text); | 42 | void ApplyUploadCharge(UUID agentID, int amount, string text); |
44 | void MoveMoney(UUID fromUser, UUID toUser, int amount, string text); | 43 | void MoveMoney(UUID fromUser, UUID toUser, int amount, string text); |
45 | 44 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 064eb0a..6d2e2c8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -15678,6 +15678,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
15678 | 15678 | ||
15679 | try | 15679 | try |
15680 | { | 15680 | { |
15681 | if (amount <= 0) | ||
15682 | { | ||
15683 | replydata = "INVALID_AMOUNT"; | ||
15684 | return; | ||
15685 | } | ||
15686 | |||
15681 | TaskInventoryItem item = m_item; | 15687 | TaskInventoryItem item = m_item; |
15682 | if (item == null) | 15688 | if (item == null) |
15683 | { | 15689 | { |
@@ -15685,6 +15691,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
15685 | return; | 15691 | return; |
15686 | } | 15692 | } |
15687 | 15693 | ||
15694 | if (m_host.OwnerID == m_host.GroupID) | ||
15695 | { | ||
15696 | replydata = "GROUP_OWNED"; | ||
15697 | return; | ||
15698 | } | ||
15699 | |||
15688 | m_host.AddScriptLPS(1); | 15700 | m_host.AddScriptLPS(1); |
15689 | 15701 | ||
15690 | if (item.PermsGranter == UUID.Zero) | 15702 | if (item.PermsGranter == UUID.Zero) |
@@ -15707,6 +15719,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
15707 | return; | 15719 | return; |
15708 | } | 15720 | } |
15709 | 15721 | ||
15722 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, toID); | ||
15723 | if (account == null) | ||
15724 | { | ||
15725 | replydata = "LINDENDOLLAR_ENTITYDOESNOTEXIST"; | ||
15726 | return; | ||
15727 | } | ||
15728 | |||
15710 | IMoneyModule money = World.RequestModuleInterface<IMoneyModule>(); | 15729 | IMoneyModule money = World.RequestModuleInterface<IMoneyModule>(); |
15711 | 15730 | ||
15712 | if (money == null) | 15731 | if (money == null) |
@@ -15716,8 +15735,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
15716 | } | 15735 | } |
15717 | 15736 | ||
15718 | string reason; | 15737 | string reason; |
15719 | bool result = money.ObjectGiveMoney( | 15738 | bool result = money.ObjectGiveMoney( m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount, txn, out reason); |
15720 | m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount, txn, out reason); | ||
15721 | 15739 | ||
15722 | if (result) | 15740 | if (result) |
15723 | { | 15741 | { |