Пример #1
0
 public void setCashCredits(int cashCredits) {
   synchronized (objectMutex) {
     this.cashCredits = cashCredits;
   }
   if (getClient() != null && getClient().getSession() != null) {
     getClient().getSession().write(messageBuilder.buildCashCreditsDelta(cashCredits));
   }
 }
Пример #2
0
 public void addCashCredits(int amountToAdd) {
   synchronized (objectMutex) {
     this.cashCredits += amountToAdd;
   }
   if (getClient() != null && getClient().getSession() != null) {
     getClient().getSession().write(messageBuilder.buildCashCreditsDelta(cashCredits));
   }
 }