summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/net')
-rw-r--r--src/net/manaserv/manaserv_protocol.h4
-rw-r--r--src/net/manaserv/partyhandler.cpp20
-rw-r--r--src/net/tmwa/partyhandler.cpp2
3 files changed, 17 insertions, 9 deletions
diff --git a/src/net/manaserv/manaserv_protocol.h b/src/net/manaserv/manaserv_protocol.h
index b5023a42..53dc07df 100644
--- a/src/net/manaserv/manaserv_protocol.h
+++ b/src/net/manaserv/manaserv_protocol.h
@@ -195,8 +195,8 @@ enum {
CPMSG_PARTY_REJECTED = 0x03A8, // S name
PCMSG_PARTY_QUIT = 0x03AA, // -
CPMSG_PARTY_QUIT_RESPONSE = 0x03AB, // B error
- CPMSG_PARTY_NEW_MEMBER = 0x03B0, // W being id, S name
- CPMSG_PARTY_MEMBER_LEFT = 0x03B1, // W being id
+ CPMSG_PARTY_NEW_MEMBER = 0x03B0, // D character id, S name
+ CPMSG_PARTY_MEMBER_LEFT = 0x03B1, // D character id
// Chat
CPMSG_ERROR = 0x0401, // B error
diff --git a/src/net/manaserv/partyhandler.cpp b/src/net/manaserv/partyhandler.cpp
index b30d5391..3af54f26 100644
--- a/src/net/manaserv/partyhandler.cpp
+++ b/src/net/manaserv/partyhandler.cpp
@@ -60,6 +60,8 @@ PartyHandler::PartyHandler():
};
handledMessages = _messages;
partyHandler = this;
+
+ mParty->setName("Party");
}
void PartyHandler::handleMessage(Net::MessageIn &msg)
@@ -83,10 +85,16 @@ void PartyHandler::handleMessage(Net::MessageIn &msg)
{
if (msg.readInt8() == ERRMSG_OK)
{
- //
- SERVER_NOTICE(_("Joined party."));
+ player_node->setParty(mParty);
+ while (msg.getUnreadLength())
+ {
+ std::string name = msg.readString();
+ mParty->addMember(0, name);
+ }
}
- }
+ else
+ SERVER_NOTICE(_("Joining party failed."));
+ } break;
case CPMSG_PARTY_QUIT_RESPONSE:
{
@@ -99,13 +107,13 @@ void PartyHandler::handleMessage(Net::MessageIn &msg)
case CPMSG_PARTY_NEW_MEMBER:
{
- int id = msg.readInt16(); // being id
+ int id = msg.readInt32();
std::string name = msg.readString();
SERVER_NOTICE(strprintf(_("%s joined the party."),
name.c_str()));
- if (id == player_node->getId())
+ if (name == player_node->getName())
player_node->setParty(mParty);
mParty->addMember(id, name);
@@ -113,7 +121,7 @@ void PartyHandler::handleMessage(Net::MessageIn &msg)
case CPMSG_PARTY_MEMBER_LEFT:
{
- mParty->removeMember(msg.readString());
+ // mParty->removeMember(msg.readString());
} break;
case CPMSG_PARTY_REJECTED:
diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp
index 00b1e621..2cfc2037 100644
--- a/src/net/tmwa/partyhandler.cpp
+++ b/src/net/tmwa/partyhandler.cpp
@@ -146,7 +146,7 @@ void PartyHandler::handleMessage(Net::MessageIn &msg)
nick = being->getName();
}
- socialWindow->showPartyInvite(partyName, nick);
+ socialWindow->showPartyInvite(nick, partyName);
break;
}
case SMSG_PARTY_SETTINGS: