diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-08-23 17:36:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-08-23 17:36:35 +0300 |
commit | 5beba12b38c13c222322af111e17ed1aada62daf (patch) | |
tree | a0261be40596bc0babdb553d95601f23a35ed421 /src/net/eathena/bankhandler.cpp | |
parent | 6690099a0156a2c842e77bf8bd7a306ee917a74a (diff) | |
download | plus-5beba12b38c13c222322af111e17ed1aada62daf.tar.gz plus-5beba12b38c13c222322af111e17ed1aada62daf.tar.bz2 plus-5beba12b38c13c222322af111e17ed1aada62daf.tar.xz plus-5beba12b38c13c222322af111e17ed1aada62daf.zip |
Move receive code from bankhandler into separate file.
Diffstat (limited to 'src/net/eathena/bankhandler.cpp')
-rw-r--r-- | src/net/eathena/bankhandler.cpp | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/src/net/eathena/bankhandler.cpp b/src/net/eathena/bankhandler.cpp index e4dff0710..1897b7a9a 100644 --- a/src/net/eathena/bankhandler.cpp +++ b/src/net/eathena/bankhandler.cpp @@ -26,6 +26,7 @@ #include "listeners/banklistener.h" +#include "net/eathena/bank.h" #include "net/eathena/messageout.h" #include "net/eathena/protocol.h" @@ -55,15 +56,15 @@ void BankHandler::handleMessage(Net::MessageIn &msg) switch (msg.getId()) { case SMSG_BANK_STATUS: - processBankStatus(msg); + Bank::processBankStatus(msg); break; case SMSG_BANK_DEPOSIT: - processBankDeposit(msg); + Bank::processBankDeposit(msg); break; case SMSG_BANK_WITHDRAW: - processBankWithdraw(msg); + Bank::processBankWithdraw(msg); break; default: @@ -91,33 +92,6 @@ void BankHandler::check() const outMsg.writeInt32(0, "account id"); } -void BankHandler::processBankStatus(Net::MessageIn &msg) -{ - const int money = static_cast<int>(msg.readInt64("money")); - msg.readInt16("reason"); - BankListener::distributeEvent(money); -} - -void BankHandler::processBankDeposit(Net::MessageIn &msg) -{ - const int reason = msg.readInt16("reason"); - const int money = static_cast<int>(msg.readInt64("money")); - msg.readInt32("balance"); - BankListener::distributeEvent(money); - if (reason) - NotifyManager::notify(NotifyTypes::BANK_DEPOSIT_FAILED); -} - -void BankHandler::processBankWithdraw(Net::MessageIn &msg) -{ - const int reason = msg.readInt16("reason"); - const int money = static_cast<int>(msg.readInt64("money")); - msg.readInt32("balance"); - BankListener::distributeEvent(money); - if (reason) - NotifyManager::notify(NotifyTypes::BANK_WITHDRAW_FAILED); -} - void BankHandler::open() const { createOutPacket(CMSG_BANK_OPEN); |