summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYohann Ferreira <bertram@cegetel.net>2008-04-18 23:33:24 +0000
committerYohann Ferreira <bertram@cegetel.net>2008-04-18 23:33:24 +0000
commit8d95e9c4e5e919964e02391696b1371110f8fdfd (patch)
treed2685995e4f216a8bdeffb69c3e9829e274a1712
parent177ddcafa1daaa6178a5e15786b8a24aeea6ec6b (diff)
downloadmanaserv-8d95e9c4e5e919964e02391696b1371110f8fdfd.tar.gz
manaserv-8d95e9c4e5e919964e02391696b1371110f8fdfd.tar.bz2
manaserv-8d95e9c4e5e919964e02391696b1371110f8fdfd.tar.xz
manaserv-8d95e9c4e5e919964e02391696b1371110f8fdfd.zip
Fixed 'Password changes' and 'Unregistering'.
-rw-r--r--ChangeLog6
-rw-r--r--src/account-server/accounthandler.cpp6
-rw-r--r--src/account-server/dalstorage.hpp10
3 files changed, 16 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 5041fe4a..c5fd59d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
*