Rename mods --> officers in souce code and minor touches to the economy integration.

This commit is contained in:
Olof Larsson 2013-04-19 15:51:41 +02:00
parent 2299949a4a
commit d1cebc351e
2 changed files with 9 additions and 13 deletions

View File

@ -35,7 +35,7 @@ public class CmdFactionsShow extends FCommand
if (faction == null) return; if (faction == null) return;
Collection<FPlayer> leaders = faction.getFPlayersWhereRole(Rel.LEADER); Collection<FPlayer> leaders = faction.getFPlayersWhereRole(Rel.LEADER);
Collection<FPlayer> mods = faction.getFPlayersWhereRole(Rel.OFFICER); Collection<FPlayer> officers = faction.getFPlayersWhereRole(Rel.OFFICER);
Collection<FPlayer> normals = faction.getFPlayersWhereRole(Rel.MEMBER); Collection<FPlayer> normals = faction.getFPlayersWhereRole(Rel.MEMBER);
Collection<FPlayer> recruits = faction.getFPlayersWhereRole(Rel.RECRUIT); Collection<FPlayer> 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())) if (follower.isOnline() && Mixin.isVisible(me, follower.getId()))
{ {

View File

@ -102,7 +102,7 @@ public class Econ
if (ConfServer.econUniverseAccount.length() == 0) return; if (ConfServer.econUniverseAccount.length() == 0) return;
if ( ! economy.hasAccount(ConfServer.econUniverseAccount)) return; if ( ! economy.hasAccount(ConfServer.econUniverseAccount)) return;
modifyBalance(ConfServer.econUniverseAccount, delta); deposit(ConfServer.econUniverseAccount, delta);
} }
public static void sendBalanceInfo(FPlayer to, EconomyParticipator about) public static void sendBalanceInfo(FPlayer to, EconomyParticipator about)
@ -191,6 +191,9 @@ public class Econ
else else
{ {
// transaction failed, refund account // 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); economy.depositPlayer(from.getAccountId(), amount);
} }
} }
@ -391,17 +394,10 @@ public class Econ
public static boolean setBalance(String account, double amount) 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); double current = economy.getBalance(account);
return deposit(account, amount - current);
// TODO: WHY?
return modifyBalance(account, amount - current);
}
public static boolean modifyBalance(String account, double amount)
{
// TODO: Get rid of?
return deposit(account, amount);
} }
public static boolean deposit(String account, double amount) public static boolean deposit(String account, double amount)