From 4ea298eef5d60e7101844add7f352d4539ea9dd7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 24 Aug 2015 16:07:00 +0300 Subject: Rename bank receive handler into bankrecv. --- src/net/eathena/bank.cpp | 61 ----------------------------------------- src/net/eathena/bank.h | 41 --------------------------- src/net/eathena/bankhandler.cpp | 8 +++--- src/net/eathena/bankrecv.cpp | 61 +++++++++++++++++++++++++++++++++++++++++ src/net/eathena/bankrecv.h | 41 +++++++++++++++++++++++++++ 5 files changed, 106 insertions(+), 106 deletions(-) delete mode 100644 src/net/eathena/bank.cpp delete mode 100644 src/net/eathena/bank.h create mode 100644 src/net/eathena/bankrecv.cpp create mode 100644 src/net/eathena/bankrecv.h (limited to 'src/net') diff --git a/src/net/eathena/bank.cpp b/src/net/eathena/bank.cpp deleted file mode 100644 index 4e1f74f9c..000000000 --- a/src/net/eathena/bank.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "net/eathena/bank.h" - -#include "notifymanager.h" - -#include "enums/resources/notifytypes.h" - -#include "listeners/banklistener.h" - -#include "debug.h" - -namespace EAthena -{ - -void Bank::processBankStatus(Net::MessageIn &msg) -{ - const int money = static_cast(msg.readInt64("money")); - msg.readInt16("reason"); - BankListener::distributeEvent(money); -} - -void Bank::processBankDeposit(Net::MessageIn &msg) -{ - const int reason = msg.readInt16("reason"); - const int money = static_cast(msg.readInt64("money")); - msg.readInt32("balance"); - BankListener::distributeEvent(money); - if (reason) - NotifyManager::notify(NotifyTypes::BANK_DEPOSIT_FAILED); -} - -void Bank::processBankWithdraw(Net::MessageIn &msg) -{ - const int reason = msg.readInt16("reason"); - const int money = static_cast(msg.readInt64("money")); - msg.readInt32("balance"); - BankListener::distributeEvent(money); - if (reason) - NotifyManager::notify(NotifyTypes::BANK_WITHDRAW_FAILED); -} - -} // namespace EAthena diff --git a/src/net/eathena/bank.h b/src/net/eathena/bank.h deleted file mode 100644 index ffc24a04d..000000000 --- a/src/net/eathena/bank.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef NET_EATHENA_BANK_H -#define NET_EATHENA_BANK_H - -#ifdef EATHENA_SUPPORT - -#include "net/bankhandler.h" - -#include "net/eathena/messagehandler.h" - -namespace EAthena -{ - namespace Bank - { - void processBankStatus(Net::MessageIn &msg); - void processBankDeposit(Net::MessageIn &msg); - void processBankWithdraw(Net::MessageIn &msg); - } // namespace Bank -} // namespace EAthena - -#endif // EATHENA_SUPPORT -#endif // NET_EATHENA_BANK_H diff --git a/src/net/eathena/bankhandler.cpp b/src/net/eathena/bankhandler.cpp index 1897b7a9a..f4be79dec 100644 --- a/src/net/eathena/bankhandler.cpp +++ b/src/net/eathena/bankhandler.cpp @@ -26,7 +26,7 @@ #include "listeners/banklistener.h" -#include "net/eathena/bank.h" +#include "net/eathena/bankrecv.h" #include "net/eathena/messageout.h" #include "net/eathena/protocol.h" @@ -56,15 +56,15 @@ void BankHandler::handleMessage(Net::MessageIn &msg) switch (msg.getId()) { case SMSG_BANK_STATUS: - Bank::processBankStatus(msg); + BankRecv::processBankStatus(msg); break; case SMSG_BANK_DEPOSIT: - Bank::processBankDeposit(msg); + BankRecv::processBankDeposit(msg); break; case SMSG_BANK_WITHDRAW: - Bank::processBankWithdraw(msg); + BankRecv::processBankWithdraw(msg); break; default: diff --git a/src/net/eathena/bankrecv.cpp b/src/net/eathena/bankrecv.cpp new file mode 100644 index 000000000..d50984dcf --- /dev/null +++ b/src/net/eathena/bankrecv.cpp @@ -0,0 +1,61 @@ +/* + * The ManaPlus Client + * Copyright (C) 2011-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "net/eathena/bankrecv.h" + +#include "notifymanager.h" + +#include "enums/resources/notifytypes.h" + +#include "listeners/banklistener.h" + +#include "debug.h" + +namespace EAthena +{ + +void BankRecv::processBankStatus(Net::MessageIn &msg) +{ + const int money = static_cast(msg.readInt64("money")); + msg.readInt16("reason"); + BankListener::distributeEvent(money); +} + +void BankRecv::processBankDeposit(Net::MessageIn &msg) +{ + const int reason = msg.readInt16("reason"); + const int money = static_cast(msg.readInt64("money")); + msg.readInt32("balance"); + BankListener::distributeEvent(money); + if (reason) + NotifyManager::notify(NotifyTypes::BANK_DEPOSIT_FAILED); +} + +void BankRecv::processBankWithdraw(Net::MessageIn &msg) +{ + const int reason = msg.readInt16("reason"); + const int money = static_cast(msg.readInt64("money")); + msg.readInt32("balance"); + BankListener::distributeEvent(money); + if (reason) + NotifyManager::notify(NotifyTypes::BANK_WITHDRAW_FAILED); +} + +} // namespace EAthena diff --git a/src/net/eathena/bankrecv.h b/src/net/eathena/bankrecv.h new file mode 100644 index 000000000..95bf8e1da --- /dev/null +++ b/src/net/eathena/bankrecv.h @@ -0,0 +1,41 @@ +/* + * The ManaPlus Client + * Copyright (C) 2011-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef NET_EATHENA_BANK_H +#define NET_EATHENA_BANK_H + +#ifdef EATHENA_SUPPORT + +#include "net/bankhandler.h" + +#include "net/eathena/messagehandler.h" + +namespace EAthena +{ + namespace BankRecv + { + void processBankStatus(Net::MessageIn &msg); + void processBankDeposit(Net::MessageIn &msg); + void processBankWithdraw(Net::MessageIn &msg); + } // namespace BankRecv +} // namespace EAthena + +#endif // EATHENA_SUPPORT +#endif // NET_EATHENA_BANK_H -- cgit v1.2.3-60-g2f50