diff --git a/src/engine/net/client/ClientMessagePump.java b/src/engine/net/client/ClientMessagePump.java index f81938bd..267e11bf 100644 --- a/src/engine/net/client/ClientMessagePump.java +++ b/src/engine/net/client/ClientMessagePump.java @@ -737,9 +737,6 @@ public class ClientMessagePump implements NetMsgHandler { case LEADERCHANNELMESSAGE: ChatManager.handleChatMsg(s, (AbstractChatMsg) msg); break; - case LEAVEREQUEST: - origin.disconnect(); - break; case READYTOENTER: break; case OPENVAULT: diff --git a/src/engine/net/client/Protocol.java b/src/engine/net/client/Protocol.java index 3c66cc1a..b25245c2 100644 --- a/src/engine/net/client/Protocol.java +++ b/src/engine/net/client/Protocol.java @@ -128,7 +128,7 @@ public enum Protocol { LEADERCHANNELMESSAGE(0x17b306f9, ChatGlobalMsg.class, null), LEAVEGROUP(0xD8037303, LeaveGroupMsg.class, LeaveGroupHandler.class), //Leave Group LEAVEGUILD(0x1801EA32, LeaveGuildMsg.class, LeaveGuildHandler.class), // Leave Guild - LEAVEREQUEST(0xC79D775C, LeaveWorldMsg.class, null), //Client Request Leave World + LEAVEREQUEST(0xC79D775C, LeaveWorldMsg.class, LeaveWorldMsgHandler.class), //Client Request Leave World LEAVEWORLD(0xB801EAEC, null, null), //Response to client for Request Leave World LOADCHARACTER(0x5756BC53, null, null), // Load Player/NPC/Mob, other then self LOADSTRUCTURE(0xB8A3A654, LoadStructureMsg.class, null), //Load Buildings and World Detail Objects diff --git a/src/engine/net/client/handlers/LeaveWorldMsgHandler.java b/src/engine/net/client/handlers/LeaveWorldMsgHandler.java new file mode 100644 index 00000000..af38f2c7 --- /dev/null +++ b/src/engine/net/client/handlers/LeaveWorldMsgHandler.java @@ -0,0 +1,30 @@ +// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . +// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· +// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ +// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ +// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ +// 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.LeaveWorldMsg; + +public class LeaveWorldMsgHandler extends AbstractClientMsgHandler { + + public LeaveWorldMsgHandler() { + super(LeaveWorldMsg.class); + } + + @Override + protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) throws MsgSendException { + + origin.disconnect(); + + return true; + } + +} \ No newline at end of file