summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-05 21:37:22 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-05 21:37:22 +0300
commit037a653c92fca6e34f6f27c05efe70b8d4d95178 (patch)
tree9ba89841f7672e77a871bb2265f691f9f3910628 /src
parent6998289cd1f4650ad686731c6925e05b4c9fb82a (diff)
downloadmv-037a653c92fca6e34f6f27c05efe70b8d4d95178.tar.gz
mv-037a653c92fca6e34f6f27c05efe70b8d4d95178.tar.bz2
mv-037a653c92fca6e34f6f27c05efe70b8d4d95178.tar.xz
mv-037a653c92fca6e34f6f27c05efe70b8d4d95178.zip
eathena: add partial support for packet SMSG_BUYINGSTORE_ITEMS_LIST 0x0818
Diffstat (limited to 'src')
-rw-r--r--src/net/eathena/buyingstorehandler.cpp20
-rw-r--r--src/net/eathena/buyingstorehandler.h2
-rw-r--r--src/net/eathena/packets.h2
-rw-r--r--src/net/eathena/protocol.h1
4 files changed, 24 insertions, 1 deletions
diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp
index 44a8a7d4b..42bd41c7b 100644
--- a/src/net/eathena/buyingstorehandler.cpp
+++ b/src/net/eathena/buyingstorehandler.cpp
@@ -49,6 +49,7 @@ BuyingStoreHandler::BuyingStoreHandler() :
SMSG_BUYINGSTORE_OWN_ITEMS,
SMSG_BUYINGSTORE_SHOW_BOARD,
SMSG_BUYINGSTORE_HIDE_BOARD,
+ SMSG_BUYINGSTORE_ITEMS_LIST,
0
};
handledMessages = _messages;
@@ -79,6 +80,10 @@ void BuyingStoreHandler::handleMessage(Net::MessageIn &msg)
processBuyingStoreHideBoard(msg);
break;
+ case SMSG_BUYINGSTORE_ITEMS_LIST:
+ processBuyingStoreItemsList(msg);
+ break;
+
default:
break;
}
@@ -136,6 +141,21 @@ void BuyingStoreHandler::processBuyingStoreHideBoard(Net::MessageIn &msg)
msg.readInt32("account id");
}
+void BuyingStoreHandler::processBuyingStoreItemsList(Net::MessageIn &msg)
+{
+ const int count = (msg.readInt16("len") - 16) / 9;
+ msg.readInt32("account id");
+ msg.readInt32("store id");
+ msg.readInt32("money limit");
+ for (int f = 0; f < count; f ++)
+ {
+ msg.readInt32("price");
+ msg.readInt16("amount");
+ msg.readUInt8("item type");
+ msg.readInt16("item id");
+ }
+}
+
void BuyingStoreHandler::create(const std::string &name,
const int maxMoney,
const bool flag,
diff --git a/src/net/eathena/buyingstorehandler.h b/src/net/eathena/buyingstorehandler.h
index ae38bffa8..9c4e8a335 100644
--- a/src/net/eathena/buyingstorehandler.h
+++ b/src/net/eathena/buyingstorehandler.h
@@ -56,6 +56,8 @@ class BuyingStoreHandler final : public MessageHandler,
static void processBuyingStoreShowBoard(Net::MessageIn &msg);
static void processBuyingStoreHideBoard(Net::MessageIn &msg);
+
+ static void processBuyingStoreItemsList(Net::MessageIn &msg);
};
} // namespace EAthena
diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h
index 8dac54b14..54e5b21f1 100644
--- a/src/net/eathena/packets.h
+++ b/src/net/eathena/packets.h
@@ -216,7 +216,7 @@ int16_t packet_lengths[] =
//0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// #0x0800
-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 20,
- 3, 0, 8, -1, 86, -1, 0, 0, 0, 0, 0, 0, 0, 22, 8, 0,
+ 3, 0, 8, -1, 86, -1, 0, 0, -1, 0, 0, 0, 0, 22, 8, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 26, 0,
// #0x0840
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index c2be70ec0..99f6d2e1d 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -172,6 +172,7 @@
#define SMSG_BUYINGSTORE_OWN_ITEMS 0x0813
#define SMSG_BUYINGSTORE_SHOW_BOARD 0x0814
#define SMSG_BUYINGSTORE_HIDE_BOARD 0x0816
+#define SMSG_BUYINGSTORE_ITEMS_LIST 0x0818
// Receiving a request to trade
#define SMSG_TRADE_REQUEST 0x01f4