summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-03-25 13:09:04 +0300
committerAndrei Karas <akaras@inbox.ru>2013-03-25 13:09:04 +0300
commit90a652e5c672b9a11b165ee939889f406b852ee1 (patch)
tree4841dff5271783feb53cd2d5164aea4c2ebf69b7 /src/net/tmwa
parenta306ecf96736779b08d1de7ec994d3d741d5dc61 (diff)
downloadmanaplus-90a652e5c672b9a11b165ee939889f406b852ee1.tar.gz
manaplus-90a652e5c672b9a11b165ee939889f406b852ee1.tar.bz2
manaplus-90a652e5c672b9a11b165ee939889f406b852ee1.tar.xz
manaplus-90a652e5c672b9a11b165ee939889f406b852ee1.zip
improve adminhandler class.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/adminhandler.cpp8
-rw-r--r--src/net/tmwa/adminhandler.h4
2 files changed, 5 insertions, 7 deletions
diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp
index dcb29e247..f5a8b7d05 100644
--- a/src/net/tmwa/adminhandler.cpp
+++ b/src/net/tmwa/adminhandler.cpp
@@ -55,12 +55,10 @@ AdminHandler::AdminHandler() :
void AdminHandler::handleMessage(Net::MessageIn &msg)
{
BLOCK_START("AdminHandler::handleMessage")
- 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);
@@ -84,13 +82,13 @@ void AdminHandler::localAnnounce(const std::string &text)
outMsg.writeString(text, static_cast<int>(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/tmwa/adminhandler.h b/src/net/tmwa/adminhandler.h
index 8df5cd5ca..f322cf4bf 100644
--- a/src/net/tmwa/adminhandler.h
+++ b/src/net/tmwa/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 TmwAthena