login.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 mmo_account {
  12. int version;
  13. char userid[NAME_LENGTH];
  14. char passwd[NAME_LENGTH];
  15. int passwdenc;
  16. int account_id;
  17. long login_id1;
  18. long login_id2;
  19. char lastlogin[24];
  20. int sex;
  21. uint8 level;
  22. };
  23. struct mmo_char_server {
  24. char name[20];
  25. int fd;
  26. uint32 ip;
  27. uint16 port;
  28. int users;
  29. int maintenance;
  30. int new_;
  31. };
  32. extern struct Login_Config {
  33. uint32 login_ip; // the address to bind to
  34. uint16 login_port; // the port to bind to
  35. unsigned int ip_sync_interval; // interval (in minutes) to execute a DNS/IP update (for dynamic IPs)
  36. bool log_login; // whether to log login server actions or not
  37. char date_format[32]; // date format used in messages
  38. bool console; // console input system enabled?
  39. bool new_account_flag; // autoregistration via _M/_F ?
  40. bool case_sensitive; // are logins case sensitive ?
  41. bool use_md5_passwds; // work with password hashes instead of plaintext passwords?
  42. bool login_gm_read; // should the login server handle info about gm accounts?
  43. int min_level_to_connect; // minimum level of player/GM (0: player, 1-99: GM) to connect
  44. bool online_check; // reject incoming players that are already registered as online ?
  45. bool check_client_version; // check the clientversion set in the clientinfo ?
  46. int client_version_to_connect; // the client version needed to connect (if checking is enabled)
  47. bool ipban; // perform IP blocking (via contents of `ipbanlist`) ?
  48. bool dynamic_pass_failure_ban; // automatic IP blocking due to failed login attemps ?
  49. unsigned int dynamic_pass_failure_ban_interval; // how far to scan the loginlog for password failures
  50. unsigned int dynamic_pass_failure_ban_limit; // number of failures needed to trigger the ipban
  51. unsigned int dynamic_pass_failure_ban_duration; // duration of the ipban
  52. bool use_dnsbl; // dns blacklist blocking ?
  53. char dnsbl_servs[1024]; // comma-separated list of dnsbl servers
  54. } login_config;
  55. #endif /* _LOGIN_SQL_H_ */