From 4b891f50dfc89318321eeac176415d1bef61aca6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 16 Oct 2014 01:04:04 +0300 Subject: Add bank window (hercules only). also add banklistener to get changed bank balance. --- src/net/eathena/bankhandler.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/net/eathena') diff --git a/src/net/eathena/bankhandler.cpp b/src/net/eathena/bankhandler.cpp index 0df1734ba..99d5cf9e9 100644 --- a/src/net/eathena/bankhandler.cpp +++ b/src/net/eathena/bankhandler.cpp @@ -20,6 +20,8 @@ #include "net/eathena/bankhandler.h" +#include "listeners/banklistener.h" + #include "net/eathena/messageout.h" #include "net/eathena/protocol.h" @@ -87,22 +89,25 @@ void BankHandler::check() const void BankHandler::processBankStatus(Net::MessageIn &msg) { - msg.readInt64("money"); + const int money = static_cast(msg.readInt64("money")); msg.readInt16("reason"); + BankListener::distributeEvent(money); } void BankHandler::processBankDeposit(Net::MessageIn &msg) { msg.readInt16("reason"); - msg.readInt64("money"); + const int money = static_cast(msg.readInt64("money")); msg.readInt32("balance"); + BankListener::distributeEvent(money); } void BankHandler::processBankWithdraw(Net::MessageIn &msg) { msg.readInt16("reason"); - msg.readInt64("money"); + const int money = static_cast(msg.readInt64("money")); msg.readInt32("balance"); + BankListener::distributeEvent(money); } } // namespace EAthena -- cgit v1.2.3-70-g09d2