summaryrefslogtreecommitdiff
path: root/src/net/tmwserv
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2009-04-23 17:43:41 +0100
committerDavid Athay <ko2fan@gmail.com>2009-04-23 17:43:41 +0100
commitf676ce79cb51ac87d09619c09193e38431788270 (patch)
tree6e2bc688a6919809f72ffde540718a59d4269093 /src/net/tmwserv
parent0d439c39e99dbf1120dce784459176f744f70728 (diff)
downloadmana-client-f676ce79cb51ac87d09619c09193e38431788270.tar.gz
mana-client-f676ce79cb51ac87d09619c09193e38431788270.tar.bz2
mana-client-f676ce79cb51ac87d09619c09193e38431788270.tar.xz
mana-client-f676ce79cb51ac87d09619c09193e38431788270.zip
Added rejecting party invites.
Diffstat (limited to 'src/net/tmwserv')
-rw-r--r--src/net/tmwserv/chatserver/party.cpp10
-rw-r--r--src/net/tmwserv/chatserver/party.h5
-rw-r--r--src/net/tmwserv/partyhandler.cpp12
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)