forked from MagicBane/Server
MagicBot
8 months ago
3 changed files with 61 additions and 32 deletions
@ -0,0 +1,60 @@
@@ -0,0 +1,60 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// 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.ModifyStatMsg; |
||||
import engine.objects.PlayerCharacter; |
||||
import engine.server.MBServerStatics; |
||||
|
||||
public class ModifyStatMsgHandler extends AbstractClientMsgHandler { |
||||
|
||||
public ModifyStatMsgHandler() { |
||||
super(ModifyStatMsg.class); |
||||
} |
||||
|
||||
@Override |
||||
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) throws MsgSendException { |
||||
|
||||
PlayerCharacter playerCharacter = origin.getPlayerCharacter(); |
||||
|
||||
// Member variable declaration
|
||||
|
||||
ModifyStatMsg msg; |
||||
|
||||
// Member variable assignment
|
||||
|
||||
msg = (ModifyStatMsg) baseMsg; |
||||
|
||||
int type = msg.getType(); |
||||
|
||||
switch (type) { |
||||
case MBServerStatics.STAT_STR_ID: |
||||
playerCharacter.addStr(msg.getAmount()); |
||||
break; |
||||
case MBServerStatics.STAT_DEX_ID: |
||||
playerCharacter.addDex(msg.getAmount()); |
||||
break; |
||||
case MBServerStatics.STAT_CON_ID: |
||||
playerCharacter.addCon(msg.getAmount()); |
||||
break; |
||||
case MBServerStatics.STAT_INT_ID: |
||||
playerCharacter.addInt(msg.getAmount()); |
||||
break; |
||||
case MBServerStatics.STAT_SPI_ID: |
||||
playerCharacter.addSpi(msg.getAmount()); |
||||
break; |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue