summaryrefslogtreecommitdiff
path: root/src/net/tmwa/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/tmwa/npchandler.cpp
parent40730c4fa73d403cf7284a76d9b26f7ec662afa4 (diff)
downloadmanaverse-84d2bab38202cd52b5eb0a37c12204ab6f607915.tar.gz
manaverse-84d2bab38202cd52b5eb0a37c12204ab6f607915.tar.bz2
manaverse-84d2bab38202cd52b5eb0a37c12204ab6f607915.tar.xz
manaverse-84d2bab38202cd52b5eb0a37c12204ab6f607915.zip
Remove MessageHandler class
Diffstat (limited to 'src/net/tmwa/npchandler.cpp')
-rw-r--r--src/net/tmwa/npchandler.cpp63
1 files changed, 2 insertions, 61 deletions
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);