diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-21 23:54:10 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-21 23:54:10 +0300 |
commit | 8a85cb2bc295ad0ec9e275782b7392c2f99ba134 (patch) | |
tree | df7d48f4d9d930804b73a5fefdf88ee528142233 /src/net/eathena/markethandler.cpp | |
parent | 2ee0ae2b8c21d5b1c2a77e06edf6a9883086a1ba (diff) | |
download | plus-8a85cb2bc295ad0ec9e275782b7392c2f99ba134.tar.gz plus-8a85cb2bc295ad0ec9e275782b7392c2f99ba134.tar.bz2 plus-8a85cb2bc295ad0ec9e275782b7392c2f99ba134.tar.xz plus-8a85cb2bc295ad0ec9e275782b7392c2f99ba134.zip |
eathena: add partial support for packet SMSG_NPC_MARKET_OPEN 0x09d5.
Diffstat (limited to 'src/net/eathena/markethandler.cpp')
-rw-r--r-- | src/net/eathena/markethandler.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/net/eathena/markethandler.cpp b/src/net/eathena/markethandler.cpp index 2643dd24b..3bbe678b7 100644 --- a/src/net/eathena/markethandler.cpp +++ b/src/net/eathena/markethandler.cpp @@ -20,6 +20,8 @@ #include "net/eathena/markethandler.h" +#include "net/eathena/protocol.h" + #include "debug.h" extern Net::MarketHandler *marketHandler; @@ -32,6 +34,7 @@ MarketHandler::MarketHandler() : { static const uint16_t _messages[] = { + SMSG_NPC_MARKET_OPEN, 0 }; handledMessages = _messages; @@ -42,9 +45,26 @@ void MarketHandler::handleMessage(Net::MessageIn &msg) { switch (msg.getId()) { + case SMSG_NPC_MARKET_OPEN: + processMarketOpen(msg); + break; + default: break; } } +void MarketHandler::processMarketOpen(Net::MessageIn &msg) +{ + const int len = (msg.readInt16("len") - 4) / 13; + for (int f = 0; f < len; f ++) + { + msg.readInt16("item id"); + msg.readUInt8("type"); + msg.readInt32("price"); + msg.readInt32("amount"); + msg.readInt16("view"); + } +} + } // namespace EAthena |