Handlers created for vault interactions

This commit is contained in:
2024-03-24 10:12:16 -04:00
parent e7e32ca4ef
commit 5439df5653
7 changed files with 113 additions and 62 deletions
@@ -0,0 +1,43 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.net.client.handlers;
import engine.exception.MsgSendException;
import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ItemFromVaultMsg;
import engine.objects.PlayerCharacter;
public class ItemFromVaultMsgHandler extends AbstractClientMsgHandler {
public ItemFromVaultMsgHandler() {
super(ItemFromVaultMsg.class);
}
@Override
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) throws MsgSendException {
PlayerCharacter player = origin.getPlayerCharacter();
ItemFromVaultMsg msg = (ItemFromVaultMsg) baseMsg;
if (player == null)
return true;
;
if (player.getAccount() == null)
return true;
;
player.getAccount().transferItemFromVaultToInventory(msg, origin);
return true;
}
}