diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 82c09b3d2e4..ccba0ec91c8 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -3258,10 +3258,16 @@ typedef void (*HPMHOOK_pre_homun_stat_reset) (struct homun_data **hd); typedef void (*HPMHOOK_post_homun_stat_reset) (struct homun_data *hd); typedef bool (*HPMHOOK_pre_homun_shuffle) (struct homun_data **hd); typedef bool (*HPMHOOK_post_homun_shuffle) (bool retVal___, struct homun_data *hd); -typedef bool (*HPMHOOK_pre_homun_read_db_sub) (char **str[], int *columns, int *current); -typedef bool (*HPMHOOK_post_homun_read_db_sub) (bool retVal___, char *str[], int columns, int current); typedef void (*HPMHOOK_pre_homun_read_db) (void); typedef void (*HPMHOOK_post_homun_read_db) (void); +typedef bool (*HPMHOOK_pre_homun_read_db_libconfig) (const char **filename); +typedef bool (*HPMHOOK_post_homun_read_db_libconfig) (bool retVal___, const char *filename); +typedef bool (*HPMHOOK_pre_homun_read_db_libconfig_sub) (struct config_setting_t **it, int *idx, const char **source); +typedef bool (*HPMHOOK_post_homun_read_db_libconfig_sub) (bool retVal___, struct config_setting_t *it, int idx, const char *source); +typedef bool (*HPMHOOK_pre_homun_read_db_libconfig_sub_stats) (struct config_setting_t **it, int *idx); +typedef bool (*HPMHOOK_post_homun_read_db_libconfig_sub_stats) (bool retVal___, struct config_setting_t *it, int idx); +typedef bool (*HPMHOOK_pre_homun_read_db_libconfig_sub_stats_group) (struct config_setting_t **it, struct h_stats **smin, struct h_stats **smax); +typedef bool (*HPMHOOK_post_homun_read_db_libconfig_sub_stats_group) (bool retVal___, struct config_setting_t *it, struct h_stats *smin, struct h_stats *smax); typedef bool (*HPMHOOK_pre_homun_read_skill_db_sub) (char **split[], int *columns, int *current); typedef bool (*HPMHOOK_post_homun_read_skill_db_sub) (bool retVal___, char *split[], int columns, int current); typedef void (*HPMHOOK_pre_homun_skill_db_read) (void); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index ee7e8f576c1..0e3142d8420 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -2818,10 +2818,16 @@ struct { struct HPMHookPoint *HP_homun_stat_reset_post; struct HPMHookPoint *HP_homun_shuffle_pre; struct HPMHookPoint *HP_homun_shuffle_post; - struct HPMHookPoint *HP_homun_read_db_sub_pre; - struct HPMHookPoint *HP_homun_read_db_sub_post; struct HPMHookPoint *HP_homun_read_db_pre; struct HPMHookPoint *HP_homun_read_db_post; + struct HPMHookPoint *HP_homun_read_db_libconfig_pre; + struct HPMHookPoint *HP_homun_read_db_libconfig_post; + struct HPMHookPoint *HP_homun_read_db_libconfig_sub_pre; + struct HPMHookPoint *HP_homun_read_db_libconfig_sub_post; + struct HPMHookPoint *HP_homun_read_db_libconfig_sub_stats_pre; + struct HPMHookPoint *HP_homun_read_db_libconfig_sub_stats_post; + struct HPMHookPoint *HP_homun_read_db_libconfig_sub_stats_group_pre; + struct HPMHookPoint *HP_homun_read_db_libconfig_sub_stats_group_post; struct HPMHookPoint *HP_homun_read_skill_db_sub_pre; struct HPMHookPoint *HP_homun_read_skill_db_sub_post; struct HPMHookPoint *HP_homun_skill_db_read_pre; @@ -9887,10 +9893,16 @@ struct { int HP_homun_stat_reset_post; int HP_homun_shuffle_pre; int HP_homun_shuffle_post; - int HP_homun_read_db_sub_pre; - int HP_homun_read_db_sub_post; int HP_homun_read_db_pre; int HP_homun_read_db_post; + int HP_homun_read_db_libconfig_pre; + int HP_homun_read_db_libconfig_post; + int HP_homun_read_db_libconfig_sub_pre; + int HP_homun_read_db_libconfig_sub_post; + int HP_homun_read_db_libconfig_sub_stats_pre; + int HP_homun_read_db_libconfig_sub_stats_post; + int HP_homun_read_db_libconfig_sub_stats_group_pre; + int HP_homun_read_db_libconfig_sub_stats_group_post; int HP_homun_read_skill_db_sub_pre; int HP_homun_read_skill_db_sub_post; int HP_homun_skill_db_read_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index ad888c1a597..ba3b26af6dd 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1444,8 +1444,11 @@ struct HookingPointData HookingPoints[] = { { HP_POP(homun->revive, HP_homun_revive) }, { HP_POP(homun->stat_reset, HP_homun_stat_reset) }, { HP_POP(homun->shuffle, HP_homun_shuffle) }, - { HP_POP(homun->read_db_sub, HP_homun_read_db_sub) }, { HP_POP(homun->read_db, HP_homun_read_db) }, + { HP_POP(homun->read_db_libconfig, HP_homun_read_db_libconfig) }, + { HP_POP(homun->read_db_libconfig_sub, HP_homun_read_db_libconfig_sub) }, + { HP_POP(homun->read_db_libconfig_sub_stats, HP_homun_read_db_libconfig_sub_stats) }, + { HP_POP(homun->read_db_libconfig_sub_stats_group, HP_homun_read_db_libconfig_sub_stats_group) }, { HP_POP(homun->read_skill_db_sub, HP_homun_read_skill_db_sub) }, { HP_POP(homun->skill_db_read, HP_homun_skill_db_read) }, { HP_POP(homun->exp_db_read, HP_homun_exp_db_read) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 126a40de2b6..be6a7de3507 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -36980,15 +36980,41 @@ bool HP_homun_shuffle(struct homun_data *hd) { } return retVal___; } -bool HP_homun_read_db_sub(char *str[], int columns, int current) { +void HP_homun_read_db(void) { + int hIndex = 0; + if (HPMHooks.count.HP_homun_read_db_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_homun_read_db_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.homun.read_db(); + } + if (HPMHooks.count.HP_homun_read_db_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_homun_read_db_post[hIndex].func; + postHookFunc(); + } + } + return; +} +bool HP_homun_read_db_libconfig(const char *filename) { int hIndex = 0; bool retVal___ = false; - if (HPMHooks.count.HP_homun_read_db_sub_pre > 0) { - bool (*preHookFunc) (char **str[], int *columns, int *current); + if (HPMHooks.count.HP_homun_read_db_libconfig_pre > 0) { + bool (*preHookFunc) (const char **filename); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_sub_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_homun_read_db_sub_pre[hIndex].func; - retVal___ = preHookFunc(&str, &columns, ¤t); + for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_libconfig_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_homun_read_db_libconfig_pre[hIndex].func; + retVal___ = preHookFunc(&filename); } if (*HPMforce_return) { *HPMforce_return = false; @@ -36996,42 +37022,97 @@ bool HP_homun_read_db_sub(char *str[], int columns, int current) { } } { - retVal___ = HPMHooks.source.homun.read_db_sub(str, columns, current); + retVal___ = HPMHooks.source.homun.read_db_libconfig(filename); } - if (HPMHooks.count.HP_homun_read_db_sub_post > 0) { - bool (*postHookFunc) (bool retVal___, char *str[], int columns, int current); - for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_sub_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_homun_read_db_sub_post[hIndex].func; - retVal___ = postHookFunc(retVal___, str, columns, current); + if (HPMHooks.count.HP_homun_read_db_libconfig_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *filename); + for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_libconfig_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_homun_read_db_libconfig_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename); } } return retVal___; } -void HP_homun_read_db(void) { +bool HP_homun_read_db_libconfig_sub(struct config_setting_t *it, int idx, const char *source) { int hIndex = 0; - if (HPMHooks.count.HP_homun_read_db_pre > 0) { - void (*preHookFunc) (void); + bool retVal___ = false; + if (HPMHooks.count.HP_homun_read_db_libconfig_sub_pre > 0) { + bool (*preHookFunc) (struct config_setting_t **it, int *idx, const char **source); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_homun_read_db_pre[hIndex].func; - preHookFunc(); + for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_libconfig_sub_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_homun_read_db_libconfig_sub_pre[hIndex].func; + retVal___ = preHookFunc(&it, &idx, &source); } if (*HPMforce_return) { *HPMforce_return = false; - return; + return retVal___; } } { - HPMHooks.source.homun.read_db(); + retVal___ = HPMHooks.source.homun.read_db_libconfig_sub(it, idx, source); } - if (HPMHooks.count.HP_homun_read_db_post > 0) { - void (*postHookFunc) (void); - for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_homun_read_db_post[hIndex].func; - postHookFunc(); + if (HPMHooks.count.HP_homun_read_db_libconfig_sub_post > 0) { + bool (*postHookFunc) (bool retVal___, struct config_setting_t *it, int idx, const char *source); + for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_libconfig_sub_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_homun_read_db_libconfig_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, it, idx, source); } } - return; + return retVal___; +} +bool HP_homun_read_db_libconfig_sub_stats(struct config_setting_t *it, int idx) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_homun_read_db_libconfig_sub_stats_pre > 0) { + bool (*preHookFunc) (struct config_setting_t **it, int *idx); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_libconfig_sub_stats_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_homun_read_db_libconfig_sub_stats_pre[hIndex].func; + retVal___ = preHookFunc(&it, &idx); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.homun.read_db_libconfig_sub_stats(it, idx); + } + if (HPMHooks.count.HP_homun_read_db_libconfig_sub_stats_post > 0) { + bool (*postHookFunc) (bool retVal___, struct config_setting_t *it, int idx); + for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_libconfig_sub_stats_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_homun_read_db_libconfig_sub_stats_post[hIndex].func; + retVal___ = postHookFunc(retVal___, it, idx); + } + } + return retVal___; +} +bool HP_homun_read_db_libconfig_sub_stats_group(struct config_setting_t *it, struct h_stats *smin, struct h_stats *smax) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_homun_read_db_libconfig_sub_stats_group_pre > 0) { + bool (*preHookFunc) (struct config_setting_t **it, struct h_stats **smin, struct h_stats **smax); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_libconfig_sub_stats_group_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_homun_read_db_libconfig_sub_stats_group_pre[hIndex].func; + retVal___ = preHookFunc(&it, &smin, &smax); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.homun.read_db_libconfig_sub_stats_group(it, smin, smax); + } + if (HPMHooks.count.HP_homun_read_db_libconfig_sub_stats_group_post > 0) { + bool (*postHookFunc) (bool retVal___, struct config_setting_t *it, struct h_stats *smin, struct h_stats *smax); + for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_libconfig_sub_stats_group_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_homun_read_db_libconfig_sub_stats_group_post[hIndex].func; + retVal___ = postHookFunc(retVal___, it, smin, smax); + } + } + return retVal___; } bool HP_homun_read_skill_db_sub(char *split[], int columns, int current) { int hIndex = 0;