From 90a652e5c672b9a11b165ee939889f406b852ee1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 25 Mar 2013 13:09:04 +0300 Subject: improve adminhandler class. --- src/net/eathena/adminhandler.cpp | 8 +++----- src/net/eathena/adminhandler.h | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src/net/eathena') diff --git a/src/net/eathena/adminhandler.cpp b/src/net/eathena/adminhandler.cpp index 23909bef1..0b2d91063 100644 --- a/src/net/eathena/adminhandler.cpp +++ b/src/net/eathena/adminhandler.cpp @@ -55,12 +55,10 @@ AdminHandler::AdminHandler() : void AdminHandler::handleMessage(Net::MessageIn &msg) { - int id; switch (msg.getId()) { case SMSG_ADMIN_KICK_ACK: - id = msg.readInt32(); - if (id == 0) + if (msg.readInt32() == 0) NotifyManager::notify(NotifyManager::KICK_FAIL); else NotifyManager::notify(NotifyManager::KICK_SUCCEED); @@ -83,13 +81,13 @@ void AdminHandler::localAnnounce(const std::string &text) outMsg.writeString(text, static_cast(text.length())); } -void AdminHandler::hide(bool h A_UNUSED) +void AdminHandler::hide(const bool h A_UNUSED) { MessageOut outMsg(CMSG_ADMIN_HIDE); outMsg.writeInt32(0); //unused } -void AdminHandler::kick(int playerId) +void AdminHandler::kick(const int playerId) { MessageOut outMsg(CMSG_ADMIN_KICK); outMsg.writeInt32(playerId); diff --git a/src/net/eathena/adminhandler.h b/src/net/eathena/adminhandler.h index bcd193fb1..e6ba376f3 100644 --- a/src/net/eathena/adminhandler.h +++ b/src/net/eathena/adminhandler.h @@ -46,9 +46,9 @@ class AdminHandler final : public MessageHandler, public Ea::AdminHandler void localAnnounce(const std::string &text); - void hide(bool h); + void hide(const bool h); - void kick(int playerId); + void kick(const int playerId); }; } // namespace EAthena -- cgit v1.2.3-70-g09d2