From 58ce176510f85a07523690d9cd67df850a8b1f58 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 27 Aug 2011 06:03:15 +0300 Subject: Put online player at top in guild list. --- src/guild.cpp | 4 ++-- src/guildmanager.cpp | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/guild.cpp b/src/guild.cpp index e36b68863..57b3d52e1 100644 --- a/src/guild.cpp +++ b/src/guild.cpp @@ -36,8 +36,8 @@ class SortGuildFunctor if (m1->getPos() != m2->getPos()) return m1->getPos() < m2->getPos(); -// if (m1->getOnline() != m2->getOnline()) -// return m1->getOnline() > m2->getOnline(); + if (m1->getOnline() != m2->getOnline()) + return m1->getOnline() > m2->getOnline(); return m1->getName() < m2->getName(); } diff --git a/src/guildmanager.cpp b/src/guildmanager.cpp index ec9de2506..8f480803a 100644 --- a/src/guildmanager.cpp +++ b/src/guildmanager.cpp @@ -107,7 +107,6 @@ void GuildManager::updateList() Guild *guild = Guild::getGuild(1); if (guild) { - logger->log("filling player"); guild->setServerGuild(false); std::vector::iterator it = mTempList.begin(); std::vector::iterator it_end = mTempList.end(); @@ -172,9 +171,10 @@ bool GuildManager::process(std::string msg) if (msg[0] == '#' && msg[1] == '#') msg = msg.substr(3); - GuildMember *m = guild->getMember(msg); + GuildMember *m = guild->addMember(msg); if (m) m->setOnline(false); + guild->sort(); mRequest = false; return true; } @@ -184,9 +184,10 @@ bool GuildManager::process(std::string msg) return false; if (msg[0] == '#' && msg[1] == '#') msg = msg.substr(3); - GuildMember *m = guild->getMember(msg); + GuildMember *m = guild->addMember(msg); if (m) m->setOnline(true); + guild->sort(); mRequest = false; return true; } -- cgit v1.2.3-70-g09d2