summaryrefslogtreecommitdiff
path: root/src/net/eathena/auctionhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-01-05 23:58:26 +0300
committerAndrei Karas <akaras@inbox.ru>2015-01-05 23:58:26 +0300
commit98daaa2544a5c0d907e438ce72913202c2c3c6ce (patch)
treecb605154e532ed153329f90223d7b345da6375ba /src/net/eathena/auctionhandler.cpp
parent40f332c5f45f295d57bceed2fed1291606daa162 (diff)
downloadmv-98daaa2544a5c0d907e438ce72913202c2c3c6ce.tar.gz
mv-98daaa2544a5c0d907e438ce72913202c2c3c6ce.tar.bz2
mv-98daaa2544a5c0d907e438ce72913202c2c3c6ce.tar.xz
mv-98daaa2544a5c0d907e438ce72913202c2c3c6ce.zip
eathena: add partial support for packet SMSG_AUCTION_RESULTS 0x0252.
Diffstat (limited to 'src/net/eathena/auctionhandler.cpp')
-rw-r--r--src/net/eathena/auctionhandler.cpp29
1 files changed, 29 insertions, 0 deletions
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