From 0849156e914d76dfd0ad0129fdaef3c512219f53 Mon Sep 17 00:00:00 2001 From: Andreas Habel Date: Wed, 10 Sep 2008 12:50:23 +0000 Subject: * 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. --- src/account-server/account.hpp | 47 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 9 deletions(-) (limited to 'src/account-server/account.hpp') 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 #include +#include #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; -- cgit v1.2.3-60-g2f50