From 98daaa2544a5c0d907e438ce72913202c2c3c6ce Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 5 Jan 2015 23:58:26 +0300 Subject: eathena: add partial support for packet SMSG_AUCTION_RESULTS 0x0252. --- src/net/eathena/auctionhandler.cpp | 29 +++++++++++++++++++++++++++++ src/net/eathena/auctionhandler.h | 2 ++ src/net/eathena/packets.h | 2 +- src/net/eathena/protocol.h | 1 + 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/net/eathena/auctionhandler.cpp b/src/net/eathena/auctionhandler.cpp index bd449bb64..be2a55067 100644 --- a/src/net/eathena/auctionhandler.cpp +++ b/src/net/eathena/auctionhandler.cpp @@ -35,6 +35,7 @@ AuctionHandler::AuctionHandler() : static const uint16_t _messages[] = { SMSG_AUCTION_OPEN_WINDOW, + SMSG_AUCTION_RESULTS, 0 }; handledMessages = _messages; @@ -49,6 +50,10 @@ void AuctionHandler::handleMessage(Net::MessageIn &msg) processOpenWindow(msg); break; + case SMSG_AUCTION_RESULTS: + processAuctionResults(msg); + break; + default: break; } @@ -59,4 +64,28 @@ void AuctionHandler::processOpenWindow(Net::MessageIn &msg) msg.readInt32("flag"); // 0 - open, 1 - close } +void AuctionHandler::processAuctionResults(Net::MessageIn &msg) +{ + const int count = msg.readInt16("len"); + msg.readInt32("pages"); + const int itemCount = msg.readInt32("items count"); + for (int f = 0; f < itemCount; f ++) + { + msg.readInt32("auction id"); + msg.readString(24, "seller name"); + msg.readInt32("item id"); + msg.readInt32("auction type"); + msg.readInt16("item amount"); // always 1 + msg.readUInt8("identify"); + msg.readUInt8("attribute"); + msg.readUInt8("refine"); + for (int f = 0; f < 4; f++) + msg.readInt16("card"); + msg.readInt32("price"); + msg.readInt32("buy now"); + msg.readString(24, "buyer name"); + msg.readInt32("timestamp"); + } +} + } // namespace EAthena diff --git a/src/net/eathena/auctionhandler.h b/src/net/eathena/auctionhandler.h index aa0cdaca6..2f24d16d6 100644 --- a/src/net/eathena/auctionhandler.h +++ b/src/net/eathena/auctionhandler.h @@ -38,6 +38,8 @@ class AuctionHandler final : public MessageHandler, public Net::AuctionHandler protected: static void processOpenWindow(Net::MessageIn &msg); + + static void processAuctionResults(Net::MessageIn &msg); }; } // namespace EAthena diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index 10d567e1e..6d69f6778 100644 --- a/src/net/eathena/packets.h +++ b/src/net/eathena/packets.h @@ -89,7 +89,7 @@ int16_t packet_lengths[] = 12, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // #0x0240 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, 6, + 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 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, // #0x0280 diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index 543eb7cc0..6a82f6265 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -301,6 +301,7 @@ #define SMSG_FRIENDS_REQUEST_ACK 0x0209 #define SMSG_AUCTION_OPEN_WINDOW 0x025f +#define SMSG_AUCTION_RESULTS 0x0252 #define SMSG_ELEMENTAL_UPDATE_STATUS 0x081e #define SMSG_ELEMENTAL_INFO 0x081d -- cgit v1.2.3-60-g2f50