Browse Source

Handler created for PerformActionMsg

combat-2
MagicBot 8 months ago
parent
commit
17f18b83f4
  1. 7
      src/engine/net/client/ClientMessagePump.java
  2. 2
      src/engine/net/client/Protocol.java
  3. 33
      src/engine/net/client/handlers/PerformActionMsgHandler.java

7
src/engine/net/client/ClientMessagePump.java

@ -795,16 +795,9 @@ public class ClientMessagePump implements NetMsgHandler {
case LEADERCHANNELMESSAGE: case LEADERCHANNELMESSAGE:
ChatManager.handleChatMsg(s, (AbstractChatMsg) msg); ChatManager.handleChatMsg(s, (AbstractChatMsg) msg);
break; break;
case CHECKUNIQUEGUILD:
break;
case CANCELGUILDCREATION:
break;
case LEAVEREQUEST: case LEAVEREQUEST:
origin.disconnect(); origin.disconnect();
break; break;
case POWER:
PowersManager.usePower((PerformActionMsg) msg, origin, false);
break;
case READYTOENTER: case READYTOENTER:
break; break;
case OPENVAULT: case OPENVAULT:

2
src/engine/net/client/Protocol.java

@ -157,7 +157,7 @@ public enum Protocol {
PLACEASSET(0x940962DF, PlaceAssetMsg.class, PlaceAssetMsgHandler.class), PLACEASSET(0x940962DF, PlaceAssetMsg.class, PlaceAssetMsgHandler.class),
PLAYERDATA(0xB206D352, SendOwnPlayerMsg.class, null), //Enter World, Own Player Data PLAYERDATA(0xB206D352, SendOwnPlayerMsg.class, null), //Enter World, Own Player Data
PLAYERFRIENDS(0xDDEF9E7D, FriendRequestMsg.class, FriendRequestHandler.class), PLAYERFRIENDS(0xDDEF9E7D, FriendRequestMsg.class, FriendRequestHandler.class),
POWER(0x3C97A459, PerformActionMsg.class, null), // REQ / CMD Perform Action POWER(0x3C97A459, PerformActionMsg.class, PerformActionMsgHandler.class), // REQ / CMD Perform Action
POWERACTION(0xA0B27EEB, ApplyEffectMsg.class, null), // Apply Effect, add to effects icons POWERACTION(0xA0B27EEB, ApplyEffectMsg.class, null), // Apply Effect, add to effects icons
POWERACTIONDD(0xD43052F8, ModifyHealthMsg.class, null), //Modify Health/Mana/Stamina using power POWERACTIONDD(0xD43052F8, ModifyHealthMsg.class, null), //Modify Health/Mana/Stamina using power
POWERACTIONDDDIE(0xC27D446B, null, null), //Modify Health/Mana/Stamina using power and kill target POWERACTIONDDDIE(0xC27D446B, null, null), //Modify Health/Mana/Stamina using power and kill target

33
src/engine/net/client/handlers/PerformActionMsgHandler.java

@ -0,0 +1,33 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.net.client.handlers;
import engine.exception.MsgSendException;
import engine.gameManager.PowersManager;
import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.KeepAliveServerClientMsg;
import engine.net.client.msg.PerformActionMsg;
public class PerformActionMsgHandler extends AbstractClientMsgHandler {
public PerformActionMsgHandler() {
super(KeepAliveServerClientMsg.class);
}
@Override
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) throws MsgSendException {
PerformActionMsg msg = (PerformActionMsg) baseMsg;
PowersManager.usePower(msg, origin, false); // Wtf ?
return true;
}
}
Loading…
Cancel
Save