Skip to content
Prev Previous commit
Next Next commit
Fix: Wrong Sync Client Server fworks correctly now
Who would have guessed ChangeBalanceBroadcastClient does NOT broadcast to the client. ChangeBalance does that automatically.

The other method is... probably what is called IN the client after receiving the event.
  • Loading branch information
LordTylus committed Mar 9, 2024
commit da6eb745dc99700f736ce1c5d49d347da2b93329
8 changes: 1 addition & 7 deletions Essentials/Commands/EcoModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,6 @@ public void EcoPay(string Player, long amount) {
/// If the amount is positive the player receives credits. If it is negative, the player loses credits.
///
/// If the amount taken from a users account is greater than the amount the user has, the accounts balance is set to 0, since negative balances are not possible.
///
/// This Method performs an online check and only broadcasts the change to players that are currently online.
/// For offline players only a change in the server is needed. The player receives their new balance upon next login.
/// </summary>
private void ChangeBalance(long identityId, long amount) {

Expand All @@ -201,10 +198,7 @@ private void ChangeBalance(long identityId, long amount) {
if (balance + amount < 0)
amount = -balance;

if (MySession.Static.Players.IsPlayerOnline(identityId))
MyBankingSystem.ChangeBalanceBroadcastToClients(identityId, amount, balance + amount);
else
MyBankingSystem.ChangeBalance(identityId, amount);
MyBankingSystem.ChangeBalance(identityId, amount);
}

/// <summary>
Expand Down