diff options
author | Hercules.ws <dev@herc.ws> | 2017-04-13 16:12:21 +0200 |
---|---|---|
committer | HerculesWSAPI <dev@herc.ws> | 2017-04-13 16:12:21 +0200 |
commit | 494dd23baffec0c53d1bb3e4e474cad9366e7dbb (patch) | |
tree | 7ff0ba65fdfa34ad3d7c9e6843ba35abc2d16dbc /src/plugins | |
parent | 22694c649c7543a3ee6226c12151567852f219bb (diff) | |
download | hercules-494dd23baffec0c53d1bb3e4e474cad9366e7dbb.tar.gz hercules-494dd23baffec0c53d1bb3e4e474cad9366e7dbb.tar.bz2 hercules-494dd23baffec0c53d1bb3e4e474cad9366e7dbb.tar.xz hercules-494dd23baffec0c53d1bb3e4e474cad9366e7dbb.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 8 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc | 16 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 4 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 106 |
4 files changed, 134 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index cc9501d98..7042a43a7 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -5798,6 +5798,8 @@ typedef struct script_data* (*HPMHOOK_pre_script_get_val) (struct script_state * typedef struct script_data* (*HPMHOOK_post_script_get_val) (struct script_data* retVal___, struct script_state *st, struct script_data *data); typedef char* (*HPMHOOK_pre_script_get_val_ref_str) (struct script_state **st, struct reg_db **n, struct script_data **data); typedef char* (*HPMHOOK_post_script_get_val_ref_str) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); +typedef char* (*HPMHOOK_pre_script_get_val_pc_ref_str) (struct script_state **st, struct reg_db **n, struct script_data **data); +typedef char* (*HPMHOOK_post_script_get_val_pc_ref_str) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); typedef char* (*HPMHOOK_pre_script_get_val_scope_str) (struct script_state **st, struct reg_db **n, struct script_data **data); typedef char* (*HPMHOOK_post_script_get_val_scope_str) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); typedef char* (*HPMHOOK_pre_script_get_val_npc_str) (struct script_state **st, struct reg_db **n, struct script_data **data); @@ -5806,6 +5808,8 @@ typedef char* (*HPMHOOK_pre_script_get_val_instance_str) (struct script_state ** typedef char* (*HPMHOOK_post_script_get_val_instance_str) (char* retVal___, struct script_state *st, const char *name, struct script_data *data); typedef int (*HPMHOOK_pre_script_get_val_ref_num) (struct script_state **st, struct reg_db **n, struct script_data **data); typedef int (*HPMHOOK_post_script_get_val_ref_num) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); +typedef int (*HPMHOOK_pre_script_get_val_pc_ref_num) (struct script_state **st, struct reg_db **n, struct script_data **data); +typedef int (*HPMHOOK_post_script_get_val_pc_ref_num) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); typedef int (*HPMHOOK_pre_script_get_val_scope_num) (struct script_state **st, struct reg_db **n, struct script_data **data); typedef int (*HPMHOOK_post_script_get_val_scope_num) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); typedef int (*HPMHOOK_pre_script_get_val_npc_num) (struct script_state **st, struct reg_db **n, struct script_data **data); @@ -5960,6 +5964,8 @@ typedef int (*HPMHOOK_pre_script_set_reg) (struct script_state **st, struct map_ typedef int (*HPMHOOK_post_script_set_reg) (int retVal___, struct script_state *st, struct map_session_data *sd, int64 num, const char *name, const void *value, struct reg_db *ref); typedef void (*HPMHOOK_pre_script_set_reg_ref_str) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, const char **str); typedef void (*HPMHOOK_post_script_set_reg_ref_str) (struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str); +typedef void (*HPMHOOK_pre_script_set_reg_pc_ref_str) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, const char **str); +typedef void (*HPMHOOK_post_script_set_reg_pc_ref_str) (struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str); typedef void (*HPMHOOK_pre_script_set_reg_scope_str) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, const char **str); typedef void (*HPMHOOK_post_script_set_reg_scope_str) (struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str); typedef void (*HPMHOOK_pre_script_set_reg_npc_str) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, const char **str); @@ -5968,6 +5974,8 @@ typedef void (*HPMHOOK_pre_script_set_reg_instance_str) (struct script_state **s typedef void (*HPMHOOK_post_script_set_reg_instance_str) (struct script_state *st, int64 num, const char *name, const char *str); typedef void (*HPMHOOK_pre_script_set_reg_ref_num) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, int *val); typedef void (*HPMHOOK_post_script_set_reg_ref_num) (struct script_state *st, struct reg_db *n, int64 num, const char *name, int val); +typedef void (*HPMHOOK_pre_script_set_reg_pc_ref_num) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, int *val); +typedef void (*HPMHOOK_post_script_set_reg_pc_ref_num) (struct script_state *st, struct reg_db *n, int64 num, const char *name, int val); typedef void (*HPMHOOK_pre_script_set_reg_scope_num) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, int *val); typedef void (*HPMHOOK_post_script_set_reg_scope_num) (struct script_state *st, struct reg_db *n, int64 num, const char *name, int val); typedef void (*HPMHOOK_pre_script_set_reg_npc_num) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, int *val); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index cdd2386a6..762acb747 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -4594,6 +4594,8 @@ struct { struct HPMHookPoint *HP_script_get_val_post; struct HPMHookPoint *HP_script_get_val_ref_str_pre; struct HPMHookPoint *HP_script_get_val_ref_str_post; + struct HPMHookPoint *HP_script_get_val_pc_ref_str_pre; + struct HPMHookPoint *HP_script_get_val_pc_ref_str_post; struct HPMHookPoint *HP_script_get_val_scope_str_pre; struct HPMHookPoint *HP_script_get_val_scope_str_post; struct HPMHookPoint *HP_script_get_val_npc_str_pre; @@ -4602,6 +4604,8 @@ struct { struct HPMHookPoint *HP_script_get_val_instance_str_post; struct HPMHookPoint *HP_script_get_val_ref_num_pre; struct HPMHookPoint *HP_script_get_val_ref_num_post; + struct HPMHookPoint *HP_script_get_val_pc_ref_num_pre; + struct HPMHookPoint *HP_script_get_val_pc_ref_num_post; struct HPMHookPoint *HP_script_get_val_scope_num_pre; struct HPMHookPoint *HP_script_get_val_scope_num_post; struct HPMHookPoint *HP_script_get_val_npc_num_pre; @@ -4756,6 +4760,8 @@ struct { struct HPMHookPoint *HP_script_set_reg_post; struct HPMHookPoint *HP_script_set_reg_ref_str_pre; struct HPMHookPoint *HP_script_set_reg_ref_str_post; + struct HPMHookPoint *HP_script_set_reg_pc_ref_str_pre; + struct HPMHookPoint *HP_script_set_reg_pc_ref_str_post; struct HPMHookPoint *HP_script_set_reg_scope_str_pre; struct HPMHookPoint *HP_script_set_reg_scope_str_post; struct HPMHookPoint *HP_script_set_reg_npc_str_pre; @@ -4764,6 +4770,8 @@ struct { struct HPMHookPoint *HP_script_set_reg_instance_str_post; struct HPMHookPoint *HP_script_set_reg_ref_num_pre; struct HPMHookPoint *HP_script_set_reg_ref_num_post; + struct HPMHookPoint *HP_script_set_reg_pc_ref_num_pre; + struct HPMHookPoint *HP_script_set_reg_pc_ref_num_post; struct HPMHookPoint *HP_script_set_reg_scope_num_pre; struct HPMHookPoint *HP_script_set_reg_scope_num_post; struct HPMHookPoint *HP_script_set_reg_npc_num_pre; @@ -10641,6 +10649,8 @@ struct { int HP_script_get_val_post; int HP_script_get_val_ref_str_pre; int HP_script_get_val_ref_str_post; + int HP_script_get_val_pc_ref_str_pre; + int HP_script_get_val_pc_ref_str_post; int HP_script_get_val_scope_str_pre; int HP_script_get_val_scope_str_post; int HP_script_get_val_npc_str_pre; @@ -10649,6 +10659,8 @@ struct { int HP_script_get_val_instance_str_post; int HP_script_get_val_ref_num_pre; int HP_script_get_val_ref_num_post; + int HP_script_get_val_pc_ref_num_pre; + int HP_script_get_val_pc_ref_num_post; int HP_script_get_val_scope_num_pre; int HP_script_get_val_scope_num_post; int HP_script_get_val_npc_num_pre; @@ -10803,6 +10815,8 @@ struct { int HP_script_set_reg_post; int HP_script_set_reg_ref_str_pre; int HP_script_set_reg_ref_str_post; + int HP_script_set_reg_pc_ref_str_pre; + int HP_script_set_reg_pc_ref_str_post; int HP_script_set_reg_scope_str_pre; int HP_script_set_reg_scope_str_post; int HP_script_set_reg_npc_str_pre; @@ -10811,6 +10825,8 @@ struct { int HP_script_set_reg_instance_str_post; int HP_script_set_reg_ref_num_pre; int HP_script_set_reg_ref_num_post; + int HP_script_set_reg_pc_ref_num_pre; + int HP_script_set_reg_pc_ref_num_post; int HP_script_set_reg_scope_num_pre; int HP_script_set_reg_scope_num_post; int HP_script_set_reg_npc_num_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 9075901c4..65cd9ea82 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -2357,10 +2357,12 @@ struct HookingPointData HookingPoints[] = { { HP_POP(script->push_val, HP_script_push_val) }, { HP_POP(script->get_val, HP_script_get_val) }, { HP_POP(script->get_val_ref_str, HP_script_get_val_ref_str) }, + { HP_POP(script->get_val_pc_ref_str, HP_script_get_val_pc_ref_str) }, { HP_POP(script->get_val_scope_str, HP_script_get_val_scope_str) }, { HP_POP(script->get_val_npc_str, HP_script_get_val_npc_str) }, { HP_POP(script->get_val_instance_str, HP_script_get_val_instance_str) }, { HP_POP(script->get_val_ref_num, HP_script_get_val_ref_num) }, + { HP_POP(script->get_val_pc_ref_num, HP_script_get_val_pc_ref_num) }, { HP_POP(script->get_val_scope_num, HP_script_get_val_scope_num) }, { HP_POP(script->get_val_npc_num, HP_script_get_val_npc_num) }, { HP_POP(script->get_val_instance_num, HP_script_get_val_instance_num) }, @@ -2438,10 +2440,12 @@ struct HookingPointData HookingPoints[] = { { HP_POP(script->errorwarning_sub, HP_script_errorwarning_sub) }, { HP_POP(script->set_reg, HP_script_set_reg) }, { HP_POP(script->set_reg_ref_str, HP_script_set_reg_ref_str) }, + { HP_POP(script->set_reg_pc_ref_str, HP_script_set_reg_pc_ref_str) }, { HP_POP(script->set_reg_scope_str, HP_script_set_reg_scope_str) }, { HP_POP(script->set_reg_npc_str, HP_script_set_reg_npc_str) }, { HP_POP(script->set_reg_instance_str, HP_script_set_reg_instance_str) }, { HP_POP(script->set_reg_ref_num, HP_script_set_reg_ref_num) }, + { HP_POP(script->set_reg_pc_ref_num, HP_script_set_reg_pc_ref_num) }, { HP_POP(script->set_reg_scope_num, HP_script_set_reg_scope_num) }, { HP_POP(script->set_reg_npc_num, HP_script_set_reg_npc_num) }, { HP_POP(script->set_reg_instance_num, HP_script_set_reg_instance_num) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 322d60e46..3175bab5e 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -61250,6 +61250,33 @@ char* HP_script_get_val_ref_str(struct script_state *st, struct reg_db *n, struc } return retVal___; } +char* HP_script_get_val_pc_ref_str(struct script_state *st, struct reg_db *n, struct script_data *data) { + int hIndex = 0; + char* retVal___ = NULL; + if( HPMHooks.count.HP_script_get_val_pc_ref_str_pre ) { + char* (*preHookFunc) (struct script_state **st, struct reg_db **n, struct script_data **data); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_pc_ref_str_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_get_val_pc_ref_str_pre[hIndex].func; + retVal___ = preHookFunc(&st, &n, &data); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.script.get_val_pc_ref_str(st, n, data); + } + if( HPMHooks.count.HP_script_get_val_pc_ref_str_post ) { + char* (*postHookFunc) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_pc_ref_str_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_get_val_pc_ref_str_post[hIndex].func; + retVal___ = postHookFunc(retVal___, st, n, data); + } + } + return retVal___; +} char* HP_script_get_val_scope_str(struct script_state *st, struct reg_db *n, struct script_data *data) { int hIndex = 0; char* retVal___ = NULL; @@ -61358,6 +61385,33 @@ int HP_script_get_val_ref_num(struct script_state *st, struct reg_db *n, struct } return retVal___; } +int HP_script_get_val_pc_ref_num(struct script_state *st, struct reg_db *n, struct script_data *data) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_script_get_val_pc_ref_num_pre ) { + int (*preHookFunc) (struct script_state **st, struct reg_db **n, struct script_data **data); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_pc_ref_num_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_get_val_pc_ref_num_pre[hIndex].func; + retVal___ = preHookFunc(&st, &n, &data); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.script.get_val_pc_ref_num(st, n, data); + } + if( HPMHooks.count.HP_script_get_val_pc_ref_num_post ) { + int (*postHookFunc) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_pc_ref_num_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_get_val_pc_ref_num_post[hIndex].func; + retVal___ = postHookFunc(retVal___, st, n, data); + } + } + return retVal___; +} int HP_script_get_val_scope_num(struct script_state *st, struct reg_db *n, struct script_data *data) { int hIndex = 0; int retVal___ = 0; @@ -63402,6 +63456,32 @@ void HP_script_set_reg_ref_str(struct script_state *st, struct reg_db *n, int64 } return; } +void HP_script_set_reg_pc_ref_str(struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str) { + int hIndex = 0; + if( HPMHooks.count.HP_script_set_reg_pc_ref_str_pre ) { + void (*preHookFunc) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, const char **str); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_pc_ref_str_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_set_reg_pc_ref_str_pre[hIndex].func; + preHookFunc(&st, &n, &num, &name, &str); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.set_reg_pc_ref_str(st, n, num, name, str); + } + if( HPMHooks.count.HP_script_set_reg_pc_ref_str_post ) { + void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_pc_ref_str_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_set_reg_pc_ref_str_post[hIndex].func; + postHookFunc(st, n, num, name, str); + } + } + return; +} void HP_script_set_reg_scope_str(struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str) { int hIndex = 0; if( HPMHooks.count.HP_script_set_reg_scope_str_pre ) { @@ -63506,6 +63586,32 @@ void HP_script_set_reg_ref_num(struct script_state *st, struct reg_db *n, int64 } return; } +void HP_script_set_reg_pc_ref_num(struct script_state *st, struct reg_db *n, int64 num, const char *name, int val) { + int hIndex = 0; + if( HPMHooks.count.HP_script_set_reg_pc_ref_num_pre ) { + void (*preHookFunc) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, int *val); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_pc_ref_num_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_set_reg_pc_ref_num_pre[hIndex].func; + preHookFunc(&st, &n, &num, &name, &val); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.set_reg_pc_ref_num(st, n, num, name, val); + } + if( HPMHooks.count.HP_script_set_reg_pc_ref_num_post ) { + void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 num, const char *name, int val); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_pc_ref_num_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_set_reg_pc_ref_num_post[hIndex].func; + postHookFunc(st, n, num, name, val); + } + } + return; +} void HP_script_set_reg_scope_num(struct script_state *st, struct reg_db *n, int64 num, const char *name, int val) { int hIndex = 0; if( HPMHooks.count.HP_script_set_reg_scope_num_pre ) { |