Interface EconomyRepository
public interface EconomyRepository
-
Method Summary
Modifier and TypeMethodDescriptionapplyDelta(UUID player, String currencyId, double delta, double defaultBalance) Atomically appliesdeltato the player's balance and returns the resulting balance.getBalance(UUID player, String currencyId, double defaultBalance) setBalance(UUID player, String currencyId, double amount)
-
Method Details
-
getBalance
-
applyDelta
CompletableFuture<Double> applyDelta(UUID player, String currencyId, double delta, double defaultBalance) Atomically appliesdeltato the player's balance and returns the resulting balance. Backends must serialize this per-(player, currencyId)pair (row-level lock / CAS loop / single-writer actor - the implementation's choice) so concurrent deposits/withdrawals for the same player can never race. -
setBalance
-
top
-
logTransaction
-
history
-