From 6652688b1f72920a9b0d43a83f40f010e11198c2 Mon Sep 17 00:00:00 2001 From: David Athay Date: Mon, 18 Aug 2008 11:51:43 +0000 Subject: Misc fixes with guild --- ChangeLog | 5 +++++ src/account-server/dalstorage.cpp | 2 +- src/chat-server/chathandler.cpp | 6 ++++-- src/chat-server/guild.hpp | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c13093e4..3109b728 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-18 David Athay + + * src/account-server/dalstorage.cpp, src/chat-server/guild.hpp, + src/chat-server/chathandler.cpp: Misc fixes of guild. + 2008-08-13 Yohann Ferreira * src/game-server/gamehandler.cpp, src/game-server/map.hpp: diff --git a/src/account-server/dalstorage.cpp b/src/account-server/dalstorage.cpp index aa29319f..42a35467 100644 --- a/src/account-server/dalstorage.cpp +++ b/src/account-server/dalstorage.cpp @@ -1000,10 +1000,10 @@ std::list DALStorage::getGuildList() guilds.push_back(guild); } string_to< unsigned > toUint; + /** * Add the members to the guilds. */ - for (std::list::iterator itr = guilds.begin(); itr != guilds.end(); ++itr) diff --git a/src/chat-server/chathandler.cpp b/src/chat-server/chathandler.cpp index 43a917ff..d19aa8cf 100644 --- a/src/chat-server/chathandler.cpp +++ b/src/chat-server/chathandler.cpp @@ -695,8 +695,10 @@ ChatHandler::handleGuildRetrieveMembers(ChatClient &client, MessageIn &msg) { reply.writeByte(ERRMSG_OK); reply.writeShort(guildId); - for(std::list::const_iterator itr = guild->getMembers().begin(); - itr != guild->getMembers().end(); ++itr) + std::list memberList = guild->getMembers(); + std::list::const_iterator itr_end = memberList.end(); + for(std::list::iterator itr = memberList.begin(); + itr != itr_end; ++itr) { reply.writeString((*itr)->getName()); reply.writeByte(mPlayerMap.find((*itr)->getName()) != mPlayerMap.end()); diff --git a/src/chat-server/guild.hpp b/src/chat-server/guild.hpp index ae8120f4..050dc17f 100644 --- a/src/chat-server/guild.hpp +++ b/src/chat-server/guild.hpp @@ -124,7 +124,7 @@ class Guild /** * Returns the name of the guild. */ - const std::string& getName() const + std::string getName() const { return mName; } /** -- cgit v1.2.3-70-g09d2