diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/net/tmwserv/chatserver/party.cpp | 10 | ||||
-rw-r--r-- | src/net/tmwserv/chatserver/party.h | 5 | ||||
-rw-r--r-- | src/net/tmwserv/partyhandler.cpp | 12 |
3 files changed, 25 insertions, 2 deletions
diff --git a/src/net/tmwserv/chatserver/party.cpp b/src/net/tmwserv/chatserver/party.cpp index e5bdd861..272bcbd7 100644 --- a/src/net/tmwserv/chatserver/party.cpp +++ b/src/net/tmwserv/chatserver/party.cpp @@ -50,6 +50,16 @@ void Net::ChatServer::Party::acceptInvite(const std::string &name) Net::ChatServer::connection->send(msg); } +void Net::ChatServer::Party::rejectInvite(const std::string &name) +{ + logger->log("Sending PCMSG_PARTY_REJECT_INVITE"); + MessageOut msg(PCMSG_PARTY_REJECT_INVITE); + + msg.writeString(name); + + Net::ChatServer::connection->send(msg); +} + void Net::ChatServer::Party::getPartyMembers() { logger->log("Sending PCMSG_PARTY_GET_MEMBERS"); diff --git a/src/net/tmwserv/chatserver/party.h b/src/net/tmwserv/chatserver/party.h index b3f0020b..3850c283 100644 --- a/src/net/tmwserv/chatserver/party.h +++ b/src/net/tmwserv/chatserver/party.h @@ -41,6 +41,11 @@ namespace Net void acceptInvite(const std::string &name); /** + * Reject an invite from another player to join their party + */ + void rejectInvite(const std::string &name); + + /** * Get a list of party members */ void getPartyMembers(); diff --git a/src/net/tmwserv/partyhandler.cpp b/src/net/tmwserv/partyhandler.cpp index 6a68ec95..01de1be8 100644 --- a/src/net/tmwserv/partyhandler.cpp +++ b/src/net/tmwserv/partyhandler.cpp @@ -50,6 +50,7 @@ PartyHandler::PartyHandler() CPMSG_PARTY_QUIT_RESPONSE, CPMSG_PARTY_NEW_MEMBER, CPMSG_PARTY_MEMBER_LEFT, + CPMSG_PARTY_REJECTED, 0 }; handledMessages = _messages; @@ -108,6 +109,12 @@ void PartyHandler::handleMessage(MessageIn &msg) { partyWindow->removeMember(msg.readString()); } break; + + case CPMSG_PARTY_REJECTED: + { + std::string name = msg.readString(); + localChatTab->chatLog(name + "rejected your invite."); + } break; } } @@ -135,12 +142,13 @@ void PartyHandler::inviteResponse(const std::string &inviter, bool accept) { if (accept) Net::ChatServer::Party::acceptInvite(inviter); - // TODO: rejection + else + Net::ChatServer::Party::rejectInvite(inviter); } void PartyHandler::leave() { - // TODO + Net::ChatServer::Party::quitParty(); } void PartyHandler::kick(Player *player) |