From 4e0a424f9f03278504a5daac611659eecdf602b6 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 14 Nov 2008 07:56:34 +0000 Subject: Some changes to the money module to allow a more flexible system of applying charges --- .../Avatar/Currency/SampleMoney/SampleMoneyModule.cs | 19 ++++++++++++------- OpenSim/Region/Interfaces/IMoneyModule.cs | 2 ++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs index c8050da..a465cf8 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs @@ -191,6 +191,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney { } + public void ApplyCharge(UUID agentID, int amount, string text) + { + } + public bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, int amount) { string description = String.Format("Object {0} pays {1}", resolveObjectName(objectID), resolveAgentName(toID)); @@ -1508,20 +1512,21 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney } } - public bool UploadCovered(IClientAPI client) + public bool AmountCovered(IClientAPI client, int amount) { - if (GetBalance(client) < PriceUpload) + if (GetBalance(client) < amount) return false; - return true; } - public bool GroupCreationCovered(IClientAPI client) + public bool UploadCovered(IClientAPI client) { - if (GetBalance(client) < PriceGroupCreate) - return false; + return AmountCovered(client, PriceUpload); + } - return true; + public bool GroupCreationCovered(IClientAPI client) + { + return AmountCovered(client, PriceGroupCreate); } #endregion diff --git a/OpenSim/Region/Interfaces/IMoneyModule.cs b/OpenSim/Region/Interfaces/IMoneyModule.cs index 5797af0..1fa4f13 100644 --- a/OpenSim/Region/Interfaces/IMoneyModule.cs +++ b/OpenSim/Region/Interfaces/IMoneyModule.cs @@ -42,6 +42,8 @@ namespace OpenSim.Region.Interfaces bool UploadCovered(IClientAPI client); void ApplyGroupCreationCharge(UUID agentID); bool GroupCreationCovered(IClientAPI client); + bool AmountCovered(IClientAPI client, int amount); + void ApplyCharge(UUID agentID, int amount, string text); event ObjectPaid OnObjectPaid; } -- cgit v1.1