From d1cebc351e14b0f53851dfcc51c4c75f76ce3bb8 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Fri, 19 Apr 2013 15:51:41 +0200 Subject: [PATCH] Rename mods --> officers in souce code and minor touches to the economy integration. --- .../factions/cmd/CmdFactionsShow.java | 4 ++-- .../factions/integration/Econ.java | 18 +++++++----------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsShow.java b/src/com/massivecraft/factions/cmd/CmdFactionsShow.java index 7f0db8e7..30c4e5ad 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsShow.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsShow.java @@ -35,7 +35,7 @@ public class CmdFactionsShow extends FCommand if (faction == null) return; Collection leaders = faction.getFPlayersWhereRole(Rel.LEADER); - Collection mods = faction.getFPlayersWhereRole(Rel.OFFICER); + Collection officers = faction.getFPlayersWhereRole(Rel.OFFICER); Collection normals = faction.getFPlayersWhereRole(Rel.MEMBER); Collection recruits = faction.getFPlayersWhereRole(Rel.RECRUIT); @@ -112,7 +112,7 @@ public class CmdFactionsShow extends FCommand } } - for (FPlayer follower : mods) + for (FPlayer follower : officers) { if (follower.isOnline() && Mixin.isVisible(me, follower.getId())) { diff --git a/src/com/massivecraft/factions/integration/Econ.java b/src/com/massivecraft/factions/integration/Econ.java index 6641d1e8..558f0055 100644 --- a/src/com/massivecraft/factions/integration/Econ.java +++ b/src/com/massivecraft/factions/integration/Econ.java @@ -102,7 +102,7 @@ public class Econ if (ConfServer.econUniverseAccount.length() == 0) return; if ( ! economy.hasAccount(ConfServer.econUniverseAccount)) return; - modifyBalance(ConfServer.econUniverseAccount, delta); + deposit(ConfServer.econUniverseAccount, delta); } public static void sendBalanceInfo(FPlayer to, EconomyParticipator about) @@ -191,6 +191,9 @@ public class Econ else { // transaction failed, refund account + // TODO: This must be invalid thinking for sure! + // Atomicity should be built into the system implementing Vault. We are /not/ doing manual rollbacks. + // TODO: Re economy.depositPlayer(from.getAccountId(), amount); } } @@ -391,17 +394,10 @@ public class Econ public static boolean setBalance(String account, double amount) { + // This is about as stupid as it seems. + // Vault does however not implement a set balance feature. double current = economy.getBalance(account); - - // TODO: WHY? - return modifyBalance(account, amount - current); - } - - - public static boolean modifyBalance(String account, double amount) - { - // TODO: Get rid of? - return deposit(account, amount); + return deposit(account, amount - current); } public static boolean deposit(String account, double amount)