diff options
Diffstat (limited to 'src/char/char.h')
-rw-r--r-- | src/char/char.h | 63 |
1 files changed, 47 insertions, 16 deletions
diff --git a/src/char/char.h b/src/char/char.h index 9cde18e96..413007868 100644 --- a/src/char/char.h +++ b/src/char/char.h @@ -2,8 +2,8 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2012-2015 Hercules Dev Team - * Copyright (C) Athena Dev Teams + * Copyright (C) 2012-2020 Hercules Dev Team + * Copyright (C) Athena Dev Teams * * Hercules is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,6 +26,10 @@ #include "common/db.h" #include "common/mmo.h" +/* Forward Declarations */ +struct config_setting_t; // common/conf.h +struct config_t; // common/conf.h + enum E_CHARSERVER_ST { CHARSERVER_ST_RUNNING = CORE_ST_LAST, CHARSERVER_ST_SHUTDOWN, @@ -68,7 +72,11 @@ struct mmo_map_server { VECTOR_DECL(uint16) maps; }; -#define MAX_MAP_SERVERS 2 +/** + * deprecated feature, multi map been a dangerous in-complete feature for so long and going to be removed. + * USE IT AT YOUR OWN RISK! + */ +#define MAX_MAP_SERVERS 1 #define DEFAULT_AUTOSAVE_INTERVAL (300*1000) @@ -106,13 +114,18 @@ struct char_interface { uint32 ip; uint16 port; int server_type; - int new_display; + int16 new_display; ///< Display 'New' in the server list. char *CHAR_CONF_NAME; char *NET_CONF_NAME; ///< Network config filename char *SQL_CONF_NAME; char *INTER_CONF_NAME; + bool show_save_log; ///< Show loading/saving messages. + bool enable_logs; ///< Whether to log char server operations. + + char db_path[256]; //< Database directory (db) + int (*waiting_disconnect) (int tid, int64 tick, int id, intptr_t data); int (*delete_char_sql) (int char_id); struct DBData (*create_online_char_data) (union DBKey key, va_list args); @@ -128,19 +141,22 @@ struct char_interface { void (*set_all_offline_sql) (void); struct DBData (*create_charstatus) (union DBKey key, va_list args); int (*mmo_char_tosql) (int char_id, struct mmo_charstatus* p); - int (*memitemdata_to_sql) (const struct item items[], int max, int id, int tableswitch); + int (*getitemdata_from_sql) (struct item *items, int max, int guid, enum inventory_table_type table); + int (*memitemdata_to_sql) (const struct item items[], int id, enum inventory_table_type table); int (*mmo_gender) (const struct char_session_data *sd, const struct mmo_charstatus *p, char sex); - int (*mmo_chars_fromsql) (struct char_session_data* sd, uint8* buf); + int (*mmo_chars_fromsql) (struct char_session_data* sd, uint8* buf, int *count); int (*mmo_char_fromsql) (int char_id, struct mmo_charstatus* p, bool load_everything); int (*mmo_char_sql_init) (void); bool (*char_slotchange) (struct char_session_data *sd, int fd, unsigned short from, unsigned short to); int (*rename_char_sql) (struct char_session_data *sd, int char_id); - int (*check_char_name) (char * name, char * esc_name); - int (*make_new_char_sql) (struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style); + bool (*name_exists) (const char *name, const char *esc_name); + int (*check_char_name) (const char *name, const char *esc_name); + int (*make_new_char_sql) (struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, int starting_job, uint8 sex); int (*divorce_char_sql) (int partner_id1, int partner_id2); int (*count_users) (void); int (*mmo_char_tobuf) (uint8* buffer, struct mmo_charstatus* p); - void (*mmo_char_send099d) (int fd, struct char_session_data *sd); + void (*send_HC_ACK_CHARINFO_PER_PAGE) (int fd, struct char_session_data *sd); + void (*send_HC_ACK_CHARINFO_PER_PAGE_tail) (int fd, struct char_session_data *sd); void (*mmo_char_send_ban_list) (int fd, struct char_session_data *sd); void (*mmo_char_send_slots_info) (int fd, struct char_session_data* sd); int (*mmo_char_send_characters) (int fd, struct char_session_data* sd); @@ -213,7 +229,6 @@ struct char_interface { void (*map_auth_failed) (int fd, int account_id, int char_id, int login_id1, char sex, uint32 ip); void (*parse_frommap_auth_request) (int fd, int id); void (*parse_frommap_update_ip) (int fd, int id); - void (*parse_frommap_request_stats_report) (int fd); void (*parse_frommap_scdata_update) (int fd); void (*parse_frommap_scdata_delete) (int fd); int (*parse_frommap) (int fd); @@ -229,7 +244,7 @@ struct char_interface { void (*delete2_cancel) (int fd, struct char_session_data* sd); void (*send_account_id) (int fd, int account_id); void (*parse_char_connect) (int fd, struct char_session_data* sd, uint32 ipl); - void (*send_map_info) (int fd, int i, uint32 subnet_map_ip, struct mmo_charstatus *cd); + void (*send_map_info) (int fd, int i, uint32 subnet_map_ip, struct mmo_charstatus *cd, char *dnsHost); void (*send_wait_char_server) (int fd); int (*search_default_maps_mapserver) (struct mmo_charstatus *cd); void (*parse_char_select) (int fd, struct char_session_data* sd, uint32 ipl); @@ -268,9 +283,24 @@ struct char_interface { int (*check_connect_login_server) (int tid, int64 tick, int id, intptr_t data); int (*online_data_cleanup_sub) (union DBKey key, struct DBData *data, va_list ap); int (*online_data_cleanup) (int tid, int64 tick, int id, intptr_t data); - void (*sql_config_read) (const char* cfgName); - void (*config_dispatch) (char *w1, char *w2); - int (*config_read) (const char* cfgName); + + bool (*sql_config_read) (const char *filename, bool imported); + bool (*sql_config_read_registry) (const char *filename, const struct config_t *config, bool imported); + bool (*sql_config_read_pc) (const char *filename, const struct config_t *config, bool imported); + bool (*sql_config_read_guild) (const char *filename, const struct config_t *config, bool imported); + bool (*config_read) (const char *filename, bool imported); + bool (*config_read_database) (const char *filename, const struct config_t *config, bool imported); + bool (*config_read_console) (const char *filename, const struct config_t *config, bool imported); + bool (*config_read_player_fame) (const char *filename, const struct config_t *config, bool imported); + bool (*config_read_player_deletion) (const char *filename, const struct config_t *config, bool imported); + bool (*config_read_player_name) (const char *filename, const struct config_t *config, bool imported); + void (*config_set_start_item) (const struct config_setting_t *setting); + bool (*config_read_player_new) (const char *filename, const struct config_t *config, bool imported); + bool (*config_read_player) (const char *filename, const struct config_t *config, bool imported); + bool (*config_read_permission) (const char *filename, const struct config_t *config, bool imported); + bool (*config_set_ip) (const char *type, const char *value, uint32 *out_ip, char *out_ip_str); + bool (*config_read_inter) (const char *filename, const struct config_t *config, bool imported); + bool (*config_read_top) (const char *filename, const struct config_t *config, bool imported); }; #ifdef HERCULES_CORE @@ -278,7 +308,6 @@ extern int char_name_option; extern char char_name_letters[]; extern bool char_gm_read; extern int autosave_interval; -extern int save_log; extern char db_path[]; extern char char_db[256]; extern char scdata_db[256]; @@ -302,6 +331,8 @@ extern char pet_db[256]; extern char mail_db[256]; extern char auction_db[256]; extern char quest_db[256]; +extern char rodex_db[256]; +extern char rodex_item_db[256]; extern char homunculus_db[256]; extern char skill_homunculus_db[256]; extern char mercenary_db[256]; @@ -312,9 +343,9 @@ extern char acc_reg_num_db[32]; extern char acc_reg_str_db[32]; extern char char_reg_str_db[32]; extern char char_reg_num_db[32]; +extern char char_achievement_db[256]; extern int guild_exp_rate; -extern int log_inter; void char_load_defaults(void); void char_defaults(void); |