diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-04-05 20:22:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-04-05 20:22:00 +0300 |
commit | bd44e8d0a94dd96e6f8eb0828b4f2b5de902ee83 (patch) | |
tree | 28bfbcce0f7f34db5a42c7a27dfdac3a75b80e14 /src/actions/commands.cpp | |
parent | 84b6217136c8d59347ab9f28ec5e9e4d718d5058 (diff) | |
download | manaverse-bd44e8d0a94dd96e6f8eb0828b4f2b5de902ee83.tar.gz manaverse-bd44e8d0a94dd96e6f8eb0828b4f2b5de902ee83.tar.bz2 manaverse-bd44e8d0a94dd96e6f8eb0828b4f2b5de902ee83.tar.xz manaverse-bd44e8d0a94dd96e6f8eb0828b4f2b5de902ee83.zip |
add chat command for join chat room.
New chat command: /joinroom NAME
Diffstat (limited to 'src/actions/commands.cpp')
-rw-r--r-- | src/actions/commands.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 76d94886c..18206b9a3 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -55,6 +55,7 @@ #include "net/serverfeatures.h" #include "resources/iteminfo.h" +#include "resources/chatobject.h" #include "utils/chatutils.h" #include "utils/gettext.h" @@ -881,4 +882,20 @@ impHandler(createPublicChatRoom) #endif } +impHandler(joinChatRoom) +{ +#ifdef EATHENA_SUPPORT + const std::string args = event.args; + if (args.empty()) + return false; + ChatObject *const chat = ChatObject::findByName(args); + if (!chat) + return false; + chatHandler->joinChat(chat, ""); + return true; +#else + return false; +#endif +} + } // namespace Actions |