login.h 3.7 KB

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