diff --git a/src/engine/net/client/ClientMessagePump.java b/src/engine/net/client/ClientMessagePump.java index 12223fc0..f361b541 100644 --- a/src/engine/net/client/ClientMessagePump.java +++ b/src/engine/net/client/ClientMessagePump.java @@ -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: diff --git a/src/engine/net/client/Protocol.java b/src/engine/net/client/Protocol.java index 2982992e..db08d515 100644 --- a/src/engine/net/client/Protocol.java +++ b/src/engine/net/client/Protocol.java @@ -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), diff --git a/src/engine/net/client/handlers/UseCharterMsgHandler.java b/src/engine/net/client/handlers/UseCharterMsgHandler.java new file mode 100644 index 00000000..f61ea384 --- /dev/null +++ b/src/engine/net/client/handlers/UseCharterMsgHandler.java @@ -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; + } + +} \ No newline at end of file diff --git a/src/engine/net/client/msg/UseCharterMsg.java b/src/engine/net/client/msg/UseCharterMsg.java index 4f2cadac..d2c1e193 100644 --- a/src/engine/net/client/msg/UseCharterMsg.java +++ b/src/engine/net/client/msg/UseCharterMsg.java @@ -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 { * caller. */ public UseCharterMsg(AbstractConnection origin, ByteBufferReader reader) { - super(Protocol.ACTIVATECHARTER, origin, reader); + super(Protocol.USECHARTER, origin, reader); } /**