diff options
Diffstat (limited to 'src/plugins/HPMHooking')
11 files changed, 592 insertions, 249 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 7cc5ef2b1..f3b4370fb 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -1378,8 +1378,8 @@ typedef void (*HPMHOOK_pre_clif_mvp_noitem) (struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_mvp_noitem) (struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_changed_dir) (struct block_list **bl, enum send_target *target); typedef void (*HPMHOOK_post_clif_changed_dir) (struct block_list *bl, enum send_target target); -typedef void (*HPMHOOK_pre_clif_charnameack) (int *fd, struct block_list **bl); -typedef void (*HPMHOOK_post_clif_charnameack) (int fd, struct block_list *bl); +typedef void (*HPMHOOK_pre_clif_blname_ack) (int *fd, struct block_list **bl); +typedef void (*HPMHOOK_post_clif_blname_ack) (int fd, struct block_list *bl); typedef void (*HPMHOOK_pre_clif_monster_hp_bar) (struct mob_data **md, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_monster_hp_bar) (struct mob_data *md, struct map_session_data *sd); typedef int (*HPMHOOK_pre_clif_hpmeter) (struct map_session_data **sd); @@ -2620,24 +2620,10 @@ typedef void (*HPMHOOK_pre_clif_pPrivateAirshipRequest) (int *fd, struct map_ses typedef void (*HPMHOOK_post_clif_pPrivateAirshipRequest) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_PrivateAirshipResponse) (struct map_session_data **sd, uint32 *flag); typedef void (*HPMHOOK_post_clif_PrivateAirshipResponse) (struct map_session_data *sd, uint32 flag); -typedef void (*HPMHOOK_pre_clif_stylist_vector_init) (void); -typedef void (*HPMHOOK_post_clif_stylist_vector_init) (void); -typedef void (*HPMHOOK_pre_clif_stylist_vector_clear) (void); -typedef void (*HPMHOOK_post_clif_stylist_vector_clear) (void); -typedef bool (*HPMHOOK_pre_clif_stylist_read_db_libconfig) (void); -typedef bool (*HPMHOOK_post_clif_stylist_read_db_libconfig) (bool retVal___); -typedef bool (*HPMHOOK_pre_clif_stylist_read_db_libconfig_sub) (struct config_setting_t **it, int *idx, const char **source); -typedef bool (*HPMHOOK_post_clif_stylist_read_db_libconfig_sub) (bool retVal___, struct config_setting_t *it, int idx, const char *source); -typedef bool (*HPMHOOK_pre_clif_style_change_validate_requirements) (struct map_session_data **sd, int *type, int16 *idx); -typedef bool (*HPMHOOK_post_clif_style_change_validate_requirements) (bool retVal___, struct map_session_data *sd, int type, int16 idx); -typedef void (*HPMHOOK_pre_clif_stylist_send_rodexitem) (struct map_session_data **sd, int *itemid); -typedef void (*HPMHOOK_post_clif_stylist_send_rodexitem) (struct map_session_data *sd, int itemid); typedef void (*HPMHOOK_pre_clif_pReqStyleChange) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_pReqStyleChange) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_pReqStyleChange2) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_pReqStyleChange2) (int fd, struct map_session_data *sd); -typedef void (*HPMHOOK_pre_clif_cz_req_style_change_sub) (struct map_session_data **sd, int *type, int16 *idx, bool *isitem); -typedef void (*HPMHOOK_post_clif_cz_req_style_change_sub) (struct map_session_data *sd, int type, int16 idx, bool isitem); typedef void (*HPMHOOK_pre_clif_style_change_response) (struct map_session_data **sd, enum stylist_shop *flag); typedef void (*HPMHOOK_post_clif_style_change_response) (struct map_session_data *sd, enum stylist_shop flag); typedef void (*HPMHOOK_pre_clif_pPetEvolution) (int *fd, struct map_session_data **sd); @@ -2668,6 +2654,16 @@ typedef void (*HPMHOOK_pre_clif_pNPCBarterPurchase) (int *fd, struct map_session typedef void (*HPMHOOK_post_clif_pNPCBarterPurchase) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_pClientVersion) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_pClientVersion) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_pPing) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_pPing) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_ping) (struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_ping) (struct map_session_data *sd); +typedef int (*HPMHOOK_pre_clif_pingTimer) (int *tid, int64 *tick, int *id, intptr_t *data); +typedef int (*HPMHOOK_post_clif_pingTimer) (int retVal___, int tid, int64 tick, int id, intptr_t data); +typedef int (*HPMHOOK_pre_clif_pingTimerSub) (struct map_session_data **sd, va_list ap); +typedef int (*HPMHOOK_post_clif_pingTimerSub) (int retVal___, struct map_session_data *sd, va_list ap); +typedef void (*HPMHOOK_pre_clif_pResetCooldown) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_pResetCooldown) (int fd, struct map_session_data *sd); #endif // MAP_CLIF_H #ifdef COMMON_CORE_H /* cmdline */ typedef void (*HPMHOOK_pre_cmdline_init) (void); @@ -7538,6 +7534,8 @@ typedef void (*HPMHOOK_pre_sockt_flush) (int *fd); typedef void (*HPMHOOK_post_sockt_flush) (int fd); typedef void (*HPMHOOK_pre_sockt_flush_fifos) (void); typedef void (*HPMHOOK_post_sockt_flush_fifos) (void); +typedef int (*HPMHOOK_pre_sockt_connect_client) (int *listen_fd); +typedef int (*HPMHOOK_post_sockt_connect_client) (int retVal___, int listen_fd); typedef void (*HPMHOOK_pre_sockt_set_nonblocking) (int *fd, unsigned long *yes); typedef void (*HPMHOOK_post_sockt_set_nonblocking) (int fd, unsigned long yes); typedef void (*HPMHOOK_pre_sockt_set_defaultparse) (ParseFunc *defaultparse); @@ -7969,6 +7967,26 @@ typedef int (*HPMHOOK_post_strlib_strline_) (int retVal___, const char *str, siz typedef bool (*HPMHOOK_pre_strlib_bin2hex_) (char **output, const unsigned char **input, size_t *count); typedef bool (*HPMHOOK_post_strlib_bin2hex_) (bool retVal___, char *output, const unsigned char *input, size_t count); #endif // COMMON_STRLIB_H +#ifdef MAP_STYLIST_H /* stylist */ +typedef void (*HPMHOOK_pre_stylist_init) (bool *minimal); +typedef void (*HPMHOOK_post_stylist_init) (bool minimal); +typedef void (*HPMHOOK_pre_stylist_final) (void); +typedef void (*HPMHOOK_post_stylist_final) (void); +typedef void (*HPMHOOK_pre_stylist_vector_init) (void); +typedef void (*HPMHOOK_post_stylist_vector_init) (void); +typedef void (*HPMHOOK_pre_stylist_vector_clear) (void); +typedef void (*HPMHOOK_post_stylist_vector_clear) (void); +typedef bool (*HPMHOOK_pre_stylist_read_db_libconfig) (void); +typedef bool (*HPMHOOK_post_stylist_read_db_libconfig) (bool retVal___); +typedef bool (*HPMHOOK_pre_stylist_read_db_libconfig_sub) (struct config_setting_t **it, int *idx, const char **source); +typedef bool (*HPMHOOK_post_stylist_read_db_libconfig_sub) (bool retVal___, struct config_setting_t *it, int idx, const char *source); +typedef void (*HPMHOOK_pre_stylist_request_style_change) (struct map_session_data **sd, int *type, int16 *idx, bool *isitem); +typedef void (*HPMHOOK_post_stylist_request_style_change) (struct map_session_data *sd, int type, int16 idx, bool isitem); +typedef bool (*HPMHOOK_pre_stylist_validate_requirements) (struct map_session_data **sd, int *type, int16 *idx); +typedef bool (*HPMHOOK_post_stylist_validate_requirements) (bool retVal___, struct map_session_data *sd, int type, int16 idx); +typedef void (*HPMHOOK_pre_stylist_send_rodexitem) (struct map_session_data **sd, int *itemid); +typedef void (*HPMHOOK_post_stylist_send_rodexitem) (struct map_session_data *sd, int itemid); +#endif // MAP_STYLIST_H #ifdef COMMON_STRLIB_H /* sv */ typedef int (*HPMHOOK_pre_sv_parse_next) (struct s_svstate **svstate); typedef int (*HPMHOOK_post_sv_parse_next) (int retVal___, struct s_svstate *svstate); diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc index a8b4860f3..dbabf8ed4 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc @@ -1422,6 +1422,8 @@ struct { struct HPMHookPoint *HP_sockt_flush_post; struct HPMHookPoint *HP_sockt_flush_fifos_pre; struct HPMHookPoint *HP_sockt_flush_fifos_post; + struct HPMHookPoint *HP_sockt_connect_client_pre; + struct HPMHookPoint *HP_sockt_connect_client_post; struct HPMHookPoint *HP_sockt_set_nonblocking_pre; struct HPMHookPoint *HP_sockt_set_nonblocking_post; struct HPMHookPoint *HP_sockt_set_defaultparse_pre; @@ -3059,6 +3061,8 @@ struct { int HP_sockt_flush_post; int HP_sockt_flush_fifos_pre; int HP_sockt_flush_fifos_post; + int HP_sockt_connect_client_pre; + int HP_sockt_connect_client_post; int HP_sockt_set_nonblocking_pre; int HP_sockt_set_nonblocking_post; int HP_sockt_set_defaultparse_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc index 56c5bcfb7..f666ad1fd 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc @@ -758,6 +758,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(sockt->session_is_active, HP_sockt_session_is_active) }, { HP_POP(sockt->flush, HP_sockt_flush) }, { HP_POP(sockt->flush_fifos, HP_sockt_flush_fifos) }, + { HP_POP(sockt->connect_client, HP_sockt_connect_client) }, { HP_POP(sockt->set_nonblocking, HP_sockt_set_nonblocking) }, { HP_POP(sockt->set_defaultparse, HP_sockt_set_defaultparse) }, { HP_POP(sockt->host2ip, HP_sockt_host2ip) }, diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc index 0bd61ba15..edffe7c11 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc @@ -18686,6 +18686,33 @@ void HP_sockt_flush_fifos(void) { } return; } +int HP_sockt_connect_client(int listen_fd) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_sockt_connect_client_pre > 0) { + int (*preHookFunc) (int *listen_fd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_connect_client_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_sockt_connect_client_pre[hIndex].func; + retVal___ = preHookFunc(&listen_fd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.sockt.connect_client(listen_fd); + } + if (HPMHooks.count.HP_sockt_connect_client_post > 0) { + int (*postHookFunc) (int retVal___, int listen_fd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_connect_client_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_sockt_connect_client_post[hIndex].func; + retVal___ = postHookFunc(retVal___, listen_fd); + } + } + return retVal___; +} void HP_sockt_set_nonblocking(int fd, unsigned long yes) { int hIndex = 0; if (HPMHooks.count.HP_sockt_set_nonblocking_pre > 0) { diff --git a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc index 7293e8fc4..ba0fe05c2 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc @@ -584,6 +584,8 @@ struct { struct HPMHookPoint *HP_sockt_flush_post; struct HPMHookPoint *HP_sockt_flush_fifos_pre; struct HPMHookPoint *HP_sockt_flush_fifos_post; + struct HPMHookPoint *HP_sockt_connect_client_pre; + struct HPMHookPoint *HP_sockt_connect_client_post; struct HPMHookPoint *HP_sockt_set_nonblocking_pre; struct HPMHookPoint *HP_sockt_set_nonblocking_post; struct HPMHookPoint *HP_sockt_set_defaultparse_pre; @@ -1383,6 +1385,8 @@ struct { int HP_sockt_flush_post; int HP_sockt_flush_fifos_pre; int HP_sockt_flush_fifos_post; + int HP_sockt_connect_client_pre; + int HP_sockt_connect_client_post; int HP_sockt_set_nonblocking_pre; int HP_sockt_set_nonblocking_post; int HP_sockt_set_defaultparse_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc index 825e049b1..1e3548621 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc @@ -326,6 +326,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(sockt->session_is_active, HP_sockt_session_is_active) }, { HP_POP(sockt->flush, HP_sockt_flush) }, { HP_POP(sockt->flush_fifos, HP_sockt_flush_fifos) }, + { HP_POP(sockt->connect_client, HP_sockt_connect_client) }, { HP_POP(sockt->set_nonblocking, HP_sockt_set_nonblocking) }, { HP_POP(sockt->set_defaultparse, HP_sockt_set_defaultparse) }, { HP_POP(sockt->host2ip, HP_sockt_host2ip) }, diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc index 044ee2df2..080fb75ff 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc @@ -7495,6 +7495,33 @@ void HP_sockt_flush_fifos(void) { } return; } +int HP_sockt_connect_client(int listen_fd) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_sockt_connect_client_pre > 0) { + int (*preHookFunc) (int *listen_fd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_connect_client_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_sockt_connect_client_pre[hIndex].func; + retVal___ = preHookFunc(&listen_fd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.sockt.connect_client(listen_fd); + } + if (HPMHooks.count.HP_sockt_connect_client_post > 0) { + int (*postHookFunc) (int retVal___, int listen_fd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_connect_client_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_sockt_connect_client_post[hIndex].func; + retVal___ = postHookFunc(retVal___, listen_fd); + } + } + return retVal___; +} void HP_sockt_set_nonblocking(int fd, unsigned long yes) { int hIndex = 0; if (HPMHooks.count.HP_sockt_set_nonblocking_pre > 0) { diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index b323d77e6..99d6be230 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -968,8 +968,8 @@ struct { struct HPMHookPoint *HP_clif_mvp_noitem_post; struct HPMHookPoint *HP_clif_changed_dir_pre; struct HPMHookPoint *HP_clif_changed_dir_post; - struct HPMHookPoint *HP_clif_charnameack_pre; - struct HPMHookPoint *HP_clif_charnameack_post; + struct HPMHookPoint *HP_clif_blname_ack_pre; + struct HPMHookPoint *HP_clif_blname_ack_post; struct HPMHookPoint *HP_clif_monster_hp_bar_pre; struct HPMHookPoint *HP_clif_monster_hp_bar_post; struct HPMHookPoint *HP_clif_hpmeter_pre; @@ -2210,24 +2210,10 @@ struct { struct HPMHookPoint *HP_clif_pPrivateAirshipRequest_post; struct HPMHookPoint *HP_clif_PrivateAirshipResponse_pre; struct HPMHookPoint *HP_clif_PrivateAirshipResponse_post; - struct HPMHookPoint *HP_clif_stylist_vector_init_pre; - struct HPMHookPoint *HP_clif_stylist_vector_init_post; - struct HPMHookPoint *HP_clif_stylist_vector_clear_pre; - struct HPMHookPoint *HP_clif_stylist_vector_clear_post; - struct HPMHookPoint *HP_clif_stylist_read_db_libconfig_pre; - struct HPMHookPoint *HP_clif_stylist_read_db_libconfig_post; - struct HPMHookPoint *HP_clif_stylist_read_db_libconfig_sub_pre; - struct HPMHookPoint *HP_clif_stylist_read_db_libconfig_sub_post; - struct HPMHookPoint *HP_clif_style_change_validate_requirements_pre; - struct HPMHookPoint *HP_clif_style_change_validate_requirements_post; - struct HPMHookPoint *HP_clif_stylist_send_rodexitem_pre; - struct HPMHookPoint *HP_clif_stylist_send_rodexitem_post; struct HPMHookPoint *HP_clif_pReqStyleChange_pre; struct HPMHookPoint *HP_clif_pReqStyleChange_post; struct HPMHookPoint *HP_clif_pReqStyleChange2_pre; struct HPMHookPoint *HP_clif_pReqStyleChange2_post; - struct HPMHookPoint *HP_clif_cz_req_style_change_sub_pre; - struct HPMHookPoint *HP_clif_cz_req_style_change_sub_post; struct HPMHookPoint *HP_clif_style_change_response_pre; struct HPMHookPoint *HP_clif_style_change_response_post; struct HPMHookPoint *HP_clif_pPetEvolution_pre; @@ -2258,6 +2244,16 @@ struct { struct HPMHookPoint *HP_clif_pNPCBarterPurchase_post; struct HPMHookPoint *HP_clif_pClientVersion_pre; struct HPMHookPoint *HP_clif_pClientVersion_post; + struct HPMHookPoint *HP_clif_pPing_pre; + struct HPMHookPoint *HP_clif_pPing_post; + struct HPMHookPoint *HP_clif_ping_pre; + struct HPMHookPoint *HP_clif_ping_post; + struct HPMHookPoint *HP_clif_pingTimer_pre; + struct HPMHookPoint *HP_clif_pingTimer_post; + struct HPMHookPoint *HP_clif_pingTimerSub_pre; + struct HPMHookPoint *HP_clif_pingTimerSub_post; + struct HPMHookPoint *HP_clif_pResetCooldown_pre; + struct HPMHookPoint *HP_clif_pResetCooldown_post; struct HPMHookPoint *HP_cmdline_init_pre; struct HPMHookPoint *HP_cmdline_init_post; struct HPMHookPoint *HP_cmdline_final_pre; @@ -6042,6 +6038,8 @@ struct { struct HPMHookPoint *HP_sockt_flush_post; struct HPMHookPoint *HP_sockt_flush_fifos_pre; struct HPMHookPoint *HP_sockt_flush_fifos_post; + struct HPMHookPoint *HP_sockt_connect_client_pre; + struct HPMHookPoint *HP_sockt_connect_client_post; struct HPMHookPoint *HP_sockt_set_nonblocking_pre; struct HPMHookPoint *HP_sockt_set_nonblocking_post; struct HPMHookPoint *HP_sockt_set_defaultparse_pre; @@ -6462,6 +6460,24 @@ struct { struct HPMHookPoint *HP_strlib_strline__post; struct HPMHookPoint *HP_strlib_bin2hex__pre; struct HPMHookPoint *HP_strlib_bin2hex__post; + struct HPMHookPoint *HP_stylist_init_pre; + struct HPMHookPoint *HP_stylist_init_post; + struct HPMHookPoint *HP_stylist_final_pre; + struct HPMHookPoint *HP_stylist_final_post; + struct HPMHookPoint *HP_stylist_vector_init_pre; + struct HPMHookPoint *HP_stylist_vector_init_post; + struct HPMHookPoint *HP_stylist_vector_clear_pre; + struct HPMHookPoint *HP_stylist_vector_clear_post; + struct HPMHookPoint *HP_stylist_read_db_libconfig_pre; + struct HPMHookPoint *HP_stylist_read_db_libconfig_post; + struct HPMHookPoint *HP_stylist_read_db_libconfig_sub_pre; + struct HPMHookPoint *HP_stylist_read_db_libconfig_sub_post; + struct HPMHookPoint *HP_stylist_request_style_change_pre; + struct HPMHookPoint *HP_stylist_request_style_change_post; + struct HPMHookPoint *HP_stylist_validate_requirements_pre; + struct HPMHookPoint *HP_stylist_validate_requirements_post; + struct HPMHookPoint *HP_stylist_send_rodexitem_pre; + struct HPMHookPoint *HP_stylist_send_rodexitem_post; struct HPMHookPoint *HP_sv_parse_next_pre; struct HPMHookPoint *HP_sv_parse_next_post; struct HPMHookPoint *HP_sv_parse_pre; @@ -7637,8 +7653,8 @@ struct { int HP_clif_mvp_noitem_post; int HP_clif_changed_dir_pre; int HP_clif_changed_dir_post; - int HP_clif_charnameack_pre; - int HP_clif_charnameack_post; + int HP_clif_blname_ack_pre; + int HP_clif_blname_ack_post; int HP_clif_monster_hp_bar_pre; int HP_clif_monster_hp_bar_post; int HP_clif_hpmeter_pre; @@ -8879,24 +8895,10 @@ struct { int HP_clif_pPrivateAirshipRequest_post; int HP_clif_PrivateAirshipResponse_pre; int HP_clif_PrivateAirshipResponse_post; - int HP_clif_stylist_vector_init_pre; - int HP_clif_stylist_vector_init_post; - int HP_clif_stylist_vector_clear_pre; - int HP_clif_stylist_vector_clear_post; - int HP_clif_stylist_read_db_libconfig_pre; - int HP_clif_stylist_read_db_libconfig_post; - int HP_clif_stylist_read_db_libconfig_sub_pre; - int HP_clif_stylist_read_db_libconfig_sub_post; - int HP_clif_style_change_validate_requirements_pre; - int HP_clif_style_change_validate_requirements_post; - int HP_clif_stylist_send_rodexitem_pre; - int HP_clif_stylist_send_rodexitem_post; int HP_clif_pReqStyleChange_pre; int HP_clif_pReqStyleChange_post; int HP_clif_pReqStyleChange2_pre; int HP_clif_pReqStyleChange2_post; - int HP_clif_cz_req_style_change_sub_pre; - int HP_clif_cz_req_style_change_sub_post; int HP_clif_style_change_response_pre; int HP_clif_style_change_response_post; int HP_clif_pPetEvolution_pre; @@ -8927,6 +8929,16 @@ struct { int HP_clif_pNPCBarterPurchase_post; int HP_clif_pClientVersion_pre; int HP_clif_pClientVersion_post; + int HP_clif_pPing_pre; + int HP_clif_pPing_post; + int HP_clif_ping_pre; + int HP_clif_ping_post; + int HP_clif_pingTimer_pre; + int HP_clif_pingTimer_post; + int HP_clif_pingTimerSub_pre; + int HP_clif_pingTimerSub_post; + int HP_clif_pResetCooldown_pre; + int HP_clif_pResetCooldown_post; int HP_cmdline_init_pre; int HP_cmdline_init_post; int HP_cmdline_final_pre; @@ -12711,6 +12723,8 @@ struct { int HP_sockt_flush_post; int HP_sockt_flush_fifos_pre; int HP_sockt_flush_fifos_post; + int HP_sockt_connect_client_pre; + int HP_sockt_connect_client_post; int HP_sockt_set_nonblocking_pre; int HP_sockt_set_nonblocking_post; int HP_sockt_set_defaultparse_pre; @@ -13131,6 +13145,24 @@ struct { int HP_strlib_strline__post; int HP_strlib_bin2hex__pre; int HP_strlib_bin2hex__post; + int HP_stylist_init_pre; + int HP_stylist_init_post; + int HP_stylist_final_pre; + int HP_stylist_final_post; + int HP_stylist_vector_init_pre; + int HP_stylist_vector_init_post; + int HP_stylist_vector_clear_pre; + int HP_stylist_vector_clear_post; + int HP_stylist_read_db_libconfig_pre; + int HP_stylist_read_db_libconfig_post; + int HP_stylist_read_db_libconfig_sub_pre; + int HP_stylist_read_db_libconfig_sub_post; + int HP_stylist_request_style_change_pre; + int HP_stylist_request_style_change_post; + int HP_stylist_validate_requirements_pre; + int HP_stylist_validate_requirements_post; + int HP_stylist_send_rodexitem_pre; + int HP_stylist_send_rodexitem_post; int HP_sv_parse_next_pre; int HP_sv_parse_next_post; int HP_sv_parse_pre; @@ -13424,6 +13456,7 @@ struct { struct storage_interface storage; struct stringbuf_interface StrBuf; struct strlib_interface strlib; + struct stylist_interface stylist; struct sv_interface sv; struct sysinfo_interface sysinfo; struct thread_interface thread; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 3c09aba59..8532f9d22 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -508,7 +508,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->mvp_exp, HP_clif_mvp_exp) }, { HP_POP(clif->mvp_noitem, HP_clif_mvp_noitem) }, { HP_POP(clif->changed_dir, HP_clif_changed_dir) }, - { HP_POP(clif->charnameack, HP_clif_charnameack) }, + { HP_POP(clif->blname_ack, HP_clif_blname_ack) }, { HP_POP(clif->monster_hp_bar, HP_clif_monster_hp_bar) }, { HP_POP(clif->hpmeter, HP_clif_hpmeter) }, { HP_POP(clif->hpmeter_single, HP_clif_hpmeter_single) }, @@ -1129,15 +1129,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->ui_action, HP_clif_ui_action) }, { HP_POP(clif->pPrivateAirshipRequest, HP_clif_pPrivateAirshipRequest) }, { HP_POP(clif->PrivateAirshipResponse, HP_clif_PrivateAirshipResponse) }, - { HP_POP(clif->stylist_vector_init, HP_clif_stylist_vector_init) }, - { HP_POP(clif->stylist_vector_clear, HP_clif_stylist_vector_clear) }, - { HP_POP(clif->stylist_read_db_libconfig, HP_clif_stylist_read_db_libconfig) }, - { HP_POP(clif->stylist_read_db_libconfig_sub, HP_clif_stylist_read_db_libconfig_sub) }, - { HP_POP(clif->style_change_validate_requirements, HP_clif_style_change_validate_requirements) }, - { HP_POP(clif->stylist_send_rodexitem, HP_clif_stylist_send_rodexitem) }, { HP_POP(clif->pReqStyleChange, HP_clif_pReqStyleChange) }, { HP_POP(clif->pReqStyleChange2, HP_clif_pReqStyleChange2) }, - { HP_POP(clif->cz_req_style_change_sub, HP_clif_cz_req_style_change_sub) }, { HP_POP(clif->style_change_response, HP_clif_style_change_response) }, { HP_POP(clif->pPetEvolution, HP_clif_pPetEvolution) }, { HP_POP(clif->petEvolutionResult, HP_clif_petEvolutionResult) }, @@ -1153,6 +1146,11 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->pNPCBarterClosed, HP_clif_pNPCBarterClosed) }, { HP_POP(clif->pNPCBarterPurchase, HP_clif_pNPCBarterPurchase) }, { HP_POP(clif->pClientVersion, HP_clif_pClientVersion) }, + { HP_POP(clif->pPing, HP_clif_pPing) }, + { HP_POP(clif->ping, HP_clif_ping) }, + { HP_POP(clif->pingTimer, HP_clif_pingTimer) }, + { HP_POP(clif->pingTimerSub, HP_clif_pingTimerSub) }, + { HP_POP(clif->pResetCooldown, HP_clif_pResetCooldown) }, /* cmdline_interface */ { HP_POP(cmdline->init, HP_cmdline_init) }, { HP_POP(cmdline->final, HP_cmdline_final) }, @@ -3089,6 +3087,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(sockt->session_is_active, HP_sockt_session_is_active) }, { HP_POP(sockt->flush, HP_sockt_flush) }, { HP_POP(sockt->flush_fifos, HP_sockt_flush_fifos) }, + { HP_POP(sockt->connect_client, HP_sockt_connect_client) }, { HP_POP(sockt->set_nonblocking, HP_sockt_set_nonblocking) }, { HP_POP(sockt->set_defaultparse, HP_sockt_set_defaultparse) }, { HP_POP(sockt->host2ip, HP_sockt_host2ip) }, @@ -3304,6 +3303,16 @@ struct HookingPointData HookingPoints[] = { { HP_POP(strlib->safestrnlen_, HP_strlib_safestrnlen_) }, { HP_POP(strlib->strline_, HP_strlib_strline_) }, { HP_POP(strlib->bin2hex_, HP_strlib_bin2hex_) }, +/* stylist_interface */ + { HP_POP(stylist->init, HP_stylist_init) }, + { HP_POP(stylist->final, HP_stylist_final) }, + { HP_POP(stylist->vector_init, HP_stylist_vector_init) }, + { HP_POP(stylist->vector_clear, HP_stylist_vector_clear) }, + { HP_POP(stylist->read_db_libconfig, HP_stylist_read_db_libconfig) }, + { HP_POP(stylist->read_db_libconfig_sub, HP_stylist_read_db_libconfig_sub) }, + { HP_POP(stylist->request_style_change, HP_stylist_request_style_change) }, + { HP_POP(stylist->validate_requirements, HP_stylist_validate_requirements) }, + { HP_POP(stylist->send_rodexitem, HP_stylist_send_rodexitem) }, /* sv_interface */ { HP_POP(sv->parse_next, HP_sv_parse_next) }, { HP_POP(sv->parse, HP_sv_parse) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 8242b9797..e6f8a69f0 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -12619,13 +12619,13 @@ void HP_clif_changed_dir(struct block_list *bl, enum send_target target) { } return; } -void HP_clif_charnameack(int fd, struct block_list *bl) { +void HP_clif_blname_ack(int fd, struct block_list *bl) { int hIndex = 0; - if (HPMHooks.count.HP_clif_charnameack_pre > 0) { + if (HPMHooks.count.HP_clif_blname_ack_pre > 0) { void (*preHookFunc) (int *fd, struct block_list **bl); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_charnameack_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_clif_charnameack_pre[hIndex].func; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_blname_ack_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_blname_ack_pre[hIndex].func; preHookFunc(&fd, &bl); } if (*HPMforce_return) { @@ -12634,12 +12634,12 @@ void HP_clif_charnameack(int fd, struct block_list *bl) { } } { - HPMHooks.source.clif.charnameack(fd, bl); + HPMHooks.source.clif.blname_ack(fd, bl); } - if (HPMHooks.count.HP_clif_charnameack_post > 0) { + if (HPMHooks.count.HP_clif_blname_ack_post > 0) { void (*postHookFunc) (int fd, struct block_list *bl); - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_charnameack_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_clif_charnameack_post[hIndex].func; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_blname_ack_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_blname_ack_post[hIndex].func; postHookFunc(fd, bl); } } @@ -28806,165 +28806,6 @@ void HP_clif_PrivateAirshipResponse(struct map_session_data *sd, uint32 flag) { } return; } -void HP_clif_stylist_vector_init(void) { - int hIndex = 0; - if (HPMHooks.count.HP_clif_stylist_vector_init_pre > 0) { - void (*preHookFunc) (void); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_stylist_vector_init_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_clif_stylist_vector_init_pre[hIndex].func; - preHookFunc(); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.clif.stylist_vector_init(); - } - if (HPMHooks.count.HP_clif_stylist_vector_init_post > 0) { - void (*postHookFunc) (void); - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_stylist_vector_init_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_clif_stylist_vector_init_post[hIndex].func; - postHookFunc(); - } - } - return; -} -void HP_clif_stylist_vector_clear(void) { - int hIndex = 0; - if (HPMHooks.count.HP_clif_stylist_vector_clear_pre > 0) { - void (*preHookFunc) (void); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_stylist_vector_clear_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_clif_stylist_vector_clear_pre[hIndex].func; - preHookFunc(); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.clif.stylist_vector_clear(); - } - if (HPMHooks.count.HP_clif_stylist_vector_clear_post > 0) { - void (*postHookFunc) (void); - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_stylist_vector_clear_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_clif_stylist_vector_clear_post[hIndex].func; - postHookFunc(); - } - } - return; -} -bool HP_clif_stylist_read_db_libconfig(void) { - int hIndex = 0; - bool retVal___ = false; - if (HPMHooks.count.HP_clif_stylist_read_db_libconfig_pre > 0) { - bool (*preHookFunc) (void); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_stylist_read_db_libconfig_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_clif_stylist_read_db_libconfig_pre[hIndex].func; - retVal___ = preHookFunc(); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.clif.stylist_read_db_libconfig(); - } - if (HPMHooks.count.HP_clif_stylist_read_db_libconfig_post > 0) { - bool (*postHookFunc) (bool retVal___); - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_stylist_read_db_libconfig_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_clif_stylist_read_db_libconfig_post[hIndex].func; - retVal___ = postHookFunc(retVal___); - } - } - return retVal___; -} -bool HP_clif_stylist_read_db_libconfig_sub(struct config_setting_t *it, int idx, const char *source) { - int hIndex = 0; - bool retVal___ = false; - if (HPMHooks.count.HP_clif_stylist_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_clif_stylist_read_db_libconfig_sub_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_clif_stylist_read_db_libconfig_sub_pre[hIndex].func; - retVal___ = preHookFunc(&it, &idx, &source); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.clif.stylist_read_db_libconfig_sub(it, idx, source); - } - if (HPMHooks.count.HP_clif_stylist_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_clif_stylist_read_db_libconfig_sub_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_clif_stylist_read_db_libconfig_sub_post[hIndex].func; - retVal___ = postHookFunc(retVal___, it, idx, source); - } - } - return retVal___; -} -bool HP_clif_style_change_validate_requirements(struct map_session_data *sd, int type, int16 idx) { - int hIndex = 0; - bool retVal___ = false; - if (HPMHooks.count.HP_clif_style_change_validate_requirements_pre > 0) { - bool (*preHookFunc) (struct map_session_data **sd, int *type, int16 *idx); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_style_change_validate_requirements_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_clif_style_change_validate_requirements_pre[hIndex].func; - retVal___ = preHookFunc(&sd, &type, &idx); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.clif.style_change_validate_requirements(sd, type, idx); - } - if (HPMHooks.count.HP_clif_style_change_validate_requirements_post > 0) { - bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int type, int16 idx); - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_style_change_validate_requirements_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_clif_style_change_validate_requirements_post[hIndex].func; - retVal___ = postHookFunc(retVal___, sd, type, idx); - } - } - return retVal___; -} -void HP_clif_stylist_send_rodexitem(struct map_session_data *sd, int itemid) { - int hIndex = 0; - if (HPMHooks.count.HP_clif_stylist_send_rodexitem_pre > 0) { - void (*preHookFunc) (struct map_session_data **sd, int *itemid); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_stylist_send_rodexitem_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_clif_stylist_send_rodexitem_pre[hIndex].func; - preHookFunc(&sd, &itemid); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.clif.stylist_send_rodexitem(sd, itemid); - } - if (HPMHooks.count.HP_clif_stylist_send_rodexitem_post > 0) { - void (*postHookFunc) (struct map_session_data *sd, int itemid); - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_stylist_send_rodexitem_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_clif_stylist_send_rodexitem_post[hIndex].func; - postHookFunc(sd, itemid); - } - } - return; -} void HP_clif_pReqStyleChange(int fd, struct map_session_data *sd) { int hIndex = 0; if (HPMHooks.count.HP_clif_pReqStyleChange_pre > 0) { @@ -29017,32 +28858,6 @@ void HP_clif_pReqStyleChange2(int fd, struct map_session_data *sd) { } return; } -void HP_clif_cz_req_style_change_sub(struct map_session_data *sd, int type, int16 idx, bool isitem) { - int hIndex = 0; - if (HPMHooks.count.HP_clif_cz_req_style_change_sub_pre > 0) { - void (*preHookFunc) (struct map_session_data **sd, int *type, int16 *idx, bool *isitem); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cz_req_style_change_sub_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_clif_cz_req_style_change_sub_pre[hIndex].func; - preHookFunc(&sd, &type, &idx, &isitem); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.clif.cz_req_style_change_sub(sd, type, idx, isitem); - } - if (HPMHooks.count.HP_clif_cz_req_style_change_sub_post > 0) { - void (*postHookFunc) (struct map_session_data *sd, int type, int16 idx, bool isitem); - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cz_req_style_change_sub_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_clif_cz_req_style_change_sub_post[hIndex].func; - postHookFunc(sd, type, idx, isitem); - } - } - return; -} void HP_clif_style_change_response(struct map_session_data *sd, enum stylist_shop flag) { int hIndex = 0; if (HPMHooks.count.HP_clif_style_change_response_pre > 0) { @@ -29434,6 +29249,144 @@ void HP_clif_pClientVersion(int fd, struct map_session_data *sd) { } return; } +void HP_clif_pPing(int fd, struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_pPing_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPing_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pPing_pre[hIndex].func; + preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.pPing(fd, sd); + } + if (HPMHooks.count.HP_clif_pPing_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPing_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pPing_post[hIndex].func; + postHookFunc(fd, sd); + } + } + return; +} +void HP_clif_ping(struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_ping_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_ping_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_ping_pre[hIndex].func; + preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.ping(sd); + } + if (HPMHooks.count.HP_clif_ping_post > 0) { + void (*postHookFunc) (struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_ping_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_ping_post[hIndex].func; + postHookFunc(sd); + } + } + return; +} +int HP_clif_pingTimer(int tid, int64 tick, int id, intptr_t data) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_clif_pingTimer_pre > 0) { + int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pingTimer_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pingTimer_pre[hIndex].func; + retVal___ = preHookFunc(&tid, &tick, &id, &data); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clif.pingTimer(tid, tick, id, data); + } + if (HPMHooks.count.HP_clif_pingTimer_post > 0) { + int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pingTimer_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pingTimer_post[hIndex].func; + retVal___ = postHookFunc(retVal___, tid, tick, id, data); + } + } + return retVal___; +} +int HP_clif_pingTimerSub(struct map_session_data *sd, va_list ap) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_clif_pingTimerSub_pre > 0) { + int (*preHookFunc) (struct map_session_data **sd, va_list ap); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pingTimerSub_pre; hIndex++) { + va_list ap___copy; va_copy(ap___copy, ap); + preHookFunc = HPMHooks.list.HP_clif_pingTimerSub_pre[hIndex].func; + retVal___ = preHookFunc(&sd, ap___copy); + va_end(ap___copy); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + va_list ap___copy; va_copy(ap___copy, ap); + retVal___ = HPMHooks.source.clif.pingTimerSub(sd, ap___copy); + va_end(ap___copy); + } + if (HPMHooks.count.HP_clif_pingTimerSub_post > 0) { + int (*postHookFunc) (int retVal___, struct map_session_data *sd, va_list ap); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pingTimerSub_post; hIndex++) { + va_list ap___copy; va_copy(ap___copy, ap); + postHookFunc = HPMHooks.list.HP_clif_pingTimerSub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, ap___copy); + va_end(ap___copy); + } + } + return retVal___; +} +void HP_clif_pResetCooldown(int fd, struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_pResetCooldown_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pResetCooldown_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pResetCooldown_pre[hIndex].func; + preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.pResetCooldown(fd, sd); + } + if (HPMHooks.count.HP_clif_pResetCooldown_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pResetCooldown_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pResetCooldown_post[hIndex].func; + postHookFunc(fd, sd); + } + } + return; +} /* cmdline_interface */ void HP_cmdline_init(void) { int hIndex = 0; @@ -80816,6 +80769,33 @@ void HP_sockt_flush_fifos(void) { } return; } +int HP_sockt_connect_client(int listen_fd) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_sockt_connect_client_pre > 0) { + int (*preHookFunc) (int *listen_fd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_connect_client_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_sockt_connect_client_pre[hIndex].func; + retVal___ = preHookFunc(&listen_fd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.sockt.connect_client(listen_fd); + } + if (HPMHooks.count.HP_sockt_connect_client_post > 0) { + int (*postHookFunc) (int retVal___, int listen_fd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_connect_client_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_sockt_connect_client_post[hIndex].func; + retVal___ = postHookFunc(retVal___, listen_fd); + } + } + return retVal___; +} void HP_sockt_set_nonblocking(int fd, unsigned long yes) { int hIndex = 0; if (HPMHooks.count.HP_sockt_set_nonblocking_pre > 0) { @@ -86488,6 +86468,244 @@ bool HP_strlib_bin2hex_(char *output, const unsigned char *input, size_t count) } return retVal___; } +/* stylist_interface */ +void HP_stylist_init(bool minimal) { + int hIndex = 0; + if (HPMHooks.count.HP_stylist_init_pre > 0) { + void (*preHookFunc) (bool *minimal); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_stylist_init_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_stylist_init_pre[hIndex].func; + preHookFunc(&minimal); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.stylist.init(minimal); + } + if (HPMHooks.count.HP_stylist_init_post > 0) { + void (*postHookFunc) (bool minimal); + for (hIndex = 0; hIndex < HPMHooks.count.HP_stylist_init_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_stylist_init_post[hIndex].func; + postHookFunc(minimal); + } + } + return; +} +void HP_stylist_final(void) { + int hIndex = 0; + if (HPMHooks.count.HP_stylist_final_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_stylist_final_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_stylist_final_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.stylist.final(); + } + if (HPMHooks.count.HP_stylist_final_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_stylist_final_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_stylist_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_stylist_vector_init(void) { + int hIndex = 0; + if (HPMHooks.count.HP_stylist_vector_init_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_stylist_vector_init_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_stylist_vector_init_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.stylist.vector_init(); + } + if (HPMHooks.count.HP_stylist_vector_init_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_stylist_vector_init_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_stylist_vector_init_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_stylist_vector_clear(void) { + int hIndex = 0; + if (HPMHooks.count.HP_stylist_vector_clear_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_stylist_vector_clear_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_stylist_vector_clear_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.stylist.vector_clear(); + } + if (HPMHooks.count.HP_stylist_vector_clear_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_stylist_vector_clear_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_stylist_vector_clear_post[hIndex].func; + postHookFunc(); + } + } + return; +} +bool HP_stylist_read_db_libconfig(void) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_stylist_read_db_libconfig_pre > 0) { + bool (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_stylist_read_db_libconfig_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_stylist_read_db_libconfig_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.stylist.read_db_libconfig(); + } + if (HPMHooks.count.HP_stylist_read_db_libconfig_post > 0) { + bool (*postHookFunc) (bool retVal___); + for (hIndex = 0; hIndex < HPMHooks.count.HP_stylist_read_db_libconfig_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_stylist_read_db_libconfig_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +bool HP_stylist_read_db_libconfig_sub(struct config_setting_t *it, int idx, const char *source) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_stylist_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_stylist_read_db_libconfig_sub_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_stylist_read_db_libconfig_sub_pre[hIndex].func; + retVal___ = preHookFunc(&it, &idx, &source); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.stylist.read_db_libconfig_sub(it, idx, source); + } + if (HPMHooks.count.HP_stylist_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_stylist_read_db_libconfig_sub_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_stylist_read_db_libconfig_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, it, idx, source); + } + } + return retVal___; +} +void HP_stylist_request_style_change(struct map_session_data *sd, int type, int16 idx, bool isitem) { + int hIndex = 0; + if (HPMHooks.count.HP_stylist_request_style_change_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, int *type, int16 *idx, bool *isitem); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_stylist_request_style_change_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_stylist_request_style_change_pre[hIndex].func; + preHookFunc(&sd, &type, &idx, &isitem); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.stylist.request_style_change(sd, type, idx, isitem); + } + if (HPMHooks.count.HP_stylist_request_style_change_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, int type, int16 idx, bool isitem); + for (hIndex = 0; hIndex < HPMHooks.count.HP_stylist_request_style_change_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_stylist_request_style_change_post[hIndex].func; + postHookFunc(sd, type, idx, isitem); + } + } + return; +} +bool HP_stylist_validate_requirements(struct map_session_data *sd, int type, int16 idx) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_stylist_validate_requirements_pre > 0) { + bool (*preHookFunc) (struct map_session_data **sd, int *type, int16 *idx); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_stylist_validate_requirements_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_stylist_validate_requirements_pre[hIndex].func; + retVal___ = preHookFunc(&sd, &type, &idx); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.stylist.validate_requirements(sd, type, idx); + } + if (HPMHooks.count.HP_stylist_validate_requirements_post > 0) { + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int type, int16 idx); + for (hIndex = 0; hIndex < HPMHooks.count.HP_stylist_validate_requirements_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_stylist_validate_requirements_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, type, idx); + } + } + return retVal___; +} +void HP_stylist_send_rodexitem(struct map_session_data *sd, int itemid) { + int hIndex = 0; + if (HPMHooks.count.HP_stylist_send_rodexitem_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, int *itemid); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_stylist_send_rodexitem_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_stylist_send_rodexitem_pre[hIndex].func; + preHookFunc(&sd, &itemid); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.stylist.send_rodexitem(sd, itemid); + } + if (HPMHooks.count.HP_stylist_send_rodexitem_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, int itemid); + for (hIndex = 0; hIndex < HPMHooks.count.HP_stylist_send_rodexitem_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_stylist_send_rodexitem_post[hIndex].func; + postHookFunc(sd, itemid); + } + } + return; +} /* sv_interface */ int HP_sv_parse_next(struct s_svstate *svstate) { int hIndex = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_map.sources.inc b/src/plugins/HPMHooking/HPMHooking_map.sources.inc index 7a3c5b9a7..59ee43ab7 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.sources.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.sources.inc @@ -85,6 +85,7 @@ HPMHooks.source.status = *status; HPMHooks.source.storage = *storage; HPMHooks.source.StrBuf = *StrBuf; HPMHooks.source.strlib = *strlib; +HPMHooks.source.stylist = *stylist; HPMHooks.source.sv = *sv; HPMHooks.source.sysinfo = *sysinfo; HPMHooks.source.thread = *thread; |