diff options
author | Yohann Ferreira <bertram@cegetel.net> | 2008-04-18 23:33:24 +0000 |
---|---|---|
committer | Yohann Ferreira <bertram@cegetel.net> | 2008-04-18 23:33:24 +0000 |
commit | 8d95e9c4e5e919964e02391696b1371110f8fdfd (patch) | |
tree | d2685995e4f216a8bdeffb69c3e9829e274a1712 /src | |
parent | 177ddcafa1daaa6178a5e15786b8a24aeea6ec6b (diff) | |
download | manaserv-8d95e9c4e5e919964e02391696b1371110f8fdfd.tar.gz manaserv-8d95e9c4e5e919964e02391696b1371110f8fdfd.tar.bz2 manaserv-8d95e9c4e5e919964e02391696b1371110f8fdfd.tar.xz manaserv-8d95e9c4e5e919964e02391696b1371110f8fdfd.zip |
Fixed 'Password changes' and 'Unregistering'.
Diffstat (limited to 'src')
-rw-r--r-- | src/account-server/accounthandler.cpp | 6 | ||||
-rw-r--r-- | src/account-server/dalstorage.hpp | 10 |
2 files changed, 10 insertions, 6 deletions
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. * |