From f4bd71bfc3b39c6a25b3050a05f4646d80820215 Mon Sep 17 00:00:00 2001 From: "Hercules.ws" Date: Sun, 4 Oct 2015 22:53:03 +0200 Subject: HPM Hooks Update Signed-off-by: HerculesWSAPI --- .../HPMHooking/HPMHooking_map.HPMHooksCore.inc | 4 ++++ .../HPMHooking/HPMHooking_map.HookingPoints.inc | 1 + src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 27 ++++++++++++++++++++++ 3 files changed, 32 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 408d7d0cd..2deb0f416 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -497,6 +497,8 @@ struct { struct HPMHookPoint *HP_clif_send_actual_post; struct HPMHookPoint *HP_clif_parse_pre; struct HPMHookPoint *HP_clif_parse_post; + struct HPMHookPoint *HP_clif_packet_pre; + struct HPMHookPoint *HP_clif_packet_post; struct HPMHookPoint *HP_clif_parse_cmd_pre; struct HPMHookPoint *HP_clif_parse_cmd_post; struct HPMHookPoint *HP_clif_decrypt_cmd_pre; @@ -6220,6 +6222,8 @@ struct { int HP_clif_send_actual_post; int HP_clif_parse_pre; int HP_clif_parse_post; + int HP_clif_packet_pre; + int HP_clif_packet_post; int HP_clif_parse_cmd_pre; int HP_clif_parse_cmd_post; int HP_clif_decrypt_cmd_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index d0d97192e..4a28fffb3 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -260,6 +260,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->send_sub, HP_clif_send_sub) }, { HP_POP(clif->send_actual, HP_clif_send_actual) }, { HP_POP(clif->parse, HP_clif_parse) }, + { HP_POP(clif->packet, HP_clif_packet) }, { HP_POP(clif->parse_cmd, HP_clif_parse_cmd) }, { HP_POP(clif->decrypt_cmd, HP_clif_decrypt_cmd) }, { HP_POP(clif->authok, HP_clif_authok) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 5602014eb..9c996f7dd 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -6672,6 +6672,33 @@ int HP_clif_parse(int fd) { } return retVal___; } +const struct s_packet_db* HP_clif_packet(int packet_id) { + int hIndex = 0; + const struct s_packet_db* retVal___ = NULL; + if( HPMHooks.count.HP_clif_packet_pre ) { + const struct s_packet_db* (*preHookFunc) (int *packet_id); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_packet_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_clif_packet_pre[hIndex].func; + retVal___ = preHookFunc(&packet_id); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clif.packet(packet_id); + } + if( HPMHooks.count.HP_clif_packet_post ) { + const struct s_packet_db* (*postHookFunc) (const struct s_packet_db* retVal___, int *packet_id); + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_packet_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_clif_packet_post[hIndex].func; + retVal___ = postHookFunc(retVal___, &packet_id); + } + } + return retVal___; +} unsigned short HP_clif_parse_cmd(int fd, struct map_session_data *sd) { int hIndex = 0; unsigned short retVal___ = 0; -- cgit v1.2.3-60-g2f50