summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-03-10 20:17:29 +0200
committerAndrei Karas <akaras@inbox.ru>2011-03-11 00:48:34 +0200
commitc030596364968f86f88546d3890e5b45929db47a (patch)
tree859f4e8bb525d8c2d5ec2569f1da498d8c14706f /src/net
parenta1d38a0ab4095c192390dbf10bca949454fc4b59 (diff)
downloadplus-c030596364968f86f88546d3890e5b45929db47a.tar.gz
plus-c030596364968f86f88546d3890e5b45929db47a.tar.bz2
plus-c030596364968f86f88546d3890e5b45929db47a.tar.xz
plus-c030596364968f86f88546d3890e5b45929db47a.zip
Show message if some one join your party.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/tmwa/partyhandler.cpp26
1 files changed, 25 insertions, 1 deletions
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<std::string> 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);