forked from MagicBane/Server
MagicBot
8 months ago
7 changed files with 113 additions and 62 deletions
@ -0,0 +1,43 @@
@@ -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; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,43 @@
@@ -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.ItemToVaultMsg; |
||||
import engine.objects.PlayerCharacter; |
||||
|
||||
public class ItemToVaultMsgHandler extends AbstractClientMsgHandler { |
||||
|
||||
public ItemToVaultMsgHandler() { |
||||
super(ItemToVaultMsg.class); |
||||
} |
||||
|
||||
@Override |
||||
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) throws MsgSendException { |
||||
|
||||
ItemToVaultMsg msg = (ItemToVaultMsg) baseMsg; |
||||
|
||||
PlayerCharacter player = origin.getPlayerCharacter(); |
||||
|
||||
if (player == null) |
||||
return true; |
||||
; |
||||
|
||||
if (player.getAccount() == null) |
||||
return true; |
||||
; |
||||
|
||||
player.getAccount().transferItemFromInventoryToVault(msg, origin); |
||||
|
||||
return true; |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue