diff options
author | Melanie Thielker | 2010-07-02 06:20:36 +0200 |
---|---|---|
committer | Melanie | 2010-07-02 06:13:58 +0100 |
commit | e15f6905a53d686e3de9c2e16e842f3b735c3685 (patch) | |
tree | 414400c1ec6dc391afe69ff3b2344de6e7cd12ff | |
parent | Remove GetEconomyData and the economy data structure (unused) (diff) | |
download | opensim-SC-e15f6905a53d686e3de9c2e16e842f3b735c3685.zip opensim-SC-e15f6905a53d686e3de9c2e16e842f3b735c3685.tar.gz opensim-SC-e15f6905a53d686e3de9c2e16e842f3b735c3685.tar.bz2 opensim-SC-e15f6905a53d686e3de9c2e16e842f3b735c3685.tar.xz |
Clean up IMoneyModule and adjust the other modules to the changes
Diffstat (limited to '')
6 files changed, 26 insertions, 26 deletions
diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs index 62a1e17..da953bb 100644 --- a/OpenSim/Framework/Capabilities/Caps.cs +++ b/OpenSim/Framework/Capabilities/Caps.cs | |||
@@ -814,7 +814,7 @@ namespace OpenSim.Framework.Capabilities | |||
814 | 814 | ||
815 | if (mm != null) | 815 | if (mm != null) |
816 | { | 816 | { |
817 | if (!mm.UploadCovered(client)) | 817 | if (!mm.UploadCovered(client, mm.UploadCharge)) |
818 | { | 818 | { |
819 | if (client != null) | 819 | if (client != null) |
820 | client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); | 820 | client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); |
diff --git a/OpenSim/Framework/IMoneyModule.cs b/OpenSim/Framework/IMoneyModule.cs index 17e74a0..3d4873d 100644 --- a/OpenSim/Framework/IMoneyModule.cs +++ b/OpenSim/Framework/IMoneyModule.cs | |||
@@ -35,13 +35,14 @@ namespace OpenSim.Framework | |||
35 | bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, | 35 | bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, |
36 | int amount); | 36 | int amount); |
37 | 37 | ||
38 | int GetBalance(IClientAPI client); | 38 | int GetBalance(UUID agentID); |
39 | void ApplyUploadCharge(UUID agentID); | 39 | bool UploadCovered(IClientAPI client, int amount); |
40 | bool UploadCovered(IClientAPI client); | ||
41 | void ApplyGroupCreationCharge(UUID agentID); | ||
42 | bool GroupCreationCovered(IClientAPI client); | ||
43 | bool AmountCovered(IClientAPI client, int amount); | 40 | bool AmountCovered(IClientAPI client, int amount); |
44 | void ApplyCharge(UUID agentID, int amount, string text); | 41 | void ApplyCharge(UUID agentID, int amount, string text); |
42 | void ApplyUploadCharge(UUID agentID, int amount, string text); | ||
43 | |||
44 | int UploadCharge { get; } | ||
45 | int GroupCreationCharge { get; } | ||
45 | 46 | ||
46 | event ObjectPaid OnObjectPaid; | 47 | event ObjectPaid OnObjectPaid; |
47 | } | 48 | } |
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs index 7e08ecf..ae31050 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs | |||
@@ -243,7 +243,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
243 | 243 | ||
244 | if (mm != null) | 244 | if (mm != null) |
245 | { | 245 | { |
246 | if (!mm.UploadCovered(remoteClient)) | 246 | if (!mm.UploadCovered(remoteClient, mm.UploadCharge)) |
247 | { | 247 | { |
248 | remoteClient.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); | 248 | remoteClient.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); |
249 | return; | 249 | return; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index f9da341..33173dd 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -73,7 +73,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
73 | IMoneyModule money=RequestModuleInterface<IMoneyModule>(); | 73 | IMoneyModule money=RequestModuleInterface<IMoneyModule>(); |
74 | if (money != null) | 74 | if (money != null) |
75 | { | 75 | { |
76 | money.ApplyUploadCharge(agentID); | 76 | money.ApplyUploadCharge(agentID, money.UploadCharge, "Asset upload"); |
77 | } | 77 | } |
78 | 78 | ||
79 | AddInventoryItem(agentID, item); | 79 | AddInventoryItem(agentID, item); |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 56c0d98..3f15b69 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | |||
@@ -722,11 +722,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
722 | if (money != null) | 722 | if (money != null) |
723 | { | 723 | { |
724 | // do the transaction, that is if the agent has got sufficient funds | 724 | // do the transaction, that is if the agent has got sufficient funds |
725 | if (!money.GroupCreationCovered(remoteClient)) { | 725 | if (!money.AmountCovered(remoteClient, money.GroupCreationCharge)) { |
726 | remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got issuficient funds to create a group."); | 726 | remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got issuficient funds to create a group."); |
727 | return UUID.Zero; | 727 | return UUID.Zero; |
728 | } | 728 | } |
729 | money.ApplyGroupCreationCharge(GetRequestingAgentID(remoteClient)); | 729 | money.ApplyCharge(GetRequestingAgentID(remoteClient), money.GroupCreationCharge, "Group Creation"); |
730 | } | 730 | } |
731 | UUID groupID = m_groupData.CreateGroup(GetRequestingAgentID(remoteClient), name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, GetRequestingAgentID(remoteClient)); | 731 | UUID groupID = m_groupData.CreateGroup(GetRequestingAgentID(remoteClient), name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, GetRequestingAgentID(remoteClient)); |
732 | 732 | ||
diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index e070077..6f5ef9e 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs | |||
@@ -108,6 +108,16 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
108 | 108 | ||
109 | public event ObjectPaid OnObjectPaid; | 109 | public event ObjectPaid OnObjectPaid; |
110 | 110 | ||
111 | public int UploadCharge | ||
112 | { | ||
113 | get { return 0; } | ||
114 | } | ||
115 | |||
116 | public int GroupCreationCharge | ||
117 | { | ||
118 | get { return 0; } | ||
119 | } | ||
120 | |||
111 | /// <summary> | 121 | /// <summary> |
112 | /// Startup | 122 | /// Startup |
113 | /// </summary> | 123 | /// </summary> |
@@ -188,15 +198,10 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
188 | // Please do not refactor these to be just one method | 198 | // Please do not refactor these to be just one method |
189 | // Existing implementations need the distinction | 199 | // Existing implementations need the distinction |
190 | // | 200 | // |
191 | public void ApplyUploadCharge(UUID agentID) | 201 | public void ApplyCharge(UUID agentID, int amount, string text) |
192 | { | ||
193 | } | ||
194 | |||
195 | public void ApplyGroupCreationCharge(UUID agentID) | ||
196 | { | 202 | { |
197 | } | 203 | } |
198 | 204 | public void ApplyUploadCharge(UUID agentID, int amount, string text) | |
199 | public void ApplyCharge(UUID agentID, int amount, string text) | ||
200 | { | 205 | { |
201 | } | 206 | } |
202 | 207 | ||
@@ -769,7 +774,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
769 | //m_log.Info("[FRIEND]: " + avatar.Name + " status:" + (!avatar.IsChildAgent).ToString()); | 774 | //m_log.Info("[FRIEND]: " + avatar.Name + " status:" + (!avatar.IsChildAgent).ToString()); |
770 | } | 775 | } |
771 | 776 | ||
772 | public int GetBalance(IClientAPI client) | 777 | public int GetBalance(UUID agentID) |
773 | { | 778 | { |
774 | return 0; | 779 | return 0; |
775 | } | 780 | } |
@@ -777,16 +782,10 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
777 | // Please do not refactor these to be just one method | 782 | // Please do not refactor these to be just one method |
778 | // Existing implementations need the distinction | 783 | // Existing implementations need the distinction |
779 | // | 784 | // |
780 | public bool UploadCovered(IClientAPI client) | 785 | public bool UploadCovered(IClientAPI client, int amount) |
781 | { | ||
782 | return AmountCovered(client, PriceUpload); | ||
783 | } | ||
784 | |||
785 | public bool GroupCreationCovered(IClientAPI client) | ||
786 | { | 786 | { |
787 | return AmountCovered(client, PriceGroupCreate); | 787 | return true; |
788 | } | 788 | } |
789 | |||
790 | public bool AmountCovered(IClientAPI client, int amount) | 789 | public bool AmountCovered(IClientAPI client, int amount) |
791 | { | 790 | { |
792 | return true; | 791 | return true; |