summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net/manaserv/manaserv_protocol.h8
-rw-r--r--src/net/manaserv/partyhandler.cpp14
2 files changed, 17 insertions, 5 deletions
diff --git a/src/net/manaserv/manaserv_protocol.h b/src/net/manaserv/manaserv_protocol.h
index 53dc07df..ca9a0f02 100644
--- a/src/net/manaserv/manaserv_protocol.h
+++ b/src/net/manaserv/manaserv_protocol.h
@@ -186,9 +186,11 @@ enum {
CPMSG_GUILD_REJOIN = 0x0389, // S name, W guild, W rights, W channel, S announce
// Party
- PCMSG_PARTY_INVITE = 0x03A0, // S name
- CPMSG_PARTY_INVITE_RESPONSE = 0x03A1, // B error, S name
- CPMSG_PARTY_INVITED = 0x03A2, // S name
+ PGMSG_PARTY_INVITE = 0x03A0, // S name
+ GPMSG_PARTY_INVITE_ERROR = 0x03A1, // S name
+ GCMSG_PARTY_INVITE = 0x03A2, // S inviter, S invitee
+ CPMSG_PARTY_INVITE_RESPONSE = 0x03A3, // B error, S name
+ CPMSG_PARTY_INVITED = 0x03A4, // S name
PCMSG_PARTY_ACCEPT_INVITE = 0x03A5, // S name
CPMSG_PARTY_ACCEPT_INVITE_RESPONSE = 0x03A6, // B error, { S name }
PCMSG_PARTY_REJECT_INVITE = 0x03A7, // S name
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)