diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-02-15 13:32:56 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-02-15 13:37:30 +0300 |
commit | e59fc67ba665be08a9d9a3fa27139d31168d324a (patch) | |
tree | 6da43b9ced968ceccf8614f8a2cffb580a1f9563 /src/net | |
parent | 35dff83d93c36cd294f1899b1530da88a80b8917 (diff) | |
download | mv-e59fc67ba665be08a9d9a3fa27139d31168d324a.tar.gz mv-e59fc67ba665be08a9d9a3fa27139d31168d324a.tar.bz2 mv-e59fc67ba665be08a9d9a3fa27139d31168d324a.tar.xz mv-e59fc67ba665be08a9d9a3fa27139d31168d324a.zip |
eathena: impliment packets SMSG_BUYINGSTORE_SHOW_BOARD, SMSG_BUYINGSTORE_HIDE_BOARD.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/eathena/buyingstorehandler.cpp | 19 | ||||
-rw-r--r-- | src/net/eathena/packets.h | 2 |
2 files changed, 17 insertions, 4 deletions
diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp index 18e933c56..33fd8a4ee 100644 --- a/src/net/eathena/buyingstorehandler.cpp +++ b/src/net/eathena/buyingstorehandler.cpp @@ -20,10 +20,12 @@ #include "net/eathena/buyingstorehandler.h" +#include "actormanager.h" #include "notifymanager.h" #include "shopitem.h" #include "being/being.h" +#include "being/localplayer.h" #include "being/playerinfo.h" #include "listeners/buyingstoremodelistener.h" @@ -157,13 +159,24 @@ void BuyingStoreHandler::processBuyingStoreOwnItems(Net::MessageIn &msg) void BuyingStoreHandler::processBuyingStoreShowBoard(Net::MessageIn &msg) { - msg.readInt32("account id"); - msg.readString(80, "board name"); + const int id = msg.readInt32("owner id"); + const std::string shopName = msg.readString(80, "shop name"); + Being *const dstBeing = actorManager->findBeing(id); + if (dstBeing) + dstBeing->setBuyBoard(shopName); } void BuyingStoreHandler::processBuyingStoreHideBoard(Net::MessageIn &msg) { - msg.readInt32("account id"); + const int id = msg.readInt32("owner id"); + Being *const dstBeing = actorManager->findBeing(id); + if (dstBeing) + dstBeing->setBuyBoard(std::string()); + if (dstBeing == localPlayer) + { + PlayerInfo::enableVending(false); + BuyingStoreModeListener::distributeEvent(false); + } } void BuyingStoreHandler::processBuyingStoreItemsList(Net::MessageIn &msg) diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index 6bff795cc..af745449c 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, -1, 0, 4, 10, 10, 22, 8, 0, + 3, 0, 8, -1, 86, -1, 6, 0, -1, 0, 4, 10, 10, 22, 8, 0, 0, 0, 0, 0, 6, 0, -1, 3, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 5, 0, 0, 6, 26, 0, // #0x0840 |