Skip to content

Commit

Permalink
Update HPM hooks
Browse files Browse the repository at this point in the history
Signed-off-by: hwsapibot <dev@herc.ws>
  • Loading branch information
HerculesWSAPI committed Oct 5, 2022
1 parent 151b69a commit 6143ce0
Show file tree
Hide file tree
Showing 5 changed files with 512 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/common/HPMDataCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "item_package_must_entry", sizeof(struct item_package_must_entry), SERVER_TYPE_MAP },
{ "item_package_rand_entry", sizeof(struct item_package_rand_entry), SERVER_TYPE_MAP },
{ "item_package_rand_group", sizeof(struct item_package_rand_group), SERVER_TYPE_MAP },
{ "item_reform", sizeof(struct item_reform), SERVER_TYPE_MAP },
{ "itemdb_interface", sizeof(struct itemdb_interface), SERVER_TYPE_MAP },
{ "itemdb_option", sizeof(struct itemdb_option), SERVER_TYPE_MAP },
{ "itemlist", sizeof(struct itemlist), SERVER_TYPE_MAP },
Expand Down
30 changes: 30 additions & 0 deletions src/plugins/HPMHooking/HPMHooking.Defs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2882,6 +2882,14 @@ typedef unsigned short (*HPMHOOK_pre_clif_parse_cmd_decrypt) (int *fd, struct ma
typedef unsigned short (*HPMHOOK_post_clif_parse_cmd_decrypt) (unsigned short retVal___, int fd, struct map_session_data *sd);
typedef unsigned short (*HPMHOOK_pre_clif_parse_cmd_optional) (int *fd, struct map_session_data **sd);
typedef unsigned short (*HPMHOOK_post_clif_parse_cmd_optional) (unsigned short retVal___, int fd, struct map_session_data *sd);
typedef void (*HPMHOOK_pre_clif_item_reform_open) (struct map_session_data **sd, int *itemId);
typedef void (*HPMHOOK_post_clif_item_reform_open) (struct map_session_data *sd, int itemId);
typedef void (*HPMHOOK_pre_clif_pItemReformClose) (int *fd, struct map_session_data **sd);
typedef void (*HPMHOOK_post_clif_pItemReformClose) (int fd, struct map_session_data *sd);
typedef void (*HPMHOOK_pre_clif_pItemReformAck) (int *fd, struct map_session_data **sd);
typedef void (*HPMHOOK_post_clif_pItemReformAck) (int fd, struct map_session_data *sd);
typedef void (*HPMHOOK_pre_clif_item_reform_result) (struct map_session_data **sd, int *index, enum item_reform_status *result);
typedef void (*HPMHOOK_post_clif_item_reform_result) (struct map_session_data *sd, int index, enum item_reform_status result);
#endif // MAP_CLIF_H
#ifdef COMMON_CORE_H /* cmdline */
typedef void (*HPMHOOK_pre_cmdline_init) (void);
Expand Down Expand Up @@ -4198,6 +4206,8 @@ typedef struct item_data* (*HPMHOOK_pre_itemdb_exists) (int *nameid);
typedef struct item_data* (*HPMHOOK_post_itemdb_exists) (struct item_data* retVal___, int nameid);
typedef struct itemdb_option* (*HPMHOOK_pre_itemdb_option_exists) (int *idx);
typedef struct itemdb_option* (*HPMHOOK_post_itemdb_option_exists) (struct itemdb_option* retVal___, int idx);
typedef struct item_reform* (*HPMHOOK_pre_itemdb_reform_exists) (int *idx);
typedef struct item_reform* (*HPMHOOK_post_itemdb_reform_exists) (struct item_reform* retVal___, int idx);
typedef bool (*HPMHOOK_pre_itemdb_in_group) (struct item_group **group, int *nameid);
typedef bool (*HPMHOOK_post_itemdb_in_group) (bool retVal___, struct item_group *group, int nameid);
typedef int (*HPMHOOK_pre_itemdb_group_item) (struct item_group **group);
Expand Down Expand Up @@ -4282,6 +4292,8 @@ typedef int (*HPMHOOK_pre_itemdb_final_sub) (union DBKey *key, struct DBData **d
typedef int (*HPMHOOK_post_itemdb_final_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
typedef int (*HPMHOOK_pre_itemdb_options_final_sub) (union DBKey *key, struct DBData **data, va_list ap);
typedef int (*HPMHOOK_post_itemdb_options_final_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
typedef int (*HPMHOOK_pre_itemdb_reform_final_sub) (union DBKey *key, struct DBData **data, va_list ap);
typedef int (*HPMHOOK_post_itemdb_reform_final_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
typedef void (*HPMHOOK_pre_itemdb_clear) (bool *total);
typedef void (*HPMHOOK_post_itemdb_clear) (bool total);
typedef struct item_combo* (*HPMHOOK_pre_itemdb_id2combo) (int *id);
Expand All @@ -4306,6 +4318,24 @@ typedef bool (*HPMHOOK_pre_itemdb_read_libconfig_lapineupgrade_sub) (struct conf
typedef bool (*HPMHOOK_post_itemdb_read_libconfig_lapineupgrade_sub) (bool retVal___, struct config_setting_t *it, const char *source);
typedef bool (*HPMHOOK_pre_itemdb_read_libconfig_lapineupgrade_sub_targets) (struct config_setting_t **sources, struct item_data **data);
typedef bool (*HPMHOOK_post_itemdb_read_libconfig_lapineupgrade_sub_targets) (bool retVal___, struct config_setting_t *sources, struct item_data *data);
typedef bool (*HPMHOOK_pre_itemdb_read_libconfig_item_reform_info) (void);
typedef bool (*HPMHOOK_post_itemdb_read_libconfig_item_reform_info) (bool retVal___);
typedef bool (*HPMHOOK_pre_itemdb_read_libconfig_item_reform_info_sub) (struct config_setting_t **it, const char **source);
typedef bool (*HPMHOOK_post_itemdb_read_libconfig_item_reform_info_sub) (bool retVal___, struct config_setting_t *it, const char *source);
typedef bool (*HPMHOOK_pre_itemdb_read_libconfig_item_reform_info_materials) (struct config_setting_t **it, struct item_reform **ir);
typedef bool (*HPMHOOK_post_itemdb_read_libconfig_item_reform_info_materials) (bool retVal___, struct config_setting_t *it, struct item_reform *ir);
typedef bool (*HPMHOOK_pre_itemdb_read_libconfig_item_reform_info_reqinfo) (struct config_setting_t **it, struct item_reform **ir);
typedef bool (*HPMHOOK_post_itemdb_read_libconfig_item_reform_info_reqinfo) (bool retVal___, struct config_setting_t *it, struct item_reform *ir);
typedef bool (*HPMHOOK_pre_itemdb_read_libconfig_item_reform_info_behinfo) (struct config_setting_t **it, struct item_reform **ir);
typedef bool (*HPMHOOK_post_itemdb_read_libconfig_item_reform_info_behinfo) (bool retVal___, struct config_setting_t *it, struct item_reform *ir);
typedef bool (*HPMHOOK_pre_itemdb_read_libconfig_item_reform_list) (void);
typedef bool (*HPMHOOK_post_itemdb_read_libconfig_item_reform_list) (bool retVal___);
typedef bool (*HPMHOOK_pre_itemdb_read_libconfig_item_reform_list_sub) (struct config_setting_t **it, const char **source);
typedef bool (*HPMHOOK_post_itemdb_read_libconfig_item_reform_list_sub) (bool retVal___, struct config_setting_t *it, const char *source);
typedef void (*HPMHOOK_pre_itemdb_item_reform) (struct map_session_data **sd, const struct item_reform **ir, int *idx);
typedef void (*HPMHOOK_post_itemdb_item_reform) (struct map_session_data *sd, const struct item_reform *ir, int idx);
typedef const struct item_reform* (*HPMHOOK_pre_itemdb_search_reform_baseitem) (const struct item_data **itd, int *nameid);
typedef const struct item_reform* (*HPMHOOK_post_itemdb_search_reform_baseitem) (const struct item_reform* retVal___, const struct item_data *itd, int nameid);
#endif // MAP_ITEMDB_H
#ifdef LOGIN_LOGIN_H /* lchrif */
typedef void (*HPMHOOK_pre_lchrif_server_init) (int *id);
Expand Down
60 changes: 60 additions & 0 deletions src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2470,6 +2470,14 @@ struct {
struct HPMHookPoint *HP_clif_parse_cmd_decrypt_post;
struct HPMHookPoint *HP_clif_parse_cmd_optional_pre;
struct HPMHookPoint *HP_clif_parse_cmd_optional_post;
struct HPMHookPoint *HP_clif_item_reform_open_pre;
struct HPMHookPoint *HP_clif_item_reform_open_post;
struct HPMHookPoint *HP_clif_pItemReformClose_pre;
struct HPMHookPoint *HP_clif_pItemReformClose_post;
struct HPMHookPoint *HP_clif_pItemReformAck_pre;
struct HPMHookPoint *HP_clif_pItemReformAck_post;
struct HPMHookPoint *HP_clif_item_reform_result_pre;
struct HPMHookPoint *HP_clif_item_reform_result_post;
struct HPMHookPoint *HP_cmdline_init_pre;
struct HPMHookPoint *HP_cmdline_init_post;
struct HPMHookPoint *HP_cmdline_final_pre;
Expand Down Expand Up @@ -3366,6 +3374,8 @@ struct {
struct HPMHookPoint *HP_itemdb_exists_post;
struct HPMHookPoint *HP_itemdb_option_exists_pre;
struct HPMHookPoint *HP_itemdb_option_exists_post;
struct HPMHookPoint *HP_itemdb_reform_exists_pre;
struct HPMHookPoint *HP_itemdb_reform_exists_post;
struct HPMHookPoint *HP_itemdb_in_group_pre;
struct HPMHookPoint *HP_itemdb_in_group_post;
struct HPMHookPoint *HP_itemdb_group_item_pre;
Expand Down Expand Up @@ -3450,6 +3460,8 @@ struct {
struct HPMHookPoint *HP_itemdb_final_sub_post;
struct HPMHookPoint *HP_itemdb_options_final_sub_pre;
struct HPMHookPoint *HP_itemdb_options_final_sub_post;
struct HPMHookPoint *HP_itemdb_reform_final_sub_pre;
struct HPMHookPoint *HP_itemdb_reform_final_sub_post;
struct HPMHookPoint *HP_itemdb_clear_pre;
struct HPMHookPoint *HP_itemdb_clear_post;
struct HPMHookPoint *HP_itemdb_id2combo_pre;
Expand All @@ -3474,6 +3486,24 @@ struct {
struct HPMHookPoint *HP_itemdb_read_libconfig_lapineupgrade_sub_post;
struct HPMHookPoint *HP_itemdb_read_libconfig_lapineupgrade_sub_targets_pre;
struct HPMHookPoint *HP_itemdb_read_libconfig_lapineupgrade_sub_targets_post;
struct HPMHookPoint *HP_itemdb_read_libconfig_item_reform_info_pre;
struct HPMHookPoint *HP_itemdb_read_libconfig_item_reform_info_post;
struct HPMHookPoint *HP_itemdb_read_libconfig_item_reform_info_sub_pre;
struct HPMHookPoint *HP_itemdb_read_libconfig_item_reform_info_sub_post;
struct HPMHookPoint *HP_itemdb_read_libconfig_item_reform_info_materials_pre;
struct HPMHookPoint *HP_itemdb_read_libconfig_item_reform_info_materials_post;
struct HPMHookPoint *HP_itemdb_read_libconfig_item_reform_info_reqinfo_pre;
struct HPMHookPoint *HP_itemdb_read_libconfig_item_reform_info_reqinfo_post;
struct HPMHookPoint *HP_itemdb_read_libconfig_item_reform_info_behinfo_pre;
struct HPMHookPoint *HP_itemdb_read_libconfig_item_reform_info_behinfo_post;
struct HPMHookPoint *HP_itemdb_read_libconfig_item_reform_list_pre;
struct HPMHookPoint *HP_itemdb_read_libconfig_item_reform_list_post;
struct HPMHookPoint *HP_itemdb_read_libconfig_item_reform_list_sub_pre;
struct HPMHookPoint *HP_itemdb_read_libconfig_item_reform_list_sub_post;
struct HPMHookPoint *HP_itemdb_item_reform_pre;
struct HPMHookPoint *HP_itemdb_item_reform_post;
struct HPMHookPoint *HP_itemdb_search_reform_baseitem_pre;
struct HPMHookPoint *HP_itemdb_search_reform_baseitem_post;
struct HPMHookPoint *HP_libconfig_set_db_path_pre;
struct HPMHookPoint *HP_libconfig_set_db_path_post;
struct HPMHookPoint *HP_libconfig_format_db_path_pre;
Expand Down Expand Up @@ -9805,6 +9835,14 @@ struct {
int HP_clif_parse_cmd_decrypt_post;
int HP_clif_parse_cmd_optional_pre;
int HP_clif_parse_cmd_optional_post;
int HP_clif_item_reform_open_pre;
int HP_clif_item_reform_open_post;
int HP_clif_pItemReformClose_pre;
int HP_clif_pItemReformClose_post;
int HP_clif_pItemReformAck_pre;
int HP_clif_pItemReformAck_post;
int HP_clif_item_reform_result_pre;
int HP_clif_item_reform_result_post;
int HP_cmdline_init_pre;
int HP_cmdline_init_post;
int HP_cmdline_final_pre;
Expand Down Expand Up @@ -10701,6 +10739,8 @@ struct {
int HP_itemdb_exists_post;
int HP_itemdb_option_exists_pre;
int HP_itemdb_option_exists_post;
int HP_itemdb_reform_exists_pre;
int HP_itemdb_reform_exists_post;
int HP_itemdb_in_group_pre;
int HP_itemdb_in_group_post;
int HP_itemdb_group_item_pre;
Expand Down Expand Up @@ -10785,6 +10825,8 @@ struct {
int HP_itemdb_final_sub_post;
int HP_itemdb_options_final_sub_pre;
int HP_itemdb_options_final_sub_post;
int HP_itemdb_reform_final_sub_pre;
int HP_itemdb_reform_final_sub_post;
int HP_itemdb_clear_pre;
int HP_itemdb_clear_post;
int HP_itemdb_id2combo_pre;
Expand All @@ -10809,6 +10851,24 @@ struct {
int HP_itemdb_read_libconfig_lapineupgrade_sub_post;
int HP_itemdb_read_libconfig_lapineupgrade_sub_targets_pre;
int HP_itemdb_read_libconfig_lapineupgrade_sub_targets_post;
int HP_itemdb_read_libconfig_item_reform_info_pre;
int HP_itemdb_read_libconfig_item_reform_info_post;
int HP_itemdb_read_libconfig_item_reform_info_sub_pre;
int HP_itemdb_read_libconfig_item_reform_info_sub_post;
int HP_itemdb_read_libconfig_item_reform_info_materials_pre;
int HP_itemdb_read_libconfig_item_reform_info_materials_post;
int HP_itemdb_read_libconfig_item_reform_info_reqinfo_pre;
int HP_itemdb_read_libconfig_item_reform_info_reqinfo_post;
int HP_itemdb_read_libconfig_item_reform_info_behinfo_pre;
int HP_itemdb_read_libconfig_item_reform_info_behinfo_post;
int HP_itemdb_read_libconfig_item_reform_list_pre;
int HP_itemdb_read_libconfig_item_reform_list_post;
int HP_itemdb_read_libconfig_item_reform_list_sub_pre;
int HP_itemdb_read_libconfig_item_reform_list_sub_post;
int HP_itemdb_item_reform_pre;
int HP_itemdb_item_reform_post;
int HP_itemdb_search_reform_baseitem_pre;
int HP_itemdb_search_reform_baseitem_post;
int HP_libconfig_set_db_path_pre;
int HP_libconfig_set_db_path_post;
int HP_libconfig_format_db_path_pre;
Expand Down
15 changes: 15 additions & 0 deletions src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,10 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->parse_cmd_normal, HP_clif_parse_cmd_normal) },
{ HP_POP(clif->parse_cmd_decrypt, HP_clif_parse_cmd_decrypt) },
{ HP_POP(clif->parse_cmd_optional, HP_clif_parse_cmd_optional) },
{ HP_POP(clif->item_reform_open, HP_clif_item_reform_open) },
{ HP_POP(clif->pItemReformClose, HP_clif_pItemReformClose) },
{ HP_POP(clif->pItemReformAck, HP_clif_pItemReformAck) },
{ HP_POP(clif->item_reform_result, HP_clif_item_reform_result) },
/* cmdline_interface */
{ HP_POP(cmdline->init, HP_cmdline_init) },
{ HP_POP(cmdline->final, HP_cmdline_final) },
Expand Down Expand Up @@ -1723,6 +1727,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(itemdb->search, HP_itemdb_search) },
{ HP_POP(itemdb->exists, HP_itemdb_exists) },
{ HP_POP(itemdb->option_exists, HP_itemdb_option_exists) },
{ HP_POP(itemdb->reform_exists, HP_itemdb_reform_exists) },
{ HP_POP(itemdb->in_group, HP_itemdb_in_group) },
{ HP_POP(itemdb->group_item, HP_itemdb_group_item) },
{ HP_POP(itemdb->chain_item, HP_itemdb_chain_item) },
Expand Down Expand Up @@ -1765,6 +1770,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(itemdb->destroy_item_data, HP_itemdb_destroy_item_data) },
{ HP_POP(itemdb->final_sub, HP_itemdb_final_sub) },
{ HP_POP(itemdb->options_final_sub, HP_itemdb_options_final_sub) },
{ HP_POP(itemdb->reform_final_sub, HP_itemdb_reform_final_sub) },
{ HP_POP(itemdb->clear, HP_itemdb_clear) },
{ HP_POP(itemdb->id2combo, HP_itemdb_id2combo) },
{ HP_POP(itemdb->is_item_usable, HP_itemdb_is_item_usable) },
Expand All @@ -1777,6 +1783,15 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(itemdb->read_libconfig_lapineupgrade, HP_itemdb_read_libconfig_lapineupgrade) },
{ HP_POP(itemdb->read_libconfig_lapineupgrade_sub, HP_itemdb_read_libconfig_lapineupgrade_sub) },
{ HP_POP(itemdb->read_libconfig_lapineupgrade_sub_targets, HP_itemdb_read_libconfig_lapineupgrade_sub_targets) },
{ HP_POP(itemdb->read_libconfig_item_reform_info, HP_itemdb_read_libconfig_item_reform_info) },
{ HP_POP(itemdb->read_libconfig_item_reform_info_sub, HP_itemdb_read_libconfig_item_reform_info_sub) },
{ HP_POP(itemdb->read_libconfig_item_reform_info_materials, HP_itemdb_read_libconfig_item_reform_info_materials) },
{ HP_POP(itemdb->read_libconfig_item_reform_info_reqinfo, HP_itemdb_read_libconfig_item_reform_info_reqinfo) },
{ HP_POP(itemdb->read_libconfig_item_reform_info_behinfo, HP_itemdb_read_libconfig_item_reform_info_behinfo) },
{ HP_POP(itemdb->read_libconfig_item_reform_list, HP_itemdb_read_libconfig_item_reform_list) },
{ HP_POP(itemdb->read_libconfig_item_reform_list_sub, HP_itemdb_read_libconfig_item_reform_list_sub) },
{ HP_POP(itemdb->item_reform, HP_itemdb_item_reform) },
{ HP_POP(itemdb->search_reform_baseitem, HP_itemdb_search_reform_baseitem) },
/* libconfig_interface */
{ HP_POP(libconfig->set_db_path, HP_libconfig_set_db_path) },
{ HP_POP(libconfig->format_db_path, HP_libconfig_format_db_path) },
Expand Down
Loading

0 comments on commit 6143ce0

Please sign in to comment.