diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-04-05 21:50:02 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-04-05 21:50:02 -0600 |
commit | bcc4695387d21f9629ab6f013aadbfe0d238aa6d (patch) | |
tree | 2e095ec94e99e788eb851a37cdf5eae68270424c /src/net/ea | |
parent | 9078373860729cdf80db8d09cbdee478dc54ec64 (diff) | |
download | mana-bcc4695387d21f9629ab6f013aadbfe0d238aa6d.tar.gz mana-bcc4695387d21f9629ab6f013aadbfe0d238aa6d.tar.bz2 mana-bcc4695387d21f9629ab6f013aadbfe0d238aa6d.tar.xz mana-bcc4695387d21f9629ab6f013aadbfe0d238aa6d.zip |
Implement TMWServ's Admin-, Chat-, and MapHandlers
Diffstat (limited to 'src/net/ea')
-rw-r--r-- | src/net/ea/adminhandler.cpp | 16 | ||||
-rw-r--r-- | src/net/ea/adminhandler.h | 4 | ||||
-rw-r--r-- | src/net/ea/chathandler.cpp | 11 | ||||
-rw-r--r-- | src/net/ea/chathandler.h | 9 | ||||
-rw-r--r-- | src/net/ea/maphandler.cpp | 6 | ||||
-rw-r--r-- | src/net/ea/maphandler.h | 4 |
6 files changed, 38 insertions, 12 deletions
diff --git a/src/net/ea/adminhandler.cpp b/src/net/ea/adminhandler.cpp index 04c946c0..c84cdea3 100644 --- a/src/net/ea/adminhandler.cpp +++ b/src/net/ea/adminhandler.cpp @@ -40,7 +40,11 @@ #include <string> -AdminHandler *adminHandler; +extern Net::ChatHandler *chatHandler; + +Net::AdminHandler *adminHandler; + +namespace EAthena { AdminHandler::AdminHandler() { @@ -99,7 +103,9 @@ void AdminHandler::kick(const std::string &name) } void AdminHandler::ban(int playerId) -{} +{ + // Not supported +} void AdminHandler::ban(const std::string &name) { @@ -107,7 +113,9 @@ void AdminHandler::ban(const std::string &name) } void AdminHandler::unban(int playerId) -{} +{ + // Not supported +} void AdminHandler::unban(const std::string &name) { @@ -123,3 +131,5 @@ void AdminHandler::mute(int playerId, int type, int limit) outMsg.writeInt8(type); outMsg.writeInt16(limit); } + +} // namespace EAthena diff --git a/src/net/ea/adminhandler.h b/src/net/ea/adminhandler.h index a7db0113..6ef4f76a 100644 --- a/src/net/ea/adminhandler.h +++ b/src/net/ea/adminhandler.h @@ -26,6 +26,8 @@ #include "net/messagehandler.h" #include "net/net.h" +namespace EAthena { + class AdminHandler : public MessageHandler, public Net::AdminHandler { public: @@ -54,6 +56,6 @@ class AdminHandler : public MessageHandler, public Net::AdminHandler void mute(int playerId, int type, int limit); }; -extern AdminHandler *adminHandler; +} // namespace EAthena #endif // NET_EA_ADMINHANDLER_H diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index 3abf2b24..13593ed1 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -42,7 +42,9 @@ #define SERVER_NAME "Server" -ChatHandler *chatHandler; +Net::ChatHandler *chatHandler; + +namespace EAthena { ChatHandler::ChatHandler() { @@ -201,7 +203,8 @@ void ChatHandler::channelList() // TODO } -void ChatHandler::enterChannel(int channelId, const std::string &password) +void ChatHandler::enterChannel(const std::string &channel, + const std::string &password) { // TODO } @@ -216,7 +219,7 @@ void ChatHandler::sendToChannel(int channelId, const std::string &text) // TODO } -void ChatHandler::userList(int channelId) +void ChatHandler::userList(const std::string &channel) { // TODO } @@ -235,3 +238,5 @@ void ChatHandler::kickUser(int channelId, const std::string &name) { // TODO } + +} // namespace EAthena diff --git a/src/net/ea/chathandler.h b/src/net/ea/chathandler.h index 6ca71b80..a907535e 100644 --- a/src/net/ea/chathandler.h +++ b/src/net/ea/chathandler.h @@ -26,6 +26,8 @@ #include "net/messagehandler.h" #include "net/net.h" +namespace EAthena { + class ChatHandler : public MessageHandler, public Net::ChatHandler { public: @@ -42,13 +44,14 @@ class ChatHandler : public MessageHandler, public Net::ChatHandler void channelList(); - void enterChannel(int channelId, const std::string &password); + void enterChannel(const std::string &channel, + const std::string &password); void quitChannel(int channelId); void sendToChannel(int channelId, const std::string &text); - void userList(int channelId); + void userList(const std::string &channel); void setChannelTopic(int channelId, const std::string &text); @@ -57,6 +60,6 @@ class ChatHandler : public MessageHandler, public Net::ChatHandler void kickUser(int channelId, const std::string &name); }; -extern ChatHandler *chatHandler; +} // namespace EAthena #endif // NET_EA_CHATHANDLER_H diff --git a/src/net/ea/maphandler.cpp b/src/net/ea/maphandler.cpp index d12106d6..6912176f 100644 --- a/src/net/ea/maphandler.cpp +++ b/src/net/ea/maphandler.cpp @@ -35,7 +35,9 @@ #include "utils/gettext.h" #include "utils/stringutils.h" -MapHandler *mapHandler; +Net::MapHandler *mapHandler; + +namespace EAthena { MapHandler::MapHandler() { @@ -127,3 +129,5 @@ void MapHandler::ping(int tick) MessageOut msg(CMSG_CLIENT_PING); msg.writeInt32(tick); } + +} // namespace EAthena diff --git a/src/net/ea/maphandler.h b/src/net/ea/maphandler.h index d4ccdbe2..205ee18d 100644 --- a/src/net/ea/maphandler.h +++ b/src/net/ea/maphandler.h @@ -26,6 +26,8 @@ #include "net/messagehandler.h" #include "net/net.h" +namespace EAthena { + class MapHandler : public MessageHandler, public Net::MapHandler { public: @@ -44,6 +46,6 @@ class MapHandler : public MessageHandler, public Net::MapHandler void ping(int tick); }; -extern MapHandler *mapHandler; +} // namespace EAthena #endif // NET_EA_MAPHANDLER_H |