Skip to content

Commit

Permalink
Update HPM Hooks
Browse files Browse the repository at this point in the history
Signed-off-by: Haru <[email protected]>
  • Loading branch information
MishimaHaruna committed Jun 2, 2022
1 parent 8ea7b89 commit 6037840
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/common/HPMDataCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
#define MAP_NPC_H
#endif // MAP_NPC_H
#ifdef MAP_PACKETS_STRUCT_H
{ "CZ_PURCHASE_ITEM_FROMMC", sizeof(struct CZ_PURCHASE_ITEM_FROMMC), SERVER_TYPE_MAP },
{ "EQUIPITEM_INFO", sizeof(struct EQUIPITEM_INFO), SERVER_TYPE_MAP },
{ "EQUIPSLOTINFO", sizeof(struct EQUIPSLOTINFO), SERVER_TYPE_MAP },
{ "GUILD_MEMBER_INFO", sizeof(struct GUILD_MEMBER_INFO), SERVER_TYPE_MAP },
Expand All @@ -657,6 +658,8 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "PACKET_CZ_PC_BUY_CASH_POINT_ITEM", sizeof(struct PACKET_CZ_PC_BUY_CASH_POINT_ITEM), SERVER_TYPE_MAP },
{ "PACKET_CZ_PC_BUY_CASH_POINT_ITEM_sub", sizeof(struct PACKET_CZ_PC_BUY_CASH_POINT_ITEM_sub), SERVER_TYPE_MAP },
{ "PACKET_CZ_PC_PURCHASE_ITEMLIST", sizeof(struct PACKET_CZ_PC_PURCHASE_ITEMLIST), SERVER_TYPE_MAP },
{ "PACKET_CZ_PC_PURCHASE_ITEMLIST_FROMMC", sizeof(struct PACKET_CZ_PC_PURCHASE_ITEMLIST_FROMMC), SERVER_TYPE_MAP },
{ "PACKET_CZ_PC_PURCHASE_ITEMLIST_FROMMC2", sizeof(struct PACKET_CZ_PC_PURCHASE_ITEMLIST_FROMMC2), SERVER_TYPE_MAP },
{ "PACKET_CZ_PC_PURCHASE_ITEMLIST_sub", sizeof(struct PACKET_CZ_PC_PURCHASE_ITEMLIST_sub), SERVER_TYPE_MAP },
{ "PACKET_CZ_PET_EVOLUTION", sizeof(struct PACKET_CZ_PET_EVOLUTION), SERVER_TYPE_MAP },
{ "PACKET_CZ_PRIVATE_AIRSHIP_REQUEST", sizeof(struct PACKET_CZ_PRIVATE_AIRSHIP_REQUEST), SERVER_TYPE_MAP },
Expand Down Expand Up @@ -798,6 +801,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "PACKET_ZC_STATE_CHANGE", sizeof(struct PACKET_ZC_STATE_CHANGE), SERVER_TYPE_MAP },
{ "PACKET_ZC_STATUS_CHANGE", sizeof(struct PACKET_ZC_STATUS_CHANGE), SERVER_TYPE_MAP },
{ "PACKET_ZC_STATUS_CHANGE_ACK", sizeof(struct PACKET_ZC_STATUS_CHANGE_ACK), SERVER_TYPE_MAP },
{ "PACKET_ZC_STORE_ENTRY", sizeof(struct PACKET_ZC_STORE_ENTRY), SERVER_TYPE_MAP },
{ "PACKET_ZC_STYLE_CHANGE_RES", sizeof(struct PACKET_ZC_STYLE_CHANGE_RES), SERVER_TYPE_MAP },
{ "PACKET_ZC_TALKBOX_CHATCONTENTS", sizeof(struct PACKET_ZC_TALKBOX_CHATCONTENTS), SERVER_TYPE_MAP },
{ "PACKET_ZC_TRYCAPTURE_MONSTER", sizeof(struct PACKET_ZC_TRYCAPTURE_MONSTER), SERVER_TYPE_MAP },
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/HPMHooking/HPMHooking.Defs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8856,8 +8856,8 @@ typedef void (*HPMHOOK_pre_vending_open) (struct map_session_data **sd, const ch
typedef void (*HPMHOOK_post_vending_open) (struct map_session_data *sd, const char *message, const uint8 *data, int count);
typedef void (*HPMHOOK_pre_vending_list) (struct map_session_data **sd, unsigned int *id);
typedef void (*HPMHOOK_post_vending_list) (struct map_session_data *sd, unsigned int id);
typedef void (*HPMHOOK_pre_vending_purchase) (struct map_session_data **sd, int *aid, unsigned int *uid, const uint8 **data, int *count);
typedef void (*HPMHOOK_post_vending_purchase) (struct map_session_data *sd, int aid, unsigned int uid, const uint8 *data, int count);
typedef void (*HPMHOOK_pre_vending_purchase) (struct map_session_data **sd, int *aid, unsigned int *uid, const struct CZ_PURCHASE_ITEM_FROMMC **data, int *count);
typedef void (*HPMHOOK_post_vending_purchase) (struct map_session_data *sd, int aid, unsigned int uid, const struct CZ_PURCHASE_ITEM_FROMMC *data, int count);
typedef bool (*HPMHOOK_pre_vending_search) (struct map_session_data **sd, int *nameid);
typedef bool (*HPMHOOK_post_vending_search) (bool retVal___, struct map_session_data *sd, int nameid);
typedef bool (*HPMHOOK_pre_vending_searchall) (struct map_session_data **sd, const struct s_search_store_search **s);
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
Original file line number Diff line number Diff line change
Expand Up @@ -98219,10 +98219,10 @@ void HP_vending_list(struct map_session_data *sd, unsigned int id) {
}
return;
}
void HP_vending_purchase(struct map_session_data *sd, int aid, unsigned int uid, const uint8 *data, int count) {
void HP_vending_purchase(struct map_session_data *sd, int aid, unsigned int uid, const struct CZ_PURCHASE_ITEM_FROMMC *data, int count) {
int hIndex = 0;
if (HPMHooks.count.HP_vending_purchase_pre > 0) {
void (*preHookFunc) (struct map_session_data **sd, int *aid, unsigned int *uid, const uint8 **data, int *count);
void (*preHookFunc) (struct map_session_data **sd, int *aid, unsigned int *uid, const struct CZ_PURCHASE_ITEM_FROMMC **data, int *count);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_vending_purchase_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_vending_purchase_pre[hIndex].func;
Expand All @@ -98237,7 +98237,7 @@ void HP_vending_purchase(struct map_session_data *sd, int aid, unsigned int uid,
HPMHooks.source.vending.purchase(sd, aid, uid, data, count);
}
if (HPMHooks.count.HP_vending_purchase_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, int aid, unsigned int uid, const uint8 *data, int count);
void (*postHookFunc) (struct map_session_data *sd, int aid, unsigned int uid, const struct CZ_PURCHASE_ITEM_FROMMC *data, int count);
for (hIndex = 0; hIndex < HPMHooks.count.HP_vending_purchase_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_vending_purchase_post[hIndex].func;
postHookFunc(sd, aid, uid, data, count);
Expand Down

0 comments on commit 6037840

Please sign in to comment.