diff options
Diffstat (limited to 'src/login/account.h')
-rw-r--r-- | src/login/account.h | 41 |
1 files changed, 12 insertions, 29 deletions
diff --git a/src/login/account.h b/src/login/account.h index be5bad988..e15143ce9 100644 --- a/src/login/account.h +++ b/src/login/account.h @@ -1,11 +1,13 @@ -// Copyright (c) Athena Dev Teams - Licensed under GNU GPL -// For more information, see LICENCE in the main folder +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. +// See the LICENSE file +// Portions Copyright (c) Athena Dev Teams -#ifndef __ACCOUNT_H_INCLUDED__ -#define __ACCOUNT_H_INCLUDED__ +#ifndef LOGIN_ACCOUNT_H +#define LOGIN_ACCOUNT_H #include "../common/cbasetypes.h" #include "../common/mmo.h" // ACCOUNT_REG2_NUM +#include "../common/sql.h" // Sql typedef struct AccountDB AccountDB; typedef struct AccountDBIterator AccountDBIterator; @@ -14,26 +16,6 @@ typedef struct AccountDBIterator AccountDBIterator; // standard engines AccountDB* account_db_sql(void); -// extra engines (will probably use the other txt functions) -#define ACCOUNTDB_CONSTRUCTOR_(engine) account_db_##engine -#define ACCOUNTDB_CONSTRUCTOR(engine) ACCOUNTDB_CONSTRUCTOR_(engine) -#ifdef ACCOUNTDB_ENGINE_0 -AccountDB* ACCOUNTDB_CONSTRUCTOR(ACCOUNTDB_ENGINE_0)(void); -#endif -#ifdef ACCOUNTDB_ENGINE_1 -AccountDB* ACCOUNTDB_CONSTRUCTOR(ACCOUNTDB_ENGINE_1)(void); -#endif -#ifdef ACCOUNTDB_ENGINE_2 -AccountDB* ACCOUNTDB_CONSTRUCTOR(ACCOUNTDB_ENGINE_2)(void); -#endif -#ifdef ACCOUNTDB_ENGINE_3 -AccountDB* ACCOUNTDB_CONSTRUCTOR(ACCOUNTDB_ENGINE_3)(void); -#endif -#ifdef ACCOUNTDB_ENGINE_4 -AccountDB* ACCOUNTDB_CONSTRUCTOR(ACCOUNTDB_ENGINE_4)(void); -#endif - - struct mmo_account { int account_id; @@ -43,7 +25,7 @@ struct mmo_account char email[40]; // e-mail (by default: a@a.com) int group_id; // player group id uint8 char_slots; // this accounts maximum character slots (maximum is limited to MAX_CHARS define in char server) - unsigned int state; // packet 0x006a value + 1 (0: compte OK) + unsigned int state; // packet 0x006a value + 1 (0: complete OK) time_t unban_time; // (timestamp): ban time limit of the account (0 = no ban) time_t expiration_time; // (timestamp): validity limit of the account (0 = unlimited) unsigned int logincount; // number of successful auth attempts @@ -52,8 +34,6 @@ struct mmo_account char lastlogin[24]; // date+time of last successful login char last_ip[16]; // save of last IP of connection char birthdate[10+1]; // assigned birth date (format: YYYY-MM-DD, default: 0000-00-00) - int account_reg2_num; - struct global_reg account_reg2[ACCOUNT_REG2_NUM]; // account script variables (stored on login server) }; @@ -155,6 +135,9 @@ struct AccountDB AccountDBIterator* (*iterator)(AccountDB* self); }; -void account_db_sql_up(AccountDB* self); +Sql *account_db_sql_up(AccountDB* self); + +void mmo_send_accreg2(AccountDB* self, int fd, int account_id, int char_id); +void mmo_save_accreg2(AccountDB* self, int fd, int account_id, int char_id); -#endif // __ACCOUNT_H_INCLUDED__ +#endif /* LOGIN_ACCOUNT_H */ |