summaryrefslogtreecommitdiff
path: root/src/account-server/account.hpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-04-23 17:48:36 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-04-23 17:48:36 +0000
commita173699822603988389b4f7ea55e5910ebe9ba4a (patch)
tree706dc198d825ce11ba12ffe137c9376cd945a069 /src/account-server/account.hpp
parenteca52c90e80f76c1fdffb5b1420a9cc4641de2fb (diff)
downloadmanaserv-a173699822603988389b4f7ea55e5910ebe9ba4a.tar.gz
manaserv-a173699822603988389b4f7ea55e5910ebe9ba4a.tar.bz2
manaserv-a173699822603988389b4f7ea55e5910ebe9ba4a.tar.xz
manaserv-a173699822603988389b4f7ea55e5910ebe9ba4a.zip
Fixed docs not to mention encryption, since all we do is hashing. Also, since
we decided not to use libcrypto, remove its configure check.
Diffstat (limited to 'src/account-server/account.hpp')
-rw-r--r--src/account-server/account.hpp49
1 files changed, 22 insertions, 27 deletions
diff --git a/src/account-server/account.hpp b/src/account-server/account.hpp
index 4414cb27..59f25f75 100644
--- a/src/account-server/account.hpp
+++ b/src/account-server/account.hpp
@@ -29,19 +29,8 @@
#include "account-server/character.hpp"
/**
- * Notes:
- * - change from the previous implementation: this class does not encrypt
- * passwords anymore and will just store the passwords as they are
- * passed to setPassword().
- * - the encryption should and must be performed externally from this
- * class or else we would end up with the password being encrypted many
- * times (e.g setPassword(getPassword()) would encrypt the password
- * twice or setPassword(encrypted_password_from_database) would also
- * encrypt the password twice).
- */
-
-/**
- * A player's account.
+ * A player's account. Stores the account information as well as the
+ * player characters available under this account.
*/
class Account
{
@@ -77,36 +66,42 @@ class Account
/**
- * Set the user password.
+ * Set the user password. The password is expected to be already
+ * hashed with a salt.
+ *
+ * The hashing must be performed externally from this class or else
+ * we would end up with the password being hashed many times
+ * (e.g setPassword(getPassword()) would hash the password twice.
*
- * @param password the user password.
+ * @param password the user password (hashed with salt).
*/
void setPassword(std::string const &password)
{ mPassword = password; }
/**
- * Get the user password.
+ * Get the user password (hashed with salt).
*
- * @return the user password.
+ * @return the user password (hashed with salt).
*/
std::string const &getPassword() const
{ return mPassword; }
/**
- * Set the user email address.
+ * Set the user email address. The email address is expected to be
+ * already hashed.
*
- * @param email the user email address.
+ * @param email the user email address (hashed).
*/
void setEmail(std::string const &email)
{ mEmail = email; }
/**
- * Get the user email address.
+ * Get the user email address (hashed).
*
- * @return the user email address.
+ * @return the user email address (hashed).
*/
std::string const &getEmail() const
{ return mEmail; }
@@ -190,12 +185,12 @@ class Account
private:
- std::string mName; /**< user name */
- std::string mPassword; /**< user password (encrypted with salt) */
- std::string mEmail; /**< user email address (encrypted) */
- Characters mCharacters; /**< Character data */
- int mID; /**< unique id */
- unsigned char mLevel; /**< account level */
+ std::string mName; /**< User name */
+ std::string mPassword; /**< User password (hashed with salt) */
+ std::string mEmail; /**< User email address (hashed) */
+ Characters mCharacters; /**< Character data */
+ int mID; /**< Unique id */
+ unsigned char mLevel; /**< Account level */
};
typedef std::vector< Account * > Accounts;