summaryrefslogtreecommitdiff
path: root/src/account.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-08-03 17:37:34 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-08-03 17:37:34 +0000
commit0c0966322b3018fa5fe3be3f52eef867da6ec779 (patch)
tree544a55ddf19a0f0cfb6499fe71540d952af5fe6e /src/account.cpp
parenteff04b5ddb0b00eeed191382aa9d55bf0f56c2a7 (diff)
downloadmanaserv-0c0966322b3018fa5fe3be3f52eef867da6ec779.tar.gz
manaserv-0c0966322b3018fa5fe3be3f52eef867da6ec779.tar.bz2
manaserv-0c0966322b3018fa5fe3be3f52eef867da6ec779.tar.xz
manaserv-0c0966322b3018fa5fe3be3f52eef867da6ec779.zip
Simplified and sped up account flushing: only modified accounts are flushed.
Diffstat (limited to 'src/account.cpp')
-rw-r--r--src/account.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/account.cpp b/src/account.cpp
index 11a1232a..b81adfe8 100644
--- a/src/account.cpp
+++ b/src/account.cpp
@@ -20,6 +20,8 @@
* $Id$
*/
+#include <cassert>
+
#include "account.h"
#include "utils/functors.h"
@@ -29,8 +31,10 @@
*/
Account::Account(const std::string& name,
const std::string& password,
- const std::string& email)
- : mName(name),
+ const std::string& email,
+ int id)
+ : mID(id),
+ mName(name),
mPassword(password),
mEmail(email),
mCharacters(),
@@ -207,3 +211,9 @@ PlayerPtr Account::getCharacter(const std::string& name)
if (it != end) return *it;
return PlayerPtr();
}
+
+void Account::setID(int id)
+{
+ assert(mID < 0);
+ mID = id;
+}