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/eathena/buyingstorehandler.cpp | |
parent | 35dff83d93c36cd294f1899b1530da88a80b8917 (diff) | |
download | manaplus-e59fc67ba665be08a9d9a3fa27139d31168d324a.tar.gz manaplus-e59fc67ba665be08a9d9a3fa27139d31168d324a.tar.bz2 manaplus-e59fc67ba665be08a9d9a3fa27139d31168d324a.tar.xz manaplus-e59fc67ba665be08a9d9a3fa27139d31168d324a.zip |
eathena: impliment packets SMSG_BUYINGSTORE_SHOW_BOARD, SMSG_BUYINGSTORE_HIDE_BOARD.
Diffstat (limited to 'src/net/eathena/buyingstorehandler.cpp')
-rw-r--r-- | src/net/eathena/buyingstorehandler.cpp | 19 |
1 files changed, 16 insertions, 3 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) |