Browse Source

Handler created for UseCharterMsg

combat-2
MagicBot 8 months ago
parent
commit
5cfbd9998c
  1. 7
      src/engine/net/client/ClientMessagePump.java
  2. 2
      src/engine/net/client/Protocol.java
  3. 37
      src/engine/net/client/handlers/UseCharterMsgHandler.java
  4. 6
      src/engine/net/client/msg/UseCharterMsg.java

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

@ -795,13 +795,6 @@ public class ClientMessagePump implements NetMsgHandler { @@ -795,13 +795,6 @@ public class ClientMessagePump implements NetMsgHandler {
case LEADERCHANNELMESSAGE:
ChatManager.handleChatMsg(s, (AbstractChatMsg) msg);
break;
case ACTIVATECHARTER:
UseCharterMsg ucm = (UseCharterMsg) msg;
ucm.setUnknown02(1);
ucm.configure();
Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), ucm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
break;
case CHECKUNIQUEGUILD:
break;
case CANCELGUILDCREATION:

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

@ -22,7 +22,7 @@ public enum Protocol { @@ -22,7 +22,7 @@ public enum Protocol {
NONE(0x0, null, null),
ABANDONASSET(0xFDDBB233, AbandonAssetMsg.class, AbandonAssetMsgHandler.class), // AbandonAsset
ACTIVATECHARTER(0x296C0B22, UseCharterMsg.class, null),// Use Guild Charter
USECHARTER(0x296C0B22, UseCharterMsg.class, UseCharterMsgHandler.class),// Use Guild Charter
ACTIVATENPC(0xC9AAE81E, ActivateNPCMessage.class, ActivateNPCMsgHandler.class),
ACTIVATEPLEDGE(0x5A694DC0, SwearInMsg.class, SwearInHandler.class), // Swear In
ADDFRIEND(0xCFA1C787, AddFriendMessage.class, null),

37
src/engine/net/client/handlers/UseCharterMsgHandler.java

@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.net.client.handlers;
import engine.Enum.DispatchChannel;
import engine.exception.MsgSendException;
import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.KeepAliveServerClientMsg;
import engine.net.client.msg.UseCharterMsg;
public class UseCharterMsgHandler extends AbstractClientMsgHandler {
public UseCharterMsgHandler() {
super(KeepAliveServerClientMsg.class);
}
@Override
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) throws MsgSendException {
UseCharterMsg msg = (UseCharterMsg) baseMsg;
msg.setUnknown02(1);
msg.configure();
Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true;
}
}

6
src/engine/net/client/msg/UseCharterMsg.java

@ -35,11 +35,11 @@ public class UseCharterMsg extends ClientNetMsg { @@ -35,11 +35,11 @@ public class UseCharterMsg extends ClientNetMsg {
* This is the general purpose constructor.
*/
public UseCharterMsg() {
super(Protocol.ACTIVATECHARTER);
super(Protocol.USECHARTER);
}
public UseCharterMsg(PlayerCharacter player, boolean close) {
super(Protocol.ACTIVATECHARTER);
super(Protocol.USECHARTER);
this.close = close;
this.player = player;
@ -52,7 +52,7 @@ public class UseCharterMsg extends ClientNetMsg { @@ -52,7 +52,7 @@ public class UseCharterMsg extends ClientNetMsg {
* caller.
*/
public UseCharterMsg(AbstractConnection origin, ByteBufferReader reader) {
super(Protocol.ACTIVATECHARTER, origin, reader);
super(Protocol.USECHARTER, origin, reader);
}
/**

Loading…
Cancel
Save