1 | // Copyright (c) Athena Dev Teams - Licensed under GNU GPL |
---|
2 | // For more information, see LICENCE in the main folder |
---|
3 | |
---|
4 | #ifndef _LOGIN_SQL_H_ |
---|
5 | #define _LOGIN_SQL_H_ |
---|
6 | |
---|
7 | #include "../common/mmo.h" // NAME_LENGTH |
---|
8 | |
---|
9 | #define LOGIN_CONF_NAME "conf/login_athena.conf" |
---|
10 | #define SQL_CONF_NAME "conf/inter_athena.conf" |
---|
11 | #define LAN_CONF_NAME "conf/subnet_athena.conf" |
---|
12 | |
---|
13 | // supported encryption types: 1- passwordencrypt, 2- passwordencrypt2, 3- both |
---|
14 | #define PASSWORDENC 3 |
---|
15 | |
---|
16 | struct login_session_data { |
---|
17 | |
---|
18 | int account_id; |
---|
19 | long login_id1; |
---|
20 | long login_id2; |
---|
21 | char sex; |
---|
22 | |
---|
23 | char userid[NAME_LENGTH]; |
---|
24 | char passwd[NAME_LENGTH]; |
---|
25 | int passwdenc; |
---|
26 | char md5key[20]; |
---|
27 | uint16 md5keylen; |
---|
28 | |
---|
29 | char lastlogin[24]; |
---|
30 | uint8 level; |
---|
31 | int version; |
---|
32 | |
---|
33 | int fd; |
---|
34 | }; |
---|
35 | |
---|
36 | struct mmo_char_server { |
---|
37 | char name[20]; |
---|
38 | int fd; |
---|
39 | uint32 ip; |
---|
40 | uint16 port; |
---|
41 | int users; |
---|
42 | int maintenance; |
---|
43 | int new_; |
---|
44 | }; |
---|
45 | |
---|
46 | struct Login_Config { |
---|
47 | |
---|
48 | uint32 login_ip; // the address to bind to |
---|
49 | uint16 login_port; // the port to bind to |
---|
50 | unsigned int ip_sync_interval; // interval (in minutes) to execute a DNS/IP update (for dynamic IPs) |
---|
51 | bool log_login; // whether to log login server actions or not |
---|
52 | char date_format[32]; // date format used in messages |
---|
53 | bool console; // console input system enabled? |
---|
54 | bool new_account_flag; // autoregistration via _M/_F ? |
---|
55 | int start_limited_time; // new account expiration time (-1: unlimited) |
---|
56 | bool case_sensitive; // are logins case sensitive ? |
---|
57 | bool use_md5_passwds; // work with password hashes instead of plaintext passwords? |
---|
58 | bool login_gm_read; // should the login server handle info about gm accounts? |
---|
59 | int min_level_to_connect; // minimum level of player/GM (0: player, 1-99: GM) to connect |
---|
60 | bool online_check; // reject incoming players that are already registered as online ? |
---|
61 | bool check_client_version; // check the clientversion set in the clientinfo ? |
---|
62 | int client_version_to_connect; // the client version needed to connect (if checking is enabled) |
---|
63 | |
---|
64 | bool ipban; // perform IP blocking (via contents of `ipbanlist`) ? |
---|
65 | bool dynamic_pass_failure_ban; // automatic IP blocking due to failed login attemps ? |
---|
66 | unsigned int dynamic_pass_failure_ban_interval; // how far to scan the loginlog for password failures |
---|
67 | unsigned int dynamic_pass_failure_ban_limit; // number of failures needed to trigger the ipban |
---|
68 | unsigned int dynamic_pass_failure_ban_duration; // duration of the ipban |
---|
69 | bool use_dnsbl; // dns blacklist blocking ? |
---|
70 | char dnsbl_servs[1024]; // comma-separated list of dnsbl servers |
---|
71 | |
---|
72 | }; |
---|
73 | |
---|
74 | struct mmo_account { |
---|
75 | |
---|
76 | int account_id; |
---|
77 | char sex; |
---|
78 | char userid[24]; |
---|
79 | char pass[32+1]; // 23+1 for normal, 32+1 for md5-ed passwords |
---|
80 | char lastlogin[24]; |
---|
81 | int logincount; |
---|
82 | uint32 state; // packet 0x006a value + 1 (0: compte OK) |
---|
83 | char email[40]; // e-mail (by default: a@a.com) |
---|
84 | char error_message[20]; // Message of error code #6 = Your are Prohibited to log in until %s (packet 0x006a) |
---|
85 | time_t unban_time; // # of seconds 1/1/1970 (timestamp): ban time limit of the account (0 = no ban) |
---|
86 | time_t expiration_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited) |
---|
87 | char last_ip[16]; // save of last IP of connection |
---|
88 | char memo[255]; // a memo field |
---|
89 | int account_reg2_num; |
---|
90 | struct global_reg account_reg2[ACCOUNT_REG2_NUM]; // account script variables (stored on login server) |
---|
91 | }; |
---|
92 | |
---|
93 | |
---|
94 | #endif /* _LOGIN_SQL_H_ */ |
---|