From c030596364968f86f88546d3890e5b45929db47a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 10 Mar 2011 20:17:29 +0200 Subject: Show message if some one join your party. --- src/net/tmwa/partyhandler.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src/net') diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp index 77fbde20e..bd9766c4b 100644 --- a/src/net/tmwa/partyhandler.cpp +++ b/src/net/tmwa/partyhandler.cpp @@ -87,11 +87,23 @@ void PartyHandler::handleMessage(Net::MessageIn &msg) break; case SMSG_PARTY_INFO: { + bool oldParty = false; + std::set names; if (!taParty) { logger->log1("error: party empty in SMSG_PARTY_INFO"); taParty = Party::getParty(1); } + if (taParty) + { + if (taParty->getNumberOfElements() > 1) + { + oldParty = true; + + taParty->getNamesSet(names); + } + } + if (!player_node) logger->log1("error: player_node==0 in SMSG_PARTY_INFO"); @@ -119,7 +131,19 @@ void PartyHandler::handleMessage(Net::MessageIn &msg) if (taParty) { - PartyMember *member = taParty->addMember(id, nick); + PartyMember *member = 0; + if (oldParty) + { + //member = taParty->getMember(id); + if (partyTab && names.find(nick) == names.end()) + { + partyTab->chatLog(strprintf( + _("%s has join your party."), + nick.c_str()), BY_SERVER); + } + } + member = taParty->addMember(id, nick); + if (member) { member->setLeader(leader); -- cgit v1.2.3-70-g09d2