summaryrefslogtreecommitdiff
path: root/src/account-server/account.hpp
diff options
context:
space:
mode:
authorAndreas Habel <mail@exceptionfault.de>2008-09-10 12:50:23 +0000
committerAndreas Habel <mail@exceptionfault.de>2008-09-10 12:50:23 +0000
commit0849156e914d76dfd0ad0129fdaef3c512219f53 (patch)
tree4c1f049b3a77d461be9a24daf2458814267762f2 /src/account-server/account.hpp
parent187dfc0418e44d4f20310b297d9d76e4d631ba9f (diff)
downloadmanaserv-0849156e914d76dfd0ad0129fdaef3c512219f53.tar.gz
manaserv-0849156e914d76dfd0ad0129fdaef3c512219f53.tar.bz2
manaserv-0849156e914d76dfd0ad0129fdaef3c512219f53.tar.xz
manaserv-0849156e914d76dfd0ad0129fdaef3c512219f53.zip
* Extended tmw_accounts table with columns for lastlogin and registration date. Modified account-server to fill the new columns on registration and login. Recreation of database needed!
* Added createIndex function to create indexes on tables.
Diffstat (limited to 'src/account-server/account.hpp')
-rw-r--r--src/account-server/account.hpp47
1 files changed, 38 insertions, 9 deletions
diff --git a/src/account-server/account.hpp b/src/account-server/account.hpp
index 59f25f75..3099911a 100644
--- a/src/account-server/account.hpp
+++ b/src/account-server/account.hpp
@@ -25,6 +25,7 @@
#include <string>
#include <vector>
+#include <time.h>
#include "account-server/character.hpp"
@@ -170,14 +171,40 @@ class Account
*
* @return the unique ID of the account, a negative number if none yet.
*/
- int getID() const
- { return mID; }
+ int getID() const
+ { return mID; }
/**
* Set account ID.
* The account shall not have any ID yet.
*/
- void setID(int);
+ void setID(int);
+
+ /**
+ * Get the time of the account registration.
+ */
+ time_t getRegistrationDate() const
+ { return mRegistrationDate; }
+
+ /**
+ * Sets the time of the account registration.
+ *
+ * @param time of the account registration.
+ */
+ void setRegistrationDate(time_t time);
+
+ /**
+ * Get the time of the last login.
+ */
+ time_t getLastLogin() const
+ { return mLastLogin; }
+
+ /**
+ * Sets the time of the last login.
+ *
+ * @param time of the last login.
+ */
+ void setLastLogin(time_t time);
private:
Account(Account const &rhs);
@@ -185,12 +212,14 @@ class Account
private:
- 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 */
+ 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 */
+ time_t mRegistrationDate; /**< Date and time of the account registration */
+ time_t mLastLogin; /**< Date and time of the last login */
};
typedef std::vector< Account * > Accounts;