diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-04-02 06:08:23 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-04-02 06:10:19 -0600 |
commit | 128f908908b77b242b749b27879ba2a9f70a94f6 (patch) | |
tree | 613c7966a2711189b999bbed152294f3659f70f9 /src/net/ea/adminhandler.cpp | |
parent | ed907c859026ad2133858012b4798f7c074366c4 (diff) | |
download | mana-128f908908b77b242b749b27879ba2a9f70a94f6.tar.gz mana-128f908908b77b242b749b27879ba2a9f70a94f6.tar.bz2 mana-128f908908b77b242b749b27879ba2a9f70a94f6.tar.xz mana-128f908908b77b242b749b27879ba2a9f70a94f6.zip |
Add some missing handler for eAthena
Also expand aAthena's AdminHandler
Diffstat (limited to 'src/net/ea/adminhandler.cpp')
-rw-r--r-- | src/net/ea/adminhandler.cpp | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/src/net/ea/adminhandler.cpp b/src/net/ea/adminhandler.cpp index 83b798a6..c1194ef1 100644 --- a/src/net/ea/adminhandler.cpp +++ b/src/net/ea/adminhandler.cpp @@ -21,6 +21,7 @@ #include "net/ea/adminhandler.h" +#include "net/ea/chathandler.h" #include "net/ea/protocol.h" #include "net/messagein.h" @@ -39,13 +40,12 @@ #include <string> -#define SERVER_NAME "Server" - AdminHandler *adminHandler; AdminHandler::AdminHandler() { static const Uint16 _messages[] = { + SMSG_ADMIN_KICK_ACK, 0 }; handledMessages = _messages; @@ -54,9 +54,15 @@ AdminHandler::AdminHandler() void AdminHandler::handleMessage(MessageIn &msg) { + int id; switch (msg.getId()) { - case SMSG_WHISPER_RESPONSE: + case SMSG_ADMIN_KICK_ACK: + id = msg.readInt32(); + if (id == 0) + localChatTab->chatLog(_("Kick failed!"), BY_SERVER); + else + localChatTab->chatLog(_("Kick succedded!"), BY_SERVER); break; } } @@ -89,17 +95,31 @@ void AdminHandler::kick(int playerId) void AdminHandler::kick(const std::string &name) { - // Unsupported + chatHandler->talk("@kick " + name); } void AdminHandler::ban(int playerId) {} void AdminHandler::ban(const std::string &name) -{} +{ + chatHandler->talk("@ban " + name); +} void AdminHandler::unban(int playerId) {} void AdminHandler::unban(const std::string &name) -{} +{ + chatHandler->talk("@unban " + name); +} + +void AdminHandler::mute(int playerId, int type, int limit) +{ + return; // Still looking into this + + MessageOut outMsg(CMSG_ADMIN_MUTE); + outMsg.writeInt32(playerId); + outMsg.writeInt8(type); + outMsg.writeInt16(limit); +} |