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 | |
parent | 2ee0ae2b8c21d5b1c2a77e06edf6a9883086a1ba (diff) | |
download | manaplus-8a85cb2bc295ad0ec9e275782b7392c2f99ba134.tar.gz manaplus-8a85cb2bc295ad0ec9e275782b7392c2f99ba134.tar.bz2 manaplus-8a85cb2bc295ad0ec9e275782b7392c2f99ba134.tar.xz manaplus-8a85cb2bc295ad0ec9e275782b7392c2f99ba134.zip |
eathena: add partial support for packet SMSG_NPC_MARKET_OPEN 0x09d5.
-rw-r--r-- | src/net/eathena/markethandler.cpp | 20 | ||||
-rw-r--r-- | src/net/eathena/markethandler.h | 3 | ||||
-rw-r--r-- | src/net/eathena/packets.h | 2 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 2 |
4 files changed, 25 insertions, 2 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 diff --git a/src/net/eathena/markethandler.h b/src/net/eathena/markethandler.h index c10d347eb..0ff713ed1 100644 --- a/src/net/eathena/markethandler.h +++ b/src/net/eathena/markethandler.h @@ -36,6 +36,9 @@ class MarketHandler final : public MessageHandler, A_DELETE_COPY(MarketHandler) void handleMessage(Net::MessageIn &msg) override final; + + protected: + void processMarketOpen(Net::MessageIn &msg); }; } // namespace EAthena diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index 8c21b67c8..bf10c0315 100644 --- a/src/net/eathena/packets.h +++ b/src/net/eathena/packets.h @@ -253,7 +253,7 @@ int16_t packet_lengths[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // #0x09C0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, + 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0 1 2 3 4 5 6 7 8 9 a b c d e f diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index aac136f94..138cdc04d 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -149,6 +149,7 @@ #define SMSG_NPC_STR_INPUT 0x01d4 /**< String input */ #define SMSG_NPC_SHOW_PROGRESS_BAR 0x02f0 #define SMSG_NPC_CHANGETITLE 0x0b06 +#define SMSG_NPC_MARKET_OPEN 0x09d5 #define SMSG_PLAYER_CHAT 0x008e /**< Player talks */ #define SMSG_WHISPER 0x0097 /**< Whisper Recieved */ #define SMSG_WHISPER_RESPONSE 0x09df @@ -286,7 +287,6 @@ #define SMSG_MERCENARY_SKILLS 0x029d #define SMSG_MERCENARY_ACTION 0x029f - #define SMSG_HOMUNCULUS_SKILLS 0x0235 #define SMSG_HOMUNCULUS_DATA 0x0230 #define SMSG_HOMUNCULUS_INFO 0x022e |