summaryrefslogtreecommitdiff
path: root/src/net/manaserv/partyhandler.cpp
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2011-05-30 23:15:34 +0200
committerStefan Dombrowski <stefan@uni-bonn.de>2011-05-30 23:16:26 +0200
commit46f4b656eeced8947c31e1b9cf4f027954df1c2c (patch)
tree099a72d3698fc028356728d201c5752479779a54 /src/net/manaserv/partyhandler.cpp
parent0248b2f58c783f21b7e68a20deadc0a3f942c869 (diff)
downloadmana-46f4b656eeced8947c31e1b9cf4f027954df1c2c.tar.gz
mana-46f4b656eeced8947c31e1b9cf4f027954df1c2c.tar.bz2
mana-46f4b656eeced8947c31e1b9cf4f027954df1c2c.tar.xz
mana-46f4b656eeced8947c31e1b9cf4f027954df1c2c.zip
Routing party invite through the map server
The player sends party invites to the game server. If the invitee is within the visual range of the inviter, then the game server forwards the invite to the chat server. Reviewed-by: Bjorn, Jaxad0127
Diffstat (limited to 'src/net/manaserv/partyhandler.cpp')
-rw-r--r--src/net/manaserv/partyhandler.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/net/manaserv/partyhandler.cpp b/src/net/manaserv/partyhandler.cpp
index 3af54f26..38829507 100644
--- a/src/net/manaserv/partyhandler.cpp
+++ b/src/net/manaserv/partyhandler.cpp
@@ -44,11 +44,13 @@ extern Net::PartyHandler *partyHandler;
namespace ManaServ {
extern Connection *chatServerConnection;
+extern Connection *gameServerConnection;
PartyHandler::PartyHandler():
mParty(Party::getParty(PARTY_ID))
{
static const Uint16 _messages[] = {
+ GPMSG_PARTY_INVITE_ERROR,
CPMSG_PARTY_INVITE_RESPONSE,
CPMSG_PARTY_INVITED,
CPMSG_PARTY_ACCEPT_INVITE_RESPONSE,
@@ -68,6 +70,14 @@ void PartyHandler::handleMessage(Net::MessageIn &msg)
{
switch (msg.getId())
{
+ case GPMSG_PARTY_INVITE_ERROR:
+ {
+ std::string name = msg.readString();
+ SERVER_NOTICE(strprintf(_("Party invite failed, because no player "
+ "called %s is within the visual range."),
+ name.c_str()));
+ } break;
+
case CPMSG_PARTY_INVITE_RESPONSE:
{
if (msg.readInt8() == ERRMSG_OK)
@@ -150,11 +160,11 @@ void PartyHandler::invite(Being *being)
void PartyHandler::invite(const std::string &name)
{
- MessageOut msg(PCMSG_PARTY_INVITE);
+ MessageOut msg(PGMSG_PARTY_INVITE);
msg.writeString(name);
- chatServerConnection->send(msg);
+ gameServerConnection->send(msg);
}
void PartyHandler::inviteResponse(const std::string &inviter, bool accept)