Skip to content

Commit

Permalink
HPM Hooks Update
Browse files Browse the repository at this point in the history
Signed-off-by: Kei <[email protected]>
  • Loading branch information
MrKeiKun committed Jun 2, 2022
1 parent ec2ed1d commit 9256a62
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 43 deletions.
4 changes: 2 additions & 2 deletions src/common/HPMDataCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
#endif // CHAR_INT_MERCENARY_H
#ifdef CHAR_INT_PARTY_H
{ "inter_party_interface", sizeof(struct inter_party_interface), SERVER_TYPE_CHAR },
{ "party_data", sizeof(struct party_data), SERVER_TYPE_CHAR },
#else
#define CHAR_INT_PARTY_H
#endif // CHAR_INT_PARTY_H
Expand Down Expand Up @@ -855,7 +856,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "packet_item_drop_announce", sizeof(struct packet_item_drop_announce), SERVER_TYPE_MAP },
{ "packet_itemlist_equip", sizeof(struct packet_itemlist_equip), SERVER_TYPE_MAP },
{ "packet_itemlist_normal", sizeof(struct packet_itemlist_normal), SERVER_TYPE_MAP },
{ "packet_maptypeproperty2", sizeof(struct packet_maptypeproperty2), SERVER_TYPE_MAP },
{ "packet_maptypeproperty", sizeof(struct packet_maptypeproperty), SERVER_TYPE_MAP },
{ "packet_mission_info_sub", sizeof(struct packet_mission_info_sub), SERVER_TYPE_MAP },
{ "packet_monster_hp", sizeof(struct packet_monster_hp), SERVER_TYPE_MAP },
{ "packet_notify_bounditem", sizeof(struct packet_notify_bounditem), SERVER_TYPE_MAP },
Expand Down Expand Up @@ -894,7 +895,6 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
#ifdef MAP_PARTY_H
{ "party_booking_ad_info", sizeof(struct party_booking_ad_info), SERVER_TYPE_MAP },
{ "party_booking_detail", sizeof(struct party_booking_detail), SERVER_TYPE_MAP },
{ "party_data", sizeof(struct party_data), SERVER_TYPE_MAP },
{ "party_interface", sizeof(struct party_interface), SERVER_TYPE_MAP },
{ "party_member_data", sizeof(struct party_member_data), SERVER_TYPE_MAP },
#else
Expand Down
6 changes: 2 additions & 4 deletions src/plugins/HPMHooking/HPMHooking.Defs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1230,8 +1230,8 @@ typedef void (*HPMHOOK_pre_clif_changemap_airship) (struct map_session_data **sd
typedef void (*HPMHOOK_post_clif_changemap_airship) (struct map_session_data *sd, short m, int x, int y);
typedef void (*HPMHOOK_pre_clif_changemapcell) (int *fd, int16 *m, int *x, int *y, int *type, enum send_target *target);
typedef void (*HPMHOOK_post_clif_changemapcell) (int fd, int16 m, int x, int y, int type, enum send_target target);
typedef void (*HPMHOOK_pre_clif_map_property) (struct map_session_data **sd, enum map_property *property);
typedef void (*HPMHOOK_post_clif_map_property) (struct map_session_data *sd, enum map_property property);
typedef void (*HPMHOOK_pre_clif_map_property) (struct block_list **bl, enum map_property *property, enum send_target *target);
typedef void (*HPMHOOK_post_clif_map_property) (struct block_list *bl, enum map_property property, enum send_target target);
typedef void (*HPMHOOK_pre_clif_pvpset) (struct map_session_data **sd, int *pvprank, int *pvpnum, int *type);
typedef void (*HPMHOOK_post_clif_pvpset) (struct map_session_data *sd, int pvprank, int pvpnum, int type);
typedef void (*HPMHOOK_pre_clif_map_property_mapall) (int *mapid, enum map_property *property);
Expand All @@ -1240,8 +1240,6 @@ typedef void (*HPMHOOK_pre_clif_bossmapinfo) (int *fd, struct mob_data **md, enu
typedef void (*HPMHOOK_post_clif_bossmapinfo) (int fd, struct mob_data *md, enum bossmap_info_type flag);
typedef void (*HPMHOOK_pre_clif_map_type) (struct map_session_data **sd, enum map_type *type);
typedef void (*HPMHOOK_post_clif_map_type) (struct map_session_data *sd, enum map_type type);
typedef void (*HPMHOOK_pre_clif_maptypeproperty2) (struct block_list **bl, enum send_target *t);
typedef void (*HPMHOOK_post_clif_maptypeproperty2) (struct block_list *bl, enum send_target t);
typedef void (*HPMHOOK_pre_clif_crimson_marker) (struct map_session_data **sd, struct block_list **bl, bool *remove);
typedef void (*HPMHOOK_post_clif_crimson_marker) (struct map_session_data *sd, struct block_list *bl, bool remove);
typedef void (*HPMHOOK_pre_clif_changemapserver) (struct map_session_data **sd, unsigned short *map_index, int *x, int *y, uint32 *ip, uint16 *port, char **dnsHost);
Expand Down
4 changes: 0 additions & 4 deletions src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
Original file line number Diff line number Diff line change
Expand Up @@ -828,8 +828,6 @@ struct {
struct HPMHookPoint *HP_clif_bossmapinfo_post;
struct HPMHookPoint *HP_clif_map_type_pre;
struct HPMHookPoint *HP_clif_map_type_post;
struct HPMHookPoint *HP_clif_maptypeproperty2_pre;
struct HPMHookPoint *HP_clif_maptypeproperty2_post;
struct HPMHookPoint *HP_clif_crimson_marker_pre;
struct HPMHookPoint *HP_clif_crimson_marker_post;
struct HPMHookPoint *HP_clif_changemapserver_pre;
Expand Down Expand Up @@ -8159,8 +8157,6 @@ struct {
int HP_clif_bossmapinfo_post;
int HP_clif_map_type_pre;
int HP_clif_map_type_post;
int HP_clif_maptypeproperty2_pre;
int HP_clif_maptypeproperty2_post;
int HP_clif_crimson_marker_pre;
int HP_clif_crimson_marker_post;
int HP_clif_changemapserver_pre;
Expand Down
1 change: 0 additions & 1 deletion src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,6 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->map_property_mapall, HP_clif_map_property_mapall) },
{ HP_POP(clif->bossmapinfo, HP_clif_bossmapinfo) },
{ HP_POP(clif->map_type, HP_clif_map_type) },
{ HP_POP(clif->maptypeproperty2, HP_clif_maptypeproperty2) },
{ HP_POP(clif->crimson_marker, HP_clif_crimson_marker) },
{ HP_POP(clif->changemapserver, HP_clif_changemapserver) },
{ HP_POP(clif->changemapserver_airship, HP_clif_changemapserver_airship) },
Expand Down
38 changes: 6 additions & 32 deletions src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
Original file line number Diff line number Diff line change
Expand Up @@ -10654,28 +10654,28 @@ void HP_clif_changemapcell(int fd, int16 m, int x, int y, int type, enum send_ta
}
return;
}
void HP_clif_map_property(struct map_session_data *sd, enum map_property property) {
void HP_clif_map_property(struct block_list *bl, enum map_property property, enum send_target target) {
int hIndex = 0;
if (HPMHooks.count.HP_clif_map_property_pre > 0) {
void (*preHookFunc) (struct map_session_data **sd, enum map_property *property);
void (*preHookFunc) (struct block_list **bl, enum map_property *property, enum send_target *target);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_map_property_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_map_property_pre[hIndex].func;
preHookFunc(&sd, &property);
preHookFunc(&bl, &property, &target);
}
if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
HPMHooks.source.clif.map_property(sd, property);
HPMHooks.source.clif.map_property(bl, property, target);
}
if (HPMHooks.count.HP_clif_map_property_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, enum map_property property);
void (*postHookFunc) (struct block_list *bl, enum map_property property, enum send_target target);
for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_map_property_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_map_property_post[hIndex].func;
postHookFunc(sd, property);
postHookFunc(bl, property, target);
}
}
return;
Expand Down Expand Up @@ -10784,32 +10784,6 @@ void HP_clif_map_type(struct map_session_data *sd, enum map_type type) {
}
return;
}
void HP_clif_maptypeproperty2(struct block_list *bl, enum send_target t) {
int hIndex = 0;
if (HPMHooks.count.HP_clif_maptypeproperty2_pre > 0) {
void (*preHookFunc) (struct block_list **bl, enum send_target *t);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_maptypeproperty2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_maptypeproperty2_pre[hIndex].func;
preHookFunc(&bl, &t);
}
if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
HPMHooks.source.clif.maptypeproperty2(bl, t);
}
if (HPMHooks.count.HP_clif_maptypeproperty2_post > 0) {
void (*postHookFunc) (struct block_list *bl, enum send_target t);
for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_maptypeproperty2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_maptypeproperty2_post[hIndex].func;
postHookFunc(bl, t);
}
}
return;
}
void HP_clif_crimson_marker(struct map_session_data *sd, struct block_list *bl, bool remove) {
int hIndex = 0;
if (HPMHooks.count.HP_clif_crimson_marker_pre > 0) {
Expand Down

0 comments on commit 9256a62

Please sign in to comment.