summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-22 02:26:54 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-22 02:26:54 +0300
commitb3f39e67e4bf45f526a6a1867e72e2b35092528b (patch)
tree4213a0f9135729ce13bc93591543cf140d5a76e9
parent4482f516b5bd6677b5eb045bdc624f50a6ac6313 (diff)
downloadplus-b3f39e67e4bf45f526a6a1867e72e2b35092528b.tar.gz
plus-b3f39e67e4bf45f526a6a1867e72e2b35092528b.tar.bz2
plus-b3f39e67e4bf45f526a6a1867e72e2b35092528b.tar.xz
plus-b3f39e67e4bf45f526a6a1867e72e2b35092528b.zip
eathena: add partial support for packet SMSG_NPC_MARKET_BUY_ACK 0x09d7.
-rw-r--r--src/net/eathena/markethandler.cpp16
-rw-r--r--src/net/eathena/markethandler.h2
-rw-r--r--src/net/eathena/packets.h2
-rw-r--r--src/net/eathena/protocol.h2
4 files changed, 21 insertions, 1 deletions
diff --git a/src/net/eathena/markethandler.cpp b/src/net/eathena/markethandler.cpp
index 4631abf03..da3180f90 100644
--- a/src/net/eathena/markethandler.cpp
+++ b/src/net/eathena/markethandler.cpp
@@ -36,6 +36,7 @@ MarketHandler::MarketHandler() :
static const uint16_t _messages[] =
{
SMSG_NPC_MARKET_OPEN,
+ SMSG_NPC_MARKET_BUY_ACK,
0
};
handledMessages = _messages;
@@ -50,6 +51,10 @@ void MarketHandler::handleMessage(Net::MessageIn &msg)
processMarketOpen(msg);
break;
+ case SMSG_NPC_MARKET_BUY_ACK:
+ processMarketBuyAck(msg);
+ break;
+
default:
break;
}
@@ -68,6 +73,17 @@ void MarketHandler::processMarketOpen(Net::MessageIn &msg)
}
}
+void MarketHandler::processMarketBuyAck(Net::MessageIn &msg)
+{
+ const int len = (msg.readInt16("len") - 4) / 8;
+ for (int f = 0; f < len; f ++)
+ {
+ msg.readInt16("item id");
+ msg.readInt16("amount");
+ msg.readInt32("price");
+ }
+}
+
void MarketHandler::close()
{
createOutPacket(CMSG_NPC_MARKET_CLOSE);
diff --git a/src/net/eathena/markethandler.h b/src/net/eathena/markethandler.h
index 41d2a0126..d199790e4 100644
--- a/src/net/eathena/markethandler.h
+++ b/src/net/eathena/markethandler.h
@@ -45,6 +45,8 @@ class MarketHandler final : public MessageHandler,
protected:
void processMarketOpen(Net::MessageIn &msg);
+
+ void processMarketBuyAck(Net::MessageIn &msg);
};
} // namespace EAthena
diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h
index bf10c0315..0f9633440 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, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,
+ 0, 0, 0, 0, 0, -1, 0, -1, 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 27e7339f3..673d70298 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -150,6 +150,8 @@
#define SMSG_NPC_SHOW_PROGRESS_BAR 0x02f0
#define SMSG_NPC_CHANGETITLE 0x0b06
#define SMSG_NPC_MARKET_OPEN 0x09d5
+#define SMSG_NPC_MARKET_BUY_ACK 0x09d7
+
#define SMSG_PLAYER_CHAT 0x008e /**< Player talks */
#define SMSG_WHISPER 0x0097 /**< Whisper Recieved */
#define SMSG_WHISPER_RESPONSE 0x09df