From 84d2bab38202cd52b5eb0a37c12204ab6f607915 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 2 Sep 2015 20:58:41 +0300 Subject: Remove MessageHandler class --- src/net/tmwa/npchandler.cpp | 63 ++------------------------------------------- 1 file changed, 2 insertions(+), 61 deletions(-) (limited to 'src/net/tmwa/npchandler.cpp') diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp index c3ad53b41..b2e121cef 100644 --- a/src/net/tmwa/npchandler.cpp +++ b/src/net/tmwa/npchandler.cpp @@ -28,12 +28,13 @@ #include "gui/widgets/createwidget.h" -#include "net/ea/npcrecv.h" +#include "net/messagein.h" #include "net/tmwa/messageout.h" #include "net/tmwa/protocol.h" #include "net/ea/eaprotocol.h" +#include "net/ea/npcrecv.h" #include "debug.h" @@ -43,71 +44,11 @@ namespace TmwAthena { NpcHandler::NpcHandler() : - MessageHandler(), Ea::NpcHandler() { - static const uint16_t _messages[] = - { - SMSG_NPC_CHOICE, - SMSG_NPC_MESSAGE, - SMSG_NPC_NEXT, - SMSG_NPC_CLOSE, - SMSG_NPC_INT_INPUT, - SMSG_NPC_STR_INPUT, - SMSG_NPC_COMMAND, - SMSG_NPC_CHANGETITLE, - 0 - }; - handledMessages = _messages; npcHandler = this; } -void NpcHandler::handleMessage(Net::MessageIn &msg) -{ - BLOCK_START("NpcHandler::handleMessage") - - switch (msg.getId()) - { - case SMSG_NPC_CHOICE: - Ea::NpcRecv::processNpcChoice(msg); - break; - - case SMSG_NPC_MESSAGE: - Ea::NpcRecv::processNpcMessage(msg); - break; - - case SMSG_NPC_CLOSE: - Ea::NpcRecv::processNpcClose(msg); - break; - - case SMSG_NPC_NEXT: - Ea::NpcRecv::processNpcNext(msg); - break; - - case SMSG_NPC_INT_INPUT: - Ea::NpcRecv::processNpcIntInput(msg); - break; - - case SMSG_NPC_STR_INPUT: - Ea::NpcRecv::processNpcStrInput(msg); - break; - - case SMSG_NPC_COMMAND: - Ea::NpcRecv::processNpcCommand(msg); - break; - - case SMSG_NPC_CHANGETITLE: - Ea::NpcRecv::processChangeTitle(msg); - break; - - default: - break; - } - - Ea::NpcRecv::mDialog = nullptr; - BLOCK_END("NpcHandler::handleMessage") -} - void NpcHandler::talk(const BeingId npcId) const { createOutPacket(CMSG_NPC_TALK); -- cgit v1.2.3-70-g09d2