diff options
author | Hercules.ws <Hercules@efficiently.awesome> | 2014-03-18 19:01:07 +0100 |
---|---|---|
committer | HerculesWSAPI <Hercules@efficiently.awesome> | 2014-03-18 19:01:07 +0100 |
commit | 68b16d11c5f3cdf67a58154dbf22ad3da60a6f9f (patch) | |
tree | 1e638099981549b0a63c667ee3e0debfab844a19 /src/plugins | |
parent | 7b71f22331c805a406c57f5a8eff93b464b57018 (diff) | |
download | hercules-68b16d11c5f3cdf67a58154dbf22ad3da60a6f9f.tar.gz hercules-68b16d11c5f3cdf67a58154dbf22ad3da60a6f9f.tar.bz2 hercules-68b16d11c5f3cdf67a58154dbf22ad3da60a6f9f.tar.xz hercules-68b16d11c5f3cdf67a58154dbf22ad3da60a6f9f.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc | 8 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.HookingPoints.inc | 2 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Hooks.inc | 59 |
3 files changed, 66 insertions, 3 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc index 4f37743f6..0f1a72d01 100644 --- a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc @@ -219,6 +219,10 @@ struct { struct HPMHookPoint *HP_bg_send_xy_timer_sub_post; struct HPMHookPoint *HP_bg_send_xy_timer_pre; struct HPMHookPoint *HP_bg_send_xy_timer_post; + struct HPMHookPoint *HP_bg_afk_timer_pre; + struct HPMHookPoint *HP_bg_afk_timer_post; + struct HPMHookPoint *HP_bg_str2teamtype_pre; + struct HPMHookPoint *HP_bg_str2teamtype_post; struct HPMHookPoint *HP_bg_config_read_pre; struct HPMHookPoint *HP_bg_config_read_post; struct HPMHookPoint *HP_buyingstore_setup_pre; @@ -5252,6 +5256,10 @@ struct { int HP_bg_send_xy_timer_sub_post; int HP_bg_send_xy_timer_pre; int HP_bg_send_xy_timer_post; + int HP_bg_afk_timer_pre; + int HP_bg_afk_timer_post; + int HP_bg_str2teamtype_pre; + int HP_bg_str2teamtype_post; int HP_bg_config_read_pre; int HP_bg_config_read_post; int HP_buyingstore_setup_pre; diff --git a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc index dd8c603d3..d6a6a4af2 100644 --- a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc @@ -115,6 +115,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(bg->send_message, HP_bg_send_message) }, { HP_POP(bg->send_xy_timer_sub, HP_bg_send_xy_timer_sub) }, { HP_POP(bg->send_xy_timer, HP_bg_send_xy_timer) }, + { HP_POP(bg->afk_timer, HP_bg_afk_timer) }, + { HP_POP(bg->str2teamtype, HP_bg_str2teamtype) }, { HP_POP(bg->config_read, HP_bg_config_read) }, /* buyingstore */ { HP_POP(buyingstore->setup, HP_buyingstore_setup) }, diff --git a/src/plugins/HPMHooking/HPMHooking.Hooks.inc b/src/plugins/HPMHooking/HPMHooking.Hooks.inc index 396b241b0..ed3e505b9 100644 --- a/src/plugins/HPMHooking/HPMHooking.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking.Hooks.inc @@ -2648,11 +2648,11 @@ bool HP_bg_team_join(int bg_id, struct map_session_data *sd) { } return retVal___; } -int HP_bg_team_leave(struct map_session_data *sd, int flag) { +int HP_bg_team_leave(struct map_session_data *sd, enum bg_team_leave_type flag) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_bg_team_leave_pre ) { - int (*preHookFunc) (struct map_session_data *sd, int *flag); + int (*preHookFunc) (struct map_session_data *sd, enum bg_team_leave_type *flag); for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_leave_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_bg_team_leave_pre[hIndex].func; retVal___ = preHookFunc(sd, &flag); @@ -2666,7 +2666,7 @@ int HP_bg_team_leave(struct map_session_data *sd, int flag) { retVal___ = HPMHooks.source.bg.team_leave(sd, flag); } if( HPMHooks.count.HP_bg_team_leave_post ) { - int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *flag); + int (*postHookFunc) (int retVal___, struct map_session_data *sd, enum bg_team_leave_type *flag); for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_leave_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_bg_team_leave_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd, &flag); @@ -2836,6 +2836,59 @@ int HP_bg_send_xy_timer(int tid, int64 tick, int id, intptr_t data) { } return retVal___; } +int HP_bg_afk_timer(int tid, int64 tick, int id, intptr_t data) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_bg_afk_timer_pre ) { + int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data); + for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_afk_timer_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_bg_afk_timer_pre[hIndex].func; + retVal___ = preHookFunc(&tid, &tick, &id, &data); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.bg.afk_timer(tid, tick, id, data); + } + if( HPMHooks.count.HP_bg_afk_timer_post ) { + int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data); + for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_afk_timer_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_bg_afk_timer_post[hIndex].func; + retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data); + } + } + return retVal___; +} +enum bg_queue_types HP_bg_str2teamtype(const char *str) { +/* Unknown return type 'enum bg_queue_types'. Initializing to '0'. */ + int hIndex = 0; + enum bg_queue_types retVal___ = 0; + if( HPMHooks.count.HP_bg_str2teamtype_pre ) { + enum bg_queue_types (*preHookFunc) (const char *str); + for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_str2teamtype_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_bg_str2teamtype_pre[hIndex].func; + retVal___ = preHookFunc(str); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.bg.str2teamtype(str); + } + if( HPMHooks.count.HP_bg_str2teamtype_post ) { + enum bg_queue_types (*postHookFunc) (enum bg_queue_types retVal___, const char *str); + for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_str2teamtype_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_bg_str2teamtype_post[hIndex].func; + retVal___ = postHookFunc(retVal___, str); + } + } + return retVal___; +} void HP_bg_config_read(void) { int hIndex = 0; if( HPMHooks.count.HP_bg_config_read_pre ) { |