diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/account-server/accounthandler.cpp | 6 | ||||
-rw-r--r-- | src/account-server/dalstorage.hpp | 10 |
3 files changed, 16 insertions, 6 deletions
@@ -1,3 +1,9 @@ +2008-04-19 Yohann Ferreira <bertram@cegetel.net> + + * src/account-server/accounthandler.cpp, + src/account-server/dalstorage.hpp: Fixed 'Password changes' and + 'Unregistering', server-side this time. + 2008-04-18 David Athay <ko2fan@gmail.com> * src/chat-server/chatchannelmanager.cpp, diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp index 50e9456e..dba3ca14 100644 --- a/src/account-server/accounthandler.cpp +++ b/src/account-server/accounthandler.cpp @@ -344,7 +344,7 @@ static void handleUnregisterMessage(AccountClient &computer, MessageIn &msg) MessageOut reply(APMSG_UNREGISTER_RESPONSE); - if (computer.status != CLIENT_LOGIN) + if (computer.status != CLIENT_CONNECTED) { reply.writeByte(ERRMSG_FAILURE); computer.send(reply); @@ -407,6 +407,8 @@ static void handleEmailChangeMessage(AccountClient &computer, MessageIn &msg) else { acc->setEmail(email); + // Keep the database up to date otherwise we will go out of sync + storage->flush(acc); reply.writeByte(ERRMSG_OK); } computer.send(reply); @@ -458,6 +460,8 @@ static void handlePasswordChangeMessage(AccountClient &computer, MessageIn &msg) else { acc->setPassword(newPassword); + // Keep the database up to date otherwise we will go out of sync + storage->flush(acc); reply.writeByte(ERRMSG_OK); } diff --git a/src/account-server/dalstorage.hpp b/src/account-server/dalstorage.hpp index 0ac988e6..587f996a 100644 --- a/src/account-server/dalstorage.hpp +++ b/src/account-server/dalstorage.hpp @@ -182,27 +182,27 @@ class DALStorage */ void addGuild(Guild* guild); - + /** * Delete a guild * */ void removeGuild(Guild* guild); - + /** * Add member to guild * */ void addGuildMember(int guild_id, const std::string &member_name); - + /* * Remove member from guild */ void removeGuildMember(int guildId, const std::string &memberName); - + /** * Get guild list *@return a list of guilds @@ -210,7 +210,7 @@ class DALStorage */ std::list<Guild*> getGuildList(); - + /** * Save changes to the database permanently. * |