Examples of transactionSuccess()


Examples of net.milkbowl.vault.economy.EconomyResponse.transactionSuccess()

            if (ecoReward > 0) {
              r = War.war.getEconomy().depositPlayer(tp.getName(), ecoReward);
            } else {
              r = War.war.getEconomy().withdrawPlayer(tp.getName(), ecoReward);
            }
            if (!r.transactionSuccess()) {
              War.war.getLogger().log(Level.WARNING,
                "Failed to reward player {0} ${1}. Error: {2}",
                new Object[] {tp.getName(), ecoReward, r.errorMessage});
            }
          }
View Full Code Here

Examples of net.milkbowl.vault.economy.EconomyResponse.transactionSuccess()

    }

    @Override
    public EconomyResponse bankWithdraw(String name, double amount) {
        EconomyResponse er = bankHas(name, amount);
        if (!er.transactionSuccess()) {
            return er;
        } else {
            economy.addBankMoney(name, -amount, true);
            return new EconomyResponse(amount, economy.getBankMoneyDouble(name), ResponseType.SUCCESS, "");
        }
View Full Code Here

Examples of net.milkbowl.vault.economy.EconomyResponse.transactionSuccess()

    if (amount < 0) {
      return new EconomyResponse(0, 0, ResponseType.FAILURE, "Cannot withdraw negative funds");
    }

    EconomyResponse er = bankHas(name, amount);
    if (!er.transactionSuccess()) {
      return er;
    } else {
      if (Common.getInstance().getAccountManager().exist(Account.BANK_PREFIX + name)) {
        return new EconomyResponse(0, withdrawPlayer(Account.BANK_PREFIX + name, amount).balance, ResponseType.SUCCESS, "");
      }
View Full Code Here

Examples of net.milkbowl.vault.economy.EconomyResponse.transactionSuccess()

  @Override
  public EconomyResponse isBankMember(String name, String playerName) {

    // Basicly here if the user have access to deposit & withdraw he's a member
    EconomyResponse er = isBankOwner(name, playerName);
    if (er.transactionSuccess()) {
      return er;
    } else {
      if (Common.getInstance().getAccountManager().exist(Account.BANK_PREFIX + name)) {
        Account account = Common.getInstance().getAccountManager().getAccount(Account.BANK_PREFIX + name);
        if (account.getAccountACL().canDeposit(playerName) && account.getAccountACL().canWithdraw(playerName)) {
View Full Code Here

Examples of net.milkbowl.vault.economy.EconomyResponse.transactionSuccess()

   * @return 成功ならtrue、失敗ならfalse
   */
  public static boolean addMoney(String name, double amount){
    if (amount < 0) return false; // 負数は許容しない
    EconomyResponse r = BookEditor.economy.depositPlayer(name, amount);
    if(r.transactionSuccess()) {
      return true;
    } else {
      return false;
    }
  }
View Full Code Here

Examples of net.milkbowl.vault.economy.EconomyResponse.transactionSuccess()

   * @return 成功ならtrue、失敗ならfalse
   */
  public static boolean takeMoney(String name, double amount){
    if (amount < 0) return false; // 負数は許容しない
    EconomyResponse r = BookEditor.economy.withdrawPlayer(name, amount);
    if(r.transactionSuccess()) {
      return true;
    } else {
      return false;
    }
  }
View Full Code Here

Examples of net.milkbowl.vault.economy.EconomyResponse.transactionSuccess()

            return;
        }

        EconomyResponse response = provider.depositPlayer(Bukkit.getOfflinePlayer(event.getAccount()), event.getWorld().getName(), event.getDoubleAmount());

        if (!response.transactionSuccess()) {
            event.canHold(false);
            return;
        }

        provider.withdrawPlayer(Bukkit.getOfflinePlayer(event.getAccount()), event.getWorld().getName(), event.getDoubleAmount());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.