From 3c84a4df688a63577236d02b4d972775964f71ca Mon Sep 17 00:00:00 2001 From: Haru Date: Mon, 7 Sep 2015 01:39:50 +0200 Subject: HPM Hooks Update --- src/plugins/HPMHooking/HPMHooking_char.Hooks.inc | 179 ++++++++++++++++++----- 1 file changed, 144 insertions(+), 35 deletions(-) (limited to 'src/plugins/HPMHooking/HPMHooking_char.Hooks.inc') diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc index 1676f1a2b..3669b2da8 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc @@ -4216,31 +4216,113 @@ int HP_chr_online_data_cleanup(int tid, int64 tick, int id, intptr_t data) { } return retVal___; } -void HP_chr_sql_config_read(const char *cfgName) { +bool HP_chr_sql_config_read(const char *filename, bool imported) { int hIndex = 0; + bool retVal___ = false; if( HPMHooks.count.HP_chr_sql_config_read_pre ) { - void (*preHookFunc) (const char **cfgName); + bool (*preHookFunc) (const char **filename, bool *imported); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_chr_sql_config_read_pre[hIndex].func; - preHookFunc(&cfgName); + retVal___ = preHookFunc(&filename, &imported); } if( *HPMforce_return ) { *HPMforce_return = false; - return; + return retVal___; } } { - HPMHooks.source.chr.sql_config_read(cfgName); + retVal___ = HPMHooks.source.chr.sql_config_read(filename, imported); } if( HPMHooks.count.HP_chr_sql_config_read_post ) { - void (*postHookFunc) (const char *cfgName); + bool (*postHookFunc) (bool retVal___, const char *filename, bool imported); for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_chr_sql_config_read_post[hIndex].func; - postHookFunc(cfgName); + retVal___ = postHookFunc(retVal___, filename, imported); } } - return; + return retVal___; +} +bool HP_chr_sql_config_read_registry(const char *filename, const struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_chr_sql_config_read_registry_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_registry_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chr_sql_config_read_registry_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.chr.sql_config_read_registry(filename, config, imported); + } + if( HPMHooks.count.HP_chr_sql_config_read_registry_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_registry_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chr_sql_config_read_registry_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +bool HP_chr_sql_config_read_pc(const char *filename, const struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_chr_sql_config_read_pc_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_pc_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chr_sql_config_read_pc_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.chr.sql_config_read_pc(filename, config, imported); + } + if( HPMHooks.count.HP_chr_sql_config_read_pc_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_pc_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chr_sql_config_read_pc_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +bool HP_chr_sql_config_read_guild(const char *filename, const struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_chr_sql_config_read_guild_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_guild_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chr_sql_config_read_guild_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.chr.sql_config_read_guild(filename, config, imported); + } + if( HPMHooks.count.HP_chr_sql_config_read_guild_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_guild_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chr_sql_config_read_guild_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; } bool HP_chr_config_read(const char *filename, bool imported) { int hIndex = 0; @@ -6724,33 +6806,6 @@ int HP_inter_accreg_fromsql(int account_id, int char_id, int fd, int type) { } return retVal___; } -int HP_inter_config_read(const char *cfgName) { - int hIndex = 0; - int retVal___ = 0; - if( HPMHooks.count.HP_inter_config_read_pre ) { - int (*preHookFunc) (const char **cfgName); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_inter_config_read_pre[hIndex].func; - retVal___ = preHookFunc(&cfgName); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.inter.config_read(cfgName); - } - if( HPMHooks.count.HP_inter_config_read_post ) { - int (*postHookFunc) (int retVal___, const char *cfgName); - for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_inter_config_read_post[hIndex].func; - retVal___ = postHookFunc(retVal___, cfgName); - } - } - return retVal___; -} int HP_inter_vlog(char *fmt, va_list ap) { int hIndex = 0; int retVal___ = 0; @@ -6978,6 +7033,60 @@ void HP_inter_final(void) { } return; } +bool HP_inter_config_read(const char *filename, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_inter_config_read_pre ) { + bool (*preHookFunc) (const char **filename, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_inter_config_read_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.inter.config_read(filename, imported); + } + if( HPMHooks.count.HP_inter_config_read_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_inter_config_read_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, imported); + } + } + return retVal___; +} +bool HP_inter_config_read_connection(const char *filename, const struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_inter_config_read_connection_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_connection_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_inter_config_read_connection_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.inter.config_read_connection(filename, config, imported); + } + if( HPMHooks.count.HP_inter_config_read_connection_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_connection_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_inter_config_read_connection_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} /* inter_mail_interface */ int HP_inter_mail_sql_init(void) { int hIndex = 0; -- cgit v1.2.3-60-g2f50