2024-03-24 10:21:53 -04:00
|
|
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
|
|
|
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
|
|
|
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
|
|
|
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
|
|
|
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
|
|
|
|
// Magicbane Emulator Project © 2013 - 2022
|
|
|
|
|
// www.magicbane.com
|
|
|
|
|
|
|
|
|
|
package engine.net.client.handlers;
|
|
|
|
|
|
|
|
|
|
import engine.net.client.ClientConnection;
|
|
|
|
|
import engine.net.client.msg.ClientNetMsg;
|
|
|
|
|
import engine.net.client.msg.GoldToVaultMsg;
|
|
|
|
|
import engine.objects.Account;
|
|
|
|
|
import engine.objects.PlayerCharacter;
|
|
|
|
|
|
|
|
|
|
public class GoldToVaultMsgHandler extends AbstractClientMsgHandler {
|
|
|
|
|
|
|
|
|
|
public GoldToVaultMsgHandler() {
|
2024-05-12 11:55:12 -04:00
|
|
|
super();
|
2024-03-24 10:21:53 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2024-05-12 13:42:11 -04:00
|
|
|
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) {
|
2024-03-24 10:21:53 -04:00
|
|
|
|
|
|
|
|
PlayerCharacter player = origin.getPlayerCharacter();
|
|
|
|
|
|
|
|
|
|
GoldToVaultMsg msg = (GoldToVaultMsg) baseMsg;
|
|
|
|
|
|
|
|
|
|
if (player == null)
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
Account account = player.getAccount();
|
|
|
|
|
|
|
|
|
|
if (account == null)
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
account.transferGoldFromInventoryToVault(msg, origin);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|