summaryrefslogtreecommitdiff
path: root/src/net/eathena/npchandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-09-02 20:58:41 +0300
committerAndrei Karas <akaras@inbox.ru>2015-09-02 20:58:41 +0300
commit84d2bab38202cd52b5eb0a37c12204ab6f607915 (patch)
tree2f3951b2f4f3b75f190eb2539979cc4afbace27c /src/net/eathena/npchandler.cpp
parent40730c4fa73d403cf7284a76d9b26f7ec662afa4 (diff)
downloadplus-84d2bab38202cd52b5eb0a37c12204ab6f607915.tar.gz
plus-84d2bab38202cd52b5eb0a37c12204ab6f607915.tar.bz2
plus-84d2bab38202cd52b5eb0a37c12204ab6f607915.tar.xz
plus-84d2bab38202cd52b5eb0a37c12204ab6f607915.zip
Remove MessageHandler class
Diffstat (limited to 'src/net/eathena/npchandler.cpp')
-rw-r--r--src/net/eathena/npchandler.cpp97
1 files changed, 3 insertions, 94 deletions
diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp
index 6ce6afac2..f8e8c1249 100644
--- a/src/net/eathena/npchandler.cpp
+++ b/src/net/eathena/npchandler.cpp
@@ -28,14 +28,15 @@
#include "gui/widgets/createwidget.h"
+#include "net/messagein.h"
+
+#include "net/ea/eaprotocol.h"
#include "net/ea/npcrecv.h"
#include "net/eathena/messageout.h"
#include "net/eathena/npcrecv.h"
#include "net/eathena/protocol.h"
-#include "net/ea/eaprotocol.h"
-
#include "debug.h"
extern Net::NpcHandler *npcHandler;
@@ -44,103 +45,11 @@ namespace EAthena
{
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_CUTIN,
- SMSG_NPC_VIEWPOINT,
- SMSG_NPC_SHOW_PROGRESS_BAR,
- SMSG_NPC_CLOSE_TIMEOUT,
- SMSG_NPC_COMMAND,
- SMSG_NPC_CHANGETITLE,
- SMSG_NPC_AREA,
- SMSG_NPC_SHOW_DIGIT,
- SMSG_NPC_PROGRESS_BAR_ABORT,
- 0
- };
- handledMessages = _messages;
npcHandler = this;
}
-void NpcHandler::handleMessage(Net::MessageIn &msg)
-{
- 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_CUTIN:
- NpcRecv::processNpcCutin(msg);
- break;
-
- case SMSG_NPC_VIEWPOINT:
- NpcRecv::processNpcViewPoint(msg);
- break;
-
- case SMSG_NPC_SHOW_PROGRESS_BAR:
- NpcRecv::processNpcShowProgressBar(msg);
- break;
-
- case SMSG_NPC_CLOSE_TIMEOUT:
- NpcRecv::processNpcCloseTimeout(msg);
- break;
-
- case SMSG_NPC_COMMAND:
- Ea::NpcRecv::processNpcCommand(msg);
- break;
-
- case SMSG_NPC_CHANGETITLE:
- Ea::NpcRecv::processChangeTitle(msg);
- break;
-
- case SMSG_NPC_AREA:
- NpcRecv::processArea(msg);
- break;
-
- case SMSG_NPC_SHOW_DIGIT:
- NpcRecv::processShowDigit(msg);
- break;
-
- case SMSG_NPC_PROGRESS_BAR_ABORT:
- NpcRecv::processProgressBarAbort(msg);
- break;
-
- default:
- break;
- }
-
- Ea::NpcRecv::mDialog = nullptr;
-}
-
void NpcHandler::talk(const BeingId npcId) const
{
createOutPacket(CMSG_NPC_TALK);