diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/chat-server/chathandler.cpp | 10 | ||||
-rw-r--r-- | src/chat-server/chathandler.h | 119 | ||||
-rw-r--r-- | src/chat-server/guildhandler.cpp | 11 | ||||
-rw-r--r-- | src/chat-server/partyhandler.cpp | 2 |
4 files changed, 21 insertions, 121 deletions
diff --git a/src/chat-server/chathandler.cpp b/src/chat-server/chathandler.cpp index 1f063c1..73eede6 100644 --- a/src/chat-server/chathandler.cpp +++ b/src/chat-server/chathandler.cpp @@ -201,11 +201,11 @@ void ChatHandler::processMessage(NetComputer *comp, MessageIn &message) break; case PCMSG_GUILD_CREATE: - handleGuildCreation(computer, message); + handleGuildCreate(computer, message); break; case PCMSG_GUILD_INVITE: - handleGuildInvitation(computer, message); + handleGuildInvite(computer, message); break; case PCMSG_GUILD_ACCEPT: @@ -213,7 +213,7 @@ void ChatHandler::processMessage(NetComputer *comp, MessageIn &message) break; case PCMSG_GUILD_GET_MEMBERS: - handleGuildRetrieveMembers(computer, message); + handleGuildGetMembers(computer, message); break; case PCMSG_GUILD_PROMOTE_MEMBER: @@ -221,7 +221,7 @@ void ChatHandler::processMessage(NetComputer *comp, MessageIn &message) break; case PCMSG_GUILD_KICK_MEMBER: - handleGuildMemberKick(computer, message); + handleGuildKickMember(computer, message); case PCMSG_GUILD_QUIT: handleGuildQuit(computer, message); @@ -240,7 +240,7 @@ void ChatHandler::processMessage(NetComputer *comp, MessageIn &message) break; case PCMSG_PARTY_REJECT_INVITE: - handlePartyRejection(computer, message); + handlePartyRejectInvite(computer, message); break; default: diff --git a/src/chat-server/chathandler.h b/src/chat-server/chathandler.h index c6b680e..392f053 100644 --- a/src/chat-server/chathandler.h +++ b/src/chat-server/chathandler.h @@ -129,152 +129,55 @@ class ChatHandler : public ConnectionHandler void sendGuildEnterChannel(const MessageOut &msg, const std::string &name); - /** - * Send guild invite. - */ void sendGuildInvite(const std::string &invitedName, const std::string &inviterName, const std::string &guildName); private: - /** - * Deal with command messages. - */ + // TODO: Unused void handleCommand(ChatClient &client, const std::string &command); - /** - * Deal with Chat messages. - */ void handleChatMessage(ChatClient &client, MessageIn &msg); - - /** - * Deal with Announcement messages. - */ void handleAnnounceMessage(ChatClient &client, MessageIn &msg); - - /** - * Deal with Private messages. - */ void handlePrivMsgMessage(ChatClient &client, MessageIn &msg); - - /** - * Deal with Who messages. - */ void handleWhoMessage(ChatClient &client); - /** - * Deal with player entering channel. - */ void handleEnterChannelMessage(ChatClient &client, MessageIn &msg); - - /** - * Deal with player changing mode. - */ void handleModeChangeMessage(ChatClient &client, MessageIn &msg); - - /** - * Deal with player kicking other player from channel. - */ void handleKickUserMessage(ChatClient &client, MessageIn &msg); - - /** - * Deal with player leaving channel. - */ void handleQuitChannelMessage(ChatClient &client, MessageIn &msg); - /** - * Deal with listing all accessible channels. - */ void handleListChannelsMessage(ChatClient &client, MessageIn &msg); - - /** - * Deal with listing all channel users in a channel. - */ void handleListChannelUsersMessage(ChatClient &client, MessageIn &msg); - /** - * Deal with changing a channel's topic - */ void handleTopicChange(ChatClient &client, MessageIn &msg); - /** - * Deal with disconnection. - */ void handleDisconnectMessage(ChatClient &client, MessageIn &msg); - /** - * Deal with creating a guild. - */ - void handleGuildCreation(ChatClient &client, MessageIn &msg); - - /** - * Deal with inviting a player to a guild. - */ - void handleGuildInvitation(ChatClient &client, MessageIn &msg); - - /** - * Deal with accepting an invite to join a guild. - */ + void handleGuildCreate(ChatClient &client, MessageIn &msg); + void handleGuildInvite(ChatClient &client, MessageIn &msg); void handleGuildAcceptInvite(ChatClient &client, MessageIn &msg); - - /** - * Deal with returning all the guild members of a guild. - */ - void handleGuildRetrieveMembers(ChatClient &client, MessageIn &msg); - - /** - * Deal with level change of member - */ + void handleGuildGetMembers(ChatClient &client, MessageIn &msg); void handleGuildMemberLevelChange(ChatClient &client, MessageIn &msg); - - /** - * Deal with kicking a member - */ - void handleGuildMemberKick(ChatClient &client, MessageIn &msg); - - /** - * Deal with leaving a guild. - */ + void handleGuildKickMember(ChatClient &client, MessageIn &msg); void handleGuildQuit(ChatClient &client, MessageIn &msg); - /** - * Deal with a player joining a party. - * @return Returns whether player successfully joined the party - */ - bool handlePartyJoin(const std::string &invited, - const std::string &inviter); - - /** - * Deal with inviting player to a party - */ void handlePartyInvite(ChatClient &client, MessageIn &msg); - - /** - * Deal with accepting an invite to join a party - */ void handlePartyAcceptInvite(ChatClient &client, MessageIn &msg); - - /** - * Deal with leaving a party. - */ void handlePartyQuit(ChatClient &client); + // TODO: Merge with handlePartyAcceptInvite? + void handlePartyRejectInvite(ChatClient &client, MessageIn &msg); /** - * Tell user the invite was rejected + * Deal with a player joining a party. + * @return Whether player successfully joined the party */ - void handlePartyRejection(ChatClient &client, MessageIn &msg); + bool handlePartyJoin(const std::string &invited, + const std::string &inviter); - /** - * Remove user from party - */ void removeUserFromParty(ChatClient &client); /** - * Send new member info to party members. - */ - void sendPartyMemberInfo(ChatClient &client, MessageIn &msg); - - /** * Tell all the party members a member has left */ void informPartyMemberQuit(ChatClient &client); diff --git a/src/chat-server/guildhandler.cpp b/src/chat-server/guildhandler.cpp index 5e2b6d6..110727c 100644 --- a/src/chat-server/guildhandler.cpp +++ b/src/chat-server/guildhandler.cpp @@ -132,8 +132,7 @@ void ChatHandler::sendGuildListUpdate(const std::string &guildName, } } -void ChatHandler::handleGuildCreation(ChatClient &client, - MessageIn &msg) +void ChatHandler::handleGuildCreate(ChatClient &client, MessageIn &msg) { MessageOut reply(CPMSG_GUILD_CREATE_RESPONSE); @@ -168,8 +167,7 @@ void ChatHandler::handleGuildCreation(ChatClient &client, client.send(reply); } -void ChatHandler::handleGuildInvitation(ChatClient &client, - MessageIn &msg) +void ChatHandler::handleGuildInvite(ChatClient &client, MessageIn &msg) { MessageOut reply(CPMSG_GUILD_INVITE_RESPONSE); MessageOut invite(CPMSG_GUILD_INVITED); @@ -256,8 +254,7 @@ void ChatHandler::handleGuildAcceptInvite(ChatClient &client, client.send(reply); } -void ChatHandler::handleGuildRetrieveMembers(ChatClient &client, - MessageIn &msg) +void ChatHandler::handleGuildGetMembers(ChatClient &client, MessageIn &msg) { MessageOut reply(CPMSG_GUILD_GET_MEMBERS_RESPONSE); short guildId = msg.readInt16(); @@ -318,7 +315,7 @@ void ChatHandler::handleGuildMemberLevelChange(ChatClient &client, client.send(reply); } -void ChatHandler::handleGuildMemberKick(ChatClient &client, MessageIn &msg) +void ChatHandler::handleGuildKickMember(ChatClient &client, MessageIn &msg) { MessageOut reply(CPMSG_GUILD_KICK_MEMBER_RESPONSE); short guildId = msg.readInt16(); diff --git a/src/chat-server/partyhandler.cpp b/src/chat-server/partyhandler.cpp index 2c10546..3d4eaeb 100644 --- a/src/chat-server/partyhandler.cpp +++ b/src/chat-server/partyhandler.cpp @@ -174,7 +174,7 @@ void ChatHandler::handlePartyQuit(ChatClient &client) updateInfo(&client, 0); } -void ChatHandler::handlePartyRejection(ChatClient &client, MessageIn &msg) +void ChatHandler::handlePartyRejectInvite(ChatClient &client, MessageIn &msg) { MessageOut out(CPMSG_PARTY_REJECTED); |