Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

login.h

Go to the documentation of this file.
00001 
00016 // $Id: login.h 1 2006-01-13 22:47:50Z MagicalTux $
00017 #ifndef OA_LOGIN_H
00018 #define OA_LOGIN_H
00019 
00020 #include <mmo.h>
00021 
00026 #define MAX_SERVERS 30
00027 
00031 #define LOGIN_CONF_NAME "conf/login_athena.conf"
00032 
00036 #define START_ACCOUNT_NUM 2000001
00037 #define END_ACCOUNT_NUM 100000000
00038 
00042 #define AUTH_FIFO_SIZE ((FD_SETSIZE > 1024) ? FD_SETSIZE : 1024)
00043 
00047 struct {
00048         int account_id;         
00049         int login_id1;          
00050         int login_id2;          
00051         unsigned int ip;        
00052         unsigned sex : 3;       
00053         unsigned delflag : 1;   
00054 } auth_fifo[AUTH_FIFO_SIZE];
00055 
00059 struct mmo_char_server {
00060         char name[21];                  
00061         unsigned int ip;                
00062         unsigned short port;            
00063         unsigned short users;           
00064         unsigned short maintenance;     
00065         unsigned short new;             
00066 };
00067 
00071 struct mmo_account {
00072         char userid[25];                
00073         char passwd[33];                
00074         unsigned passwdenc : 2;         
00075         unsigned sex : 3;               
00076         int version;                    
00078         int account_id;                 
00079         int login_id1;                  
00080         int login_id2;                  
00081         char lastlogin[24];             
00082 };
00083 
00087 struct auth_dat {
00088         int account_id;                 
00089         unsigned sex : 3;               
00090         char userid[25];                
00091         char pass[33];                  
00092         char lastlogin[24];             
00093         int logincount;                 
00094         short state;                    
00095         char email[41];                 
00096         char error_message[20];         
00097         time_t ban_until_time;          
00098         time_t connect_until_time;      
00099         char last_ip[16];               
00100         char *memo;                     
00101         unsigned char level;            
00102 #ifdef TXT_ONLY
00103         unsigned short account_reg2_num; // 0 - 700 (ACCOUNT_REG2_NUM)
00104         struct global_reg *account_reg2;
00105 #endif // TXT_ONLY
00106 } *auth_dat;
00107 
00112 extern char date_format[32];
00113 
00117 int login_port;
00118 
00119 int account_id_count;
00120 int auth_num;
00121 
00126 int add_to_unlimited_account;
00127 
00131 unsigned char use_md5_passwds;
00132 
00140 unsigned char unique_case_account_name_creation;
00141 
00145 char login_log_unknown_packets_filename[512];
00146 
00147 /* *** TXT *** CONFIGURATION */
00148 #ifdef TXT_ONLY
00149 unsigned char GM_level_need_save_flag;
00150 #endif /* TXT_ONLY */
00151 
00152 /* *** SQL *** CONFIGURATION */
00153 #ifdef USE_SQL
00154 
00157 char login_db[256];
00158 
00162 char login_db_account_id[256];
00163 
00167 char login_db_userid[256];
00168 
00172 char login_db_user_pass[256];
00173 
00176 char login_db_level[256];
00177 #endif /* USE_SQL */
00178 
00190 int password_check(const char * password_db, const char * pass, 
00191                         const char * key);
00192 
00199 int check_existing_account_name_for_creation(const char *name);
00200 
00209 int search_account_index(const char* account_name);
00210 
00216 int search_account_index2(const int account_id);
00217 
00223 unsigned char check_online_player(const int account_id);
00224 
00232 void accounts_speed_sorting(int tableau[], int premier, int dernier);
00233 
00239 void save_account(int idx, unsigned char forced);
00240 
00245 void delete_account(const char * account_name);
00246 
00252 void send_GM_account(const int account_id, const unsigned char level);
00253 
00260 void add_text_in_memo(int account, const char* text);
00261 
00266 void charif_sendall(unsigned int len);
00267 
00273 void account_to_str(char *str, struct auth_dat *p);
00274 
00280 int add_account(struct auth_dat * account, const char *memo);
00281 
00286 void init_new_account(struct auth_dat * account);
00287 
00288 #ifndef __ADDON
00289 
00292 struct mmo_char_server server[MAX_SERVERS];
00293 
00294 /*
00295  * max number of char-servers (and account_id values: 0 to max-1)
00296  */
00297 int server_fd[MAX_SERVERS];
00298 #endif
00299 
00304 #endif // OA_LOGIN_H
00305 

Generated on Fri Apr 28 10:20:04 2006 for OpenAthena by  doxygen 1.4.4