Skip to content

Commit

Permalink
HPM Hooks Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Asheraf committed Feb 3, 2021
1 parent c1f66a0 commit 29348df
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 33 deletions.
10 changes: 8 additions & 2 deletions src/plugins/HPMHooking/HPMHooking.Defs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
20 changes: 16 additions & 4 deletions src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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) },
Expand Down
133 changes: 107 additions & 26 deletions src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
Original file line number Diff line number Diff line change
Expand Up @@ -36980,58 +36980,139 @@ 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, &current);
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;
return retVal___;
}
}
{
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;
Expand Down

0 comments on commit 29348df

Please sign in to comment.