Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Increased the maximum balance of accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
Flibio committed May 16, 2016
1 parent 2020f61 commit 42915fa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sourceCompatibility = '1.8'
targetCompatibility = '1.8'

group 'io.github.flibio'
version '2.0.6'
version '2.0.7'

defaultTasks 'licenseFormat', 'clean', 'build'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public TransactionResult setBalance(Currency currency, BigDecimal amount, Cause
logger.debug("Attempting to set balance of " + name + " to " + amount.toString() + " on currency " + currency.getName() + " caused by "
+ cause.toString());
// Check if the new balance is in bounds
if (amount.compareTo(BigDecimal.ZERO) == -1 || amount.compareTo(BigDecimal.valueOf(1000000)) == 1) {
if (amount.compareTo(BigDecimal.ZERO) == -1 || amount.compareTo(BigDecimal.valueOf(999999999)) == 1) {
return resultAndEvent(this, amount, currency, ResultType.ACCOUNT_NO_SPACE, TransactionTypes.DEPOSIT);
}
if (playerService.setBalance(uuid, amount, currency)) {
Expand Down Expand Up @@ -155,7 +155,7 @@ public TransactionResult deposit(Currency currency, BigDecimal amount, Cause cau
+ cause.toString());
BigDecimal newBal = getBalance(currency).add(amount);
// Check if the new balance is in bounds
if (newBal.compareTo(BigDecimal.ZERO) == -1 || newBal.compareTo(BigDecimal.valueOf(1000000)) == 1) {
if (newBal.compareTo(BigDecimal.ZERO) == -1 || newBal.compareTo(BigDecimal.valueOf(999999999)) == 1) {
return resultAndEvent(this, amount, currency, ResultType.ACCOUNT_NO_SPACE, TransactionTypes.DEPOSIT);
}
if (playerService.deposit(uuid, amount, currency)) {
Expand All @@ -171,7 +171,7 @@ public TransactionResult withdraw(Currency currency, BigDecimal amount, Cause ca
+ cause.toString());
BigDecimal newBal = getBalance(currency).subtract(amount);
// Check if the new balance is in bounds
if (newBal.compareTo(BigDecimal.ZERO) == -1 || newBal.compareTo(BigDecimal.valueOf(1000000)) == 1) {
if (newBal.compareTo(BigDecimal.ZERO) == -1 || newBal.compareTo(BigDecimal.valueOf(999999999)) == 1) {
return resultAndEvent(this, amount, currency, ResultType.ACCOUNT_NO_SPACE, TransactionTypes.WITHDRAW);
}
if (playerService.withdraw(uuid, amount, currency)) {
Expand All @@ -187,7 +187,7 @@ public TransferResult transfer(Account to, Currency currency, BigDecimal amount,
+ " on currency " + currency.getName() + " caused by " + cause.toString());
BigDecimal newBal = to.getBalance(currency).add(amount);
// Check if the new balance is in bounds
if (newBal.compareTo(BigDecimal.ZERO) == -1 || newBal.compareTo(BigDecimal.valueOf(1000000)) == 1) {
if (newBal.compareTo(BigDecimal.ZERO) == -1 || newBal.compareTo(BigDecimal.valueOf(999999999)) == 1) {
return resultAndEvent(this, amount, currency, ResultType.ACCOUNT_NO_SPACE, to);
}
// Check if the account has enough funds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public TransactionResult setBalance(Currency currency, BigDecimal amount, Cause
logger.debug("Attempting to set balance of " + name + " to " + amount.toString() + " on currency " + currency.getName() + " caused by "
+ cause.toString());
// Check if the new balance is in bounds
if (amount.compareTo(BigDecimal.ZERO) == -1 || amount.compareTo(BigDecimal.valueOf(1000000)) == 1) {
if (amount.compareTo(BigDecimal.ZERO) == -1 || amount.compareTo(BigDecimal.valueOf(999999999)) == 1) {
return resultAndEvent(this, amount, currency, ResultType.ACCOUNT_NO_SPACE, TransactionTypes.DEPOSIT);
}
if (virtualService.setBalance(name, amount, currency)) {
Expand Down Expand Up @@ -146,7 +146,7 @@ public TransactionResult deposit(Currency currency, BigDecimal amount, Cause cau
+ cause.toString());
BigDecimal newBal = getBalance(currency).add(amount);
// Check if the new balance is in bounds
if (newBal.compareTo(BigDecimal.ZERO) == -1 || newBal.compareTo(BigDecimal.valueOf(1000000)) == 1) {
if (newBal.compareTo(BigDecimal.ZERO) == -1 || newBal.compareTo(BigDecimal.valueOf(999999999)) == 1) {
return resultAndEvent(this, amount, currency, ResultType.ACCOUNT_NO_SPACE, TransactionTypes.DEPOSIT);
}
if (virtualService.deposit(name, amount, currency)) {
Expand All @@ -162,7 +162,7 @@ public TransactionResult withdraw(Currency currency, BigDecimal amount, Cause ca
+ cause.toString());
BigDecimal newBal = getBalance(currency).subtract(amount);
// Check if the new balance is in bounds
if (newBal.compareTo(BigDecimal.ZERO) == -1 || newBal.compareTo(BigDecimal.valueOf(1000000)) == 1) {
if (newBal.compareTo(BigDecimal.ZERO) == -1 || newBal.compareTo(BigDecimal.valueOf(999999999)) == 1) {
return resultAndEvent(this, amount, currency, ResultType.ACCOUNT_NO_SPACE, TransactionTypes.WITHDRAW);
}
if (virtualService.withdraw(name, amount, currency)) {
Expand All @@ -178,7 +178,7 @@ public TransferResult transfer(Account to, Currency currency, BigDecimal amount,
+ " on currency " + currency.getName() + " caused by " + cause.toString());
BigDecimal newBal = to.getBalance(currency).add(amount);
// Check if the new balance is in bounds
if (newBal.compareTo(BigDecimal.ZERO) == -1 || newBal.compareTo(BigDecimal.valueOf(1000000)) == 1) {
if (newBal.compareTo(BigDecimal.ZERO) == -1 || newBal.compareTo(BigDecimal.valueOf(999999999)) == 1) {
return resultAndEvent(this, amount, currency, ResultType.ACCOUNT_NO_SPACE, to);
}
// Check if the account has enough funds
Expand Down

0 comments on commit 42915fa

Please sign in to comment.