summaryrefslogtreecommitdiff
path: root/src/net/tmwa/network.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-09-02 02:20:48 +0300
committerAndrei Karas <akaras@inbox.ru>2015-09-02 02:20:48 +0300
commit7ccc1b5fe8988b2a51d3fb2f4422f95c98a8d6aa (patch)
tree6eb9f0aebf7e80242f5b8e23fb0ea2f98635a47a /src/net/tmwa/network.cpp
parent1e302305d8777da7b40b1ae53ae33eab866b9e26 (diff)
downloadmanaplus-7ccc1b5fe8988b2a51d3fb2f4422f95c98a8d6aa.tar.gz
manaplus-7ccc1b5fe8988b2a51d3fb2f4422f95c98a8d6aa.tar.bz2
manaplus-7ccc1b5fe8988b2a51d3fb2f4422f95c98a8d6aa.tar.xz
manaplus-7ccc1b5fe8988b2a51d3fb2f4422f95c98a8d6aa.zip
Use packet handlers from packet defines.
Diffstat (limited to 'src/net/tmwa/network.cpp')
-rw-r--r--src/net/tmwa/network.cpp38
1 files changed, 35 insertions, 3 deletions
diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp
index 0e97cbe46..cce906703 100644
--- a/src/net/tmwa/network.cpp
+++ b/src/net/tmwa/network.cpp
@@ -26,6 +26,38 @@
#include "net/packetinfo.h"
+#include "net/ea/adminrecv.h"
+#include "net/ea/beingrecv.h"
+#include "net/ea/buysellrecv.h"
+#include "net/ea/charserverrecv.h"
+#include "net/ea/chatrecv.h"
+#include "net/ea/gamerecv.h"
+#include "net/ea/guildrecv.h"
+#include "net/ea/inventoryrecv.h"
+#include "net/ea/itemrecv.h"
+#include "net/ea/loginrecv.h"
+#include "net/ea/npcrecv.h"
+#include "net/ea/partyrecv.h"
+#include "net/ea/playerrecv.h"
+#include "net/ea/skillrecv.h"
+#include "net/ea/traderecv.h"
+
+#include "net/tmwa/beingrecv.h"
+#include "net/tmwa/buysellrecv.h"
+#include "net/tmwa/charserverrecv.h"
+#include "net/tmwa/chatrecv.h"
+#include "net/tmwa/gamerecv.h"
+#include "net/tmwa/generalrecv.h"
+#include "net/tmwa/guildrecv.h"
+#include "net/tmwa/inventoryrecv.h"
+#include "net/tmwa/itemrecv.h"
+#include "net/tmwa/loginrecv.h"
+#include "net/tmwa/partyrecv.h"
+#include "net/tmwa/playerrecv.h"
+#include "net/tmwa/questrecv.h"
+#include "net/tmwa/skillrecv.h"
+#include "net/tmwa/traderecv.h"
+
#include "net/tmwa/messagehandler.h"
#include "net/tmwa/messagein.h"
#include "net/tmwa/protocol.h"
@@ -127,9 +159,9 @@ void Network::dispatchMessages()
if (msgId < messagesSize)
{
- MessageHandler *const handler = mMessageHandlers[msgId];
- if (handler)
- handler->handleMessage(msg);
+ PacketFuncPtr func = mPackets[msgId].func;
+ if (func)
+ func(msg);
else
logger->log("Unhandled packet: %u 0x%x", msgId, msgId);
}