diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/HPMHooking.c | 6 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 244 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc | 143 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc | 41 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_char.Hooks.inc | 905 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_char.sources.inc | 7 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc | 143 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc | 41 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_login.Hooks.inc | 905 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_login.sources.inc | 7 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc | 364 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 97 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 2332 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.sources.inc | 8 | ||||
-rw-r--r-- | src/plugins/constdb2doc.c | 3 | ||||
-rw-r--r-- | src/plugins/db2sql.c | 30 | ||||
-rw-r--r-- | src/plugins/generate-translations.c | 277 |
17 files changed, 5334 insertions, 219 deletions
diff --git a/src/plugins/HPMHooking.c b/src/plugins/HPMHooking.c index 4fb7911c2..0b98ea99f 100644 --- a/src/plugins/HPMHooking.c +++ b/src/plugins/HPMHooking.c @@ -97,6 +97,7 @@ #include "map/storage.h" #include "map/trade.h" #include "map/unit.h" +#include "common/grfio.h" #include "common/mapindex.h" #else #define HPM_SERVER_TYPE SERVER_TYPE_UNKNOWN @@ -109,13 +110,18 @@ #include "common/conf.h" #include "common/console.h" #include "common/db.h" +#include "common/des.h" +#include "common/md5calc.h" #include "common/memmgr.h" +#include "common/mutex.h" #include "common/nullpo.h" +#include "common/random.h" #include "common/showmsg.h" #include "common/socket.h" #include "common/sql.h" #include "common/strlib.h" #include "common/sysinfo.h" +#include "common/thread.h" #include "common/timer.h" #include "common/utils.h" diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 4510bc3df..f10e868b7 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -23,6 +23,8 @@ * as it will get overwritten. */ +/* GENERATED FILE DO NOT EDIT */ + #ifdef COMMON_UTILS_H /* HCache */ typedef void (*HPMHOOK_pre_HCache_init) (void); typedef void (*HPMHOOK_post_HCache_init) (void); @@ -112,12 +114,16 @@ typedef struct Damage (*HPMHOOK_pre_battle_calc_attack) (int *attack_type, struc typedef struct Damage (*HPMHOOK_post_battle_calc_attack) (struct Damage retVal___, int attack_type, struct block_list *bl, struct block_list *target, uint16 skill_id, uint16 skill_lv, int count); typedef int64 (*HPMHOOK_pre_battle_calc_damage) (struct block_list **src, struct block_list **bl, struct Damage **d, int64 *damage, uint16 *skill_id, uint16 *skill_lv); typedef int64 (*HPMHOOK_post_battle_calc_damage) (int64 retVal___, struct block_list *src, struct block_list *bl, struct Damage *d, int64 damage, uint16 skill_id, uint16 skill_lv); +typedef int64 (*HPMHOOK_pre_battle_calc_pc_damage) (struct block_list **src, struct block_list **bl, struct Damage **d, int64 *damage, uint16 *skill_id, uint16 *skill_lv); +typedef int64 (*HPMHOOK_post_battle_calc_pc_damage) (int64 retVal___, struct block_list *src, struct block_list *bl, struct Damage *d, int64 damage, uint16 skill_id, uint16 skill_lv); typedef int64 (*HPMHOOK_pre_battle_calc_gvg_damage) (struct block_list **src, struct block_list **bl, int64 *damage, int *div_, uint16 *skill_id, uint16 *skill_lv, int *flag); typedef int64 (*HPMHOOK_post_battle_calc_gvg_damage) (int64 retVal___, struct block_list *src, struct block_list *bl, int64 damage, int div_, uint16 skill_id, uint16 skill_lv, int flag); typedef int64 (*HPMHOOK_pre_battle_calc_bg_damage) (struct block_list **src, struct block_list **bl, int64 *damage, int *div_, uint16 *skill_id, uint16 *skill_lv, int *flag); typedef int64 (*HPMHOOK_post_battle_calc_bg_damage) (int64 retVal___, struct block_list *src, struct block_list *bl, int64 damage, int div_, uint16 skill_id, uint16 skill_lv, int flag); typedef enum damage_lv (*HPMHOOK_pre_battle_weapon_attack) (struct block_list **bl, struct block_list **target, int64 *tick, int *flag); typedef enum damage_lv (*HPMHOOK_post_battle_weapon_attack) (enum damage_lv retVal___, struct block_list *bl, struct block_list *target, int64 tick, int flag); +typedef bool (*HPMHOOK_pre_battle_check_arrows) (struct map_session_data **sd); +typedef bool (*HPMHOOK_post_battle_check_arrows) (bool retVal___, struct map_session_data *sd); typedef struct Damage (*HPMHOOK_pre_battle_calc_weapon_attack) (struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, int *wflag); typedef struct Damage (*HPMHOOK_post_battle_calc_weapon_attack) (struct Damage retVal___, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int wflag); typedef int (*HPMHOOK_pre_battle_delay_damage) (int64 *tick, int *amotion, struct block_list **src, struct block_list **target, int *attack_type, uint16 *skill_id, uint16 *skill_lv, int64 *damage, enum damage_lv *dmg_lv, int *ddelay, bool *additional_effects); @@ -672,8 +678,8 @@ typedef bool (*HPMHOOK_pre_chat_change_status) (struct map_session_data **sd, co typedef bool (*HPMHOOK_post_chat_change_status) (bool retVal___, struct map_session_data *sd, const char *title, const char *pass, int limit, bool pub); typedef bool (*HPMHOOK_pre_chat_kick) (struct map_session_data **sd, const char **kickusername); typedef bool (*HPMHOOK_post_chat_kick) (bool retVal___, struct map_session_data *sd, const char *kickusername); -typedef bool (*HPMHOOK_pre_chat_create_npc_chat) (struct npc_data **nd, const char **title, int *limit, bool *pub, int *trigger, const char **ev, int *zeny, int *minLvl, int *maxLvl); -typedef bool (*HPMHOOK_post_chat_create_npc_chat) (bool retVal___, struct npc_data *nd, const char *title, int limit, bool pub, int trigger, const char *ev, int zeny, int minLvl, int maxLvl); +typedef bool (*HPMHOOK_pre_chat_create_npc_chat) (struct npc_data **nd, const char **title, int *limit, bool *pub, int *trigger, const char **ev, int *zeny, int *min_level, int *max_level); +typedef bool (*HPMHOOK_post_chat_create_npc_chat) (bool retVal___, struct npc_data *nd, const char *title, int limit, bool pub, int trigger, const char *ev, int zeny, int min_level, int max_level); typedef bool (*HPMHOOK_pre_chat_delete_npc_chat) (struct npc_data **nd); typedef bool (*HPMHOOK_post_chat_delete_npc_chat) (bool retVal___, struct npc_data *nd); typedef bool (*HPMHOOK_pre_chat_enable_event) (struct chat_data **cd); @@ -684,8 +690,8 @@ typedef bool (*HPMHOOK_pre_chat_npc_kick_all) (struct chat_data **cd); typedef bool (*HPMHOOK_post_chat_npc_kick_all) (bool retVal___, struct chat_data *cd); typedef bool (*HPMHOOK_pre_chat_trigger_event) (struct chat_data **cd); typedef bool (*HPMHOOK_post_chat_trigger_event) (bool retVal___, struct chat_data *cd); -typedef struct chat_data* (*HPMHOOK_pre_chat_create) (struct block_list **bl, const char **title, const char **pass, int *limit, bool *pub, int *trigger, const char **ev, int *zeny, int *minLvl, int *maxLvl); -typedef struct chat_data* (*HPMHOOK_post_chat_create) (struct chat_data* retVal___, struct block_list *bl, const char *title, const char *pass, int limit, bool pub, int trigger, const char *ev, int zeny, int minLvl, int maxLvl); +typedef struct chat_data* (*HPMHOOK_pre_chat_create) (struct block_list **bl, const char **title, const char **pass, int *limit, bool *pub, int *trigger, const char **ev, int *zeny, int *min_level, int *max_level); +typedef struct chat_data* (*HPMHOOK_post_chat_create) (struct chat_data* retVal___, struct block_list *bl, const char *title, const char *pass, int limit, bool pub, int trigger, const char *ev, int zeny, int min_level, int max_level); #endif // MAP_CHAT_H #ifdef MAP_CHRIF_H /* chrif */ typedef void (*HPMHOOK_pre_chrif_init) (bool *minimal); @@ -1166,6 +1172,8 @@ typedef int (*HPMHOOK_pre_clif_skill_itemlistwindow) (struct map_session_data ** typedef int (*HPMHOOK_post_clif_skill_itemlistwindow) (int retVal___, struct map_session_data *sd, uint16 skill_id, uint16 skill_lv); typedef void (*HPMHOOK_pre_clif_sc_load) (struct block_list **bl, int *tid, enum send_target *target, int *type, int *val1, int *val2, int *val3); typedef void (*HPMHOOK_post_clif_sc_load) (struct block_list *bl, int tid, enum send_target target, int type, int val1, int val2, int val3); +typedef void (*HPMHOOK_pre_clif_sc_continue) (struct block_list **bl, int *tid, enum send_target *target, int *type, int *val1, int *val2, int *val3); +typedef void (*HPMHOOK_post_clif_sc_continue) (struct block_list *bl, int tid, enum send_target target, int type, int val1, int val2, int val3); typedef void (*HPMHOOK_pre_clif_sc_end) (struct block_list **bl, int *tid, enum send_target *target, int *type); typedef void (*HPMHOOK_post_clif_sc_end) (struct block_list *bl, int tid, enum send_target target, int type); typedef void (*HPMHOOK_pre_clif_initialstatus) (struct map_session_data **sd); @@ -1228,8 +1236,8 @@ typedef void (*HPMHOOK_pre_clif_skill_estimation) (struct map_session_data **sd, typedef void (*HPMHOOK_post_clif_skill_estimation) (struct map_session_data *sd, struct block_list *dst); typedef void (*HPMHOOK_pre_clif_skill_warppoint) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv, unsigned short *map1, unsigned short *map2, unsigned short *map3, unsigned short *map4); typedef void (*HPMHOOK_post_clif_skill_warppoint) (struct map_session_data *sd, uint16 skill_id, uint16 skill_lv, unsigned short map1, unsigned short map2, unsigned short map3, unsigned short map4); -typedef void (*HPMHOOK_pre_clif_skillcasting) (struct block_list **bl, int *src_id, int *dst_id, int *dst_x, int *dst_y, uint16 *skill_id, int *property, int *casttime); -typedef void (*HPMHOOK_post_clif_skillcasting) (struct block_list *bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, int property, int casttime); +typedef void (*HPMHOOK_pre_clif_useskill) (struct block_list **bl, int *src_id, int *dst_id, int *dst_x, int *dst_y, uint16 *skill_id, uint16 *skill_lv, int *casttime); +typedef void (*HPMHOOK_post_clif_useskill) (struct block_list *bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, uint16 skill_lv, int casttime); typedef void (*HPMHOOK_pre_clif_produce_effect) (struct map_session_data **sd, int *flag, int *nameid); typedef void (*HPMHOOK_post_clif_produce_effect) (struct map_session_data *sd, int flag, int nameid); typedef void (*HPMHOOK_pre_clif_devotion) (struct block_list **src, struct map_session_data **tsd); @@ -1724,6 +1732,10 @@ typedef int (*HPMHOOK_pre_clif_comparemergeitem) (const void **a, const void **b typedef int (*HPMHOOK_post_clif_comparemergeitem) (int retVal___, const void *a, const void *b); typedef void (*HPMHOOK_pre_clif_ackmergeitems) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_ackmergeitems) (int fd, struct map_session_data *sd); +typedef bool (*HPMHOOK_pre_clif_isdisguised) (struct block_list **bl); +typedef bool (*HPMHOOK_post_clif_isdisguised) (bool retVal___, struct block_list *bl); +typedef unsigned char (*HPMHOOK_pre_clif_bl_type) (struct block_list **bl); +typedef unsigned char (*HPMHOOK_post_clif_bl_type) (unsigned char retVal___, struct block_list *bl); typedef void (*HPMHOOK_pre_clif_pWantToConnection) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_pWantToConnection) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_pLoadEndAck) (int *fd, struct map_session_data **sd); @@ -2261,6 +2273,12 @@ typedef void (*HPMHOOK_post_DB_init) (void); typedef void (*HPMHOOK_pre_DB_final) (void); typedef void (*HPMHOOK_post_DB_final) (void); #endif // COMMON_DB_H +#ifdef COMMON_DES_H /* des */ +typedef void (*HPMHOOK_pre_des_decrypt_block) (struct des_bit64 **block); +typedef void (*HPMHOOK_post_des_decrypt_block) (struct des_bit64 *block); +typedef void (*HPMHOOK_pre_des_decrypt) (unsigned char **data, size_t *size); +typedef void (*HPMHOOK_post_des_decrypt) (unsigned char *data, size_t size); +#endif // COMMON_DES_H #ifdef MAP_DUEL_H /* duel */ typedef int (*HPMHOOK_pre_duel_create) (struct map_session_data **sd, const unsigned int *maxpl); typedef int (*HPMHOOK_post_duel_create) (int retVal___, struct map_session_data *sd, const unsigned int maxpl); @@ -2355,6 +2373,22 @@ typedef void (*HPMHOOK_post_geoip_final) (bool shutdown); typedef void (*HPMHOOK_pre_geoip_init) (void); typedef void (*HPMHOOK_post_geoip_init) (void); #endif // CHAR_GEOIP_H +#ifdef COMMON_GRFIO_H /* grfio */ +typedef void (*HPMHOOK_pre_grfio_init) (const char **fname); +typedef void (*HPMHOOK_post_grfio_init) (const char *fname); +typedef void (*HPMHOOK_pre_grfio_final) (void); +typedef void (*HPMHOOK_post_grfio_final) (void); +typedef void* (*HPMHOOK_pre_grfio_reads) (const char **fname, int **size); +typedef void* (*HPMHOOK_post_grfio_reads) (void* retVal___, const char *fname, int *size); +typedef const char* (*HPMHOOK_pre_grfio_find_file) (const char **fname); +typedef const char* (*HPMHOOK_post_grfio_find_file) (const char* retVal___, const char *fname); +typedef unsigned long (*HPMHOOK_pre_grfio_crc32) (const unsigned char **buf, unsigned int *len); +typedef unsigned long (*HPMHOOK_post_grfio_crc32) (unsigned long retVal___, const unsigned char *buf, unsigned int len); +typedef int (*HPMHOOK_pre_grfio_decode_zip) (void **dest, unsigned long **dest_len, const void **source, unsigned long *source_len); +typedef int (*HPMHOOK_post_grfio_decode_zip) (int retVal___, void *dest, unsigned long *dest_len, const void *source, unsigned long source_len); +typedef int (*HPMHOOK_pre_grfio_encode_zip) (void **dest, unsigned long **dest_len, const void **source, unsigned long *source_len); +typedef int (*HPMHOOK_post_grfio_encode_zip) (int retVal___, void *dest, unsigned long *dest_len, const void *source, unsigned long source_len); +#endif // COMMON_GRFIO_H #ifdef MAP_GUILD_H /* guild */ typedef void (*HPMHOOK_pre_guild_init) (bool *minimal); typedef void (*HPMHOOK_post_guild_init) (bool minimal); @@ -4417,6 +4451,14 @@ typedef void (*HPMHOOK_post_mapreg_reload) (void); typedef bool (*HPMHOOK_pre_mapreg_config_read) (const char **w1, const char **w2); typedef bool (*HPMHOOK_post_mapreg_config_read) (bool retVal___, const char *w1, const char *w2); #endif // MAP_MAPREG_H +#ifdef COMMON_MD5CALC_H /* md5 */ +typedef void (*HPMHOOK_pre_md5_string) (const char **string, char **output); +typedef void (*HPMHOOK_post_md5_string) (const char *string, char *output); +typedef void (*HPMHOOK_pre_md5_binary) (const char **string, unsigned char **output); +typedef void (*HPMHOOK_post_md5_binary) (const char *string, unsigned char *output); +typedef void (*HPMHOOK_pre_md5_salt) (int *len, char **output); +typedef void (*HPMHOOK_post_md5_salt) (int len, char *output); +#endif // COMMON_MD5CALC_H #ifdef MAP_MERCENARY_H /* mercenary */ typedef void (*HPMHOOK_pre_mercenary_init) (bool *minimal); typedef void (*HPMHOOK_post_mercenary_init) (bool minimal); @@ -4677,6 +4719,28 @@ typedef void (*HPMHOOK_post_mob_clear_spawninfo) (void); typedef void (*HPMHOOK_pre_mob_destroy_mob_db) (int *index); typedef void (*HPMHOOK_post_mob_destroy_mob_db) (int index); #endif // MAP_MOB_H +#ifdef COMMON_MUTEX_H /* mutex */ +typedef struct mutex_data* (*HPMHOOK_pre_mutex_create) (void); +typedef struct mutex_data* (*HPMHOOK_post_mutex_create) (struct mutex_data* retVal___); +typedef void (*HPMHOOK_pre_mutex_destroy) (struct mutex_data **m); +typedef void (*HPMHOOK_post_mutex_destroy) (struct mutex_data *m); +typedef void (*HPMHOOK_pre_mutex_lock) (struct mutex_data **m); +typedef void (*HPMHOOK_post_mutex_lock) (struct mutex_data *m); +typedef bool (*HPMHOOK_pre_mutex_trylock) (struct mutex_data **m); +typedef bool (*HPMHOOK_post_mutex_trylock) (bool retVal___, struct mutex_data *m); +typedef void (*HPMHOOK_pre_mutex_unlock) (struct mutex_data **m); +typedef void (*HPMHOOK_post_mutex_unlock) (struct mutex_data *m); +typedef struct cond_data* (*HPMHOOK_pre_mutex_cond_create) (void); +typedef struct cond_data* (*HPMHOOK_post_mutex_cond_create) (struct cond_data* retVal___); +typedef void (*HPMHOOK_pre_mutex_cond_destroy) (struct cond_data **c); +typedef void (*HPMHOOK_post_mutex_cond_destroy) (struct cond_data *c); +typedef void (*HPMHOOK_pre_mutex_cond_wait) (struct cond_data **c, struct mutex_data **m, sysint *timeout_ticks); +typedef void (*HPMHOOK_post_mutex_cond_wait) (struct cond_data *c, struct mutex_data *m, sysint timeout_ticks); +typedef void (*HPMHOOK_pre_mutex_cond_signal) (struct cond_data **c); +typedef void (*HPMHOOK_post_mutex_cond_signal) (struct cond_data *c); +typedef void (*HPMHOOK_pre_mutex_cond_broadcast) (struct cond_data **c); +typedef void (*HPMHOOK_post_mutex_cond_broadcast) (struct cond_data *c); +#endif // COMMON_MUTEX_H #ifdef MAP_NPC_H /* npc_chat */ typedef int (*HPMHOOK_pre_npc_chat_sub) (struct block_list **bl, va_list ap); typedef int (*HPMHOOK_post_npc_chat_sub) (int retVal___, struct block_list *bl, va_list ap); @@ -5202,24 +5266,24 @@ typedef int (*HPMHOOK_pre_pc_follow) (struct map_session_data **sd, int *target_ typedef int (*HPMHOOK_post_pc_follow) (int retVal___, struct map_session_data *sd, int target_id); typedef int (*HPMHOOK_pre_pc_stop_following) (struct map_session_data **sd); typedef int (*HPMHOOK_post_pc_stop_following) (int retVal___, struct map_session_data *sd); -typedef unsigned int (*HPMHOOK_pre_pc_maxbaselv) (struct map_session_data **sd); -typedef unsigned int (*HPMHOOK_post_pc_maxbaselv) (unsigned int retVal___, struct map_session_data *sd); -typedef unsigned int (*HPMHOOK_pre_pc_maxjoblv) (struct map_session_data **sd); -typedef unsigned int (*HPMHOOK_post_pc_maxjoblv) (unsigned int retVal___, struct map_session_data *sd); +typedef int (*HPMHOOK_pre_pc_maxbaselv) (const struct map_session_data **sd); +typedef int (*HPMHOOK_post_pc_maxbaselv) (int retVal___, const struct map_session_data *sd); +typedef int (*HPMHOOK_pre_pc_maxjoblv) (const struct map_session_data **sd); +typedef int (*HPMHOOK_post_pc_maxjoblv) (int retVal___, const struct map_session_data *sd); typedef int (*HPMHOOK_pre_pc_checkbaselevelup) (struct map_session_data **sd); typedef int (*HPMHOOK_post_pc_checkbaselevelup) (int retVal___, struct map_session_data *sd); typedef int (*HPMHOOK_pre_pc_checkjoblevelup) (struct map_session_data **sd); typedef int (*HPMHOOK_post_pc_checkjoblevelup) (int retVal___, struct map_session_data *sd); typedef bool (*HPMHOOK_pre_pc_gainexp) (struct map_session_data **sd, struct block_list **src, unsigned int *base_exp, unsigned int *job_exp, bool *is_quest); typedef bool (*HPMHOOK_post_pc_gainexp) (bool retVal___, struct map_session_data *sd, struct block_list *src, unsigned int base_exp, unsigned int job_exp, bool is_quest); -typedef unsigned int (*HPMHOOK_pre_pc_nextbaseexp) (struct map_session_data **sd); -typedef unsigned int (*HPMHOOK_post_pc_nextbaseexp) (unsigned int retVal___, struct map_session_data *sd); -typedef unsigned int (*HPMHOOK_pre_pc_thisbaseexp) (struct map_session_data **sd); -typedef unsigned int (*HPMHOOK_post_pc_thisbaseexp) (unsigned int retVal___, struct map_session_data *sd); -typedef unsigned int (*HPMHOOK_pre_pc_nextjobexp) (struct map_session_data **sd); -typedef unsigned int (*HPMHOOK_post_pc_nextjobexp) (unsigned int retVal___, struct map_session_data *sd); -typedef unsigned int (*HPMHOOK_pre_pc_thisjobexp) (struct map_session_data **sd); -typedef unsigned int (*HPMHOOK_post_pc_thisjobexp) (unsigned int retVal___, struct map_session_data *sd); +typedef unsigned int (*HPMHOOK_pre_pc_nextbaseexp) (const struct map_session_data **sd); +typedef unsigned int (*HPMHOOK_post_pc_nextbaseexp) (unsigned int retVal___, const struct map_session_data *sd); +typedef unsigned int (*HPMHOOK_pre_pc_thisbaseexp) (const struct map_session_data **sd); +typedef unsigned int (*HPMHOOK_post_pc_thisbaseexp) (unsigned int retVal___, const struct map_session_data *sd); +typedef unsigned int (*HPMHOOK_pre_pc_nextjobexp) (const struct map_session_data **sd); +typedef unsigned int (*HPMHOOK_post_pc_nextjobexp) (unsigned int retVal___, const struct map_session_data *sd); +typedef unsigned int (*HPMHOOK_pre_pc_thisjobexp) (const struct map_session_data **sd); +typedef unsigned int (*HPMHOOK_post_pc_thisjobexp) (unsigned int retVal___, const struct map_session_data *sd); typedef int (*HPMHOOK_pre_pc_gets_status_point) (int *level); typedef int (*HPMHOOK_post_pc_gets_status_point) (int retVal___, int level); typedef int (*HPMHOOK_pre_pc_need_status_point) (struct map_session_data **sd, int *type, int *val); @@ -5294,8 +5358,8 @@ typedef int (*HPMHOOK_pre_pc_changelook) (struct map_session_data **sd, int *typ typedef int (*HPMHOOK_post_pc_changelook) (int retVal___, struct map_session_data *sd, int type, int val); typedef int (*HPMHOOK_pre_pc_equiplookall) (struct map_session_data **sd); typedef int (*HPMHOOK_post_pc_equiplookall) (int retVal___, struct map_session_data *sd); -typedef int (*HPMHOOK_pre_pc_readparam) (struct map_session_data **sd, int *type); -typedef int (*HPMHOOK_post_pc_readparam) (int retVal___, struct map_session_data *sd, int type); +typedef int (*HPMHOOK_pre_pc_readparam) (const struct map_session_data **sd, int *type); +typedef int (*HPMHOOK_post_pc_readparam) (int retVal___, const struct map_session_data *sd, int type); typedef int (*HPMHOOK_pre_pc_setparam) (struct map_session_data **sd, int *type, int *val); typedef int (*HPMHOOK_post_pc_setparam) (int retVal___, struct map_session_data *sd, int type, int val); typedef int (*HPMHOOK_pre_pc_readreg) (struct map_session_data **sd, int64 *reg); @@ -5653,6 +5717,24 @@ typedef int (*HPMHOOK_post_quest_read_db) (int retVal___); typedef struct quest_db* (*HPMHOOK_pre_quest_read_db_sub) (struct config_setting_t **cs, int *n, const char **source); typedef struct quest_db* (*HPMHOOK_post_quest_read_db_sub) (struct quest_db* retVal___, struct config_setting_t *cs, int n, const char *source); #endif // MAP_QUEST_H +#ifdef COMMON_RANDOM_H /* rnd */ +typedef void (*HPMHOOK_pre_rnd_init) (void); +typedef void (*HPMHOOK_post_rnd_init) (void); +typedef void (*HPMHOOK_pre_rnd_final) (void); +typedef void (*HPMHOOK_post_rnd_final) (void); +typedef void (*HPMHOOK_pre_rnd_seed) (uint32 *seed); +typedef void (*HPMHOOK_post_rnd_seed) (uint32 seed); +typedef int32 (*HPMHOOK_pre_rnd_random) (void); +typedef int32 (*HPMHOOK_post_rnd_random) (int32 retVal___); +typedef uint32 (*HPMHOOK_pre_rnd_roll) (uint32 *dice_faces); +typedef uint32 (*HPMHOOK_post_rnd_roll) (uint32 retVal___, uint32 dice_faces); +typedef int32 (*HPMHOOK_pre_rnd_value) (int32 *min, int32 *max); +typedef int32 (*HPMHOOK_post_rnd_value) (int32 retVal___, int32 min, int32 max); +typedef double (*HPMHOOK_pre_rnd_uniform) (void); +typedef double (*HPMHOOK_post_rnd_uniform) (double retVal___); +typedef double (*HPMHOOK_pre_rnd_uniform53) (void); +typedef double (*HPMHOOK_post_rnd_uniform53) (double retVal___); +#endif // COMMON_RANDOM_H #ifdef MAP_SCRIPT_H /* script */ typedef void (*HPMHOOK_pre_script_init) (bool *minimal); typedef void (*HPMHOOK_post_script_init) (bool minimal); @@ -5790,10 +5872,10 @@ typedef const char* (*HPMHOOK_pre_script_parse_syntax_close_sub) (const char **p typedef const char* (*HPMHOOK_post_script_parse_syntax_close_sub) (const char* retVal___, const char *p, int *flag); typedef const char* (*HPMHOOK_pre_script_parse_syntax) (const char **p); typedef const char* (*HPMHOOK_post_script_parse_syntax) (const char* retVal___, const char *p); -typedef c_op (*HPMHOOK_pre_script_get_com) (unsigned char **scriptbuf, int **pos); -typedef c_op (*HPMHOOK_post_script_get_com) (c_op retVal___, unsigned char *scriptbuf, int *pos); -typedef int (*HPMHOOK_pre_script_get_num) (unsigned char **scriptbuf, int **pos); -typedef int (*HPMHOOK_post_script_get_num) (int retVal___, unsigned char *scriptbuf, int *pos); +typedef c_op (*HPMHOOK_pre_script_get_com) (const struct script_buf **scriptbuf, int **pos); +typedef c_op (*HPMHOOK_post_script_get_com) (c_op retVal___, const struct script_buf *scriptbuf, int *pos); +typedef int (*HPMHOOK_pre_script_get_num) (const struct script_buf **scriptbuf, int **pos); +typedef int (*HPMHOOK_post_script_get_num) (int retVal___, const struct script_buf *scriptbuf, int *pos); typedef const char* (*HPMHOOK_pre_script_op2name) (int *op); typedef const char* (*HPMHOOK_post_script_op2name) (const char* retVal___, int op); typedef void (*HPMHOOK_pre_script_reportsrc) (struct script_state **st); @@ -5830,6 +5912,16 @@ typedef const char* (*HPMHOOK_pre_script_parse_variable) (const char **p); typedef const char* (*HPMHOOK_post_script_parse_variable) (const char* retVal___, const char *p); typedef const char* (*HPMHOOK_pre_script_parse_simpleexpr) (const char **p); typedef const char* (*HPMHOOK_post_script_parse_simpleexpr) (const char* retVal___, const char *p); +typedef const char* (*HPMHOOK_pre_script_parse_simpleexpr_paren) (const char **p); +typedef const char* (*HPMHOOK_post_script_parse_simpleexpr_paren) (const char* retVal___, const char *p); +typedef const char* (*HPMHOOK_pre_script_parse_simpleexpr_number) (const char **p); +typedef const char* (*HPMHOOK_post_script_parse_simpleexpr_number) (const char* retVal___, const char *p); +typedef const char* (*HPMHOOK_pre_script_parse_simpleexpr_string) (const char **p); +typedef const char* (*HPMHOOK_post_script_parse_simpleexpr_string) (const char* retVal___, const char *p); +typedef const char* (*HPMHOOK_pre_script_parse_simpleexpr_name) (const char **p); +typedef const char* (*HPMHOOK_post_script_parse_simpleexpr_name) (const char* retVal___, const char *p); +typedef void (*HPMHOOK_pre_script_add_translatable_string) (const struct script_string_buf **string, const char **start_point); +typedef void (*HPMHOOK_post_script_add_translatable_string) (const struct script_string_buf *string, const char *start_point); typedef const char* (*HPMHOOK_pre_script_parse_expr) (const char **p); typedef const char* (*HPMHOOK_post_script_parse_expr) (const char* retVal___, const char *p); typedef const char* (*HPMHOOK_pre_script_parse_line) (const char **p); @@ -5876,8 +5968,8 @@ typedef void (*HPMHOOK_pre_script_op_2) (struct script_state **st, int *op); typedef void (*HPMHOOK_post_script_op_2) (struct script_state *st, int op); typedef void (*HPMHOOK_pre_script_op_1) (struct script_state **st, int *op); typedef void (*HPMHOOK_post_script_op_1) (struct script_state *st, int op); -typedef void (*HPMHOOK_pre_script_check_buildin_argtype) (struct script_state **st, int *func); -typedef void (*HPMHOOK_post_script_check_buildin_argtype) (struct script_state *st, int func); +typedef bool (*HPMHOOK_pre_script_check_buildin_argtype) (struct script_state **st, int *func); +typedef bool (*HPMHOOK_post_script_check_buildin_argtype) (bool retVal___, struct script_state *st, int func); typedef void (*HPMHOOK_pre_script_detach_state) (struct script_state **st, bool *dequeue_event); typedef void (*HPMHOOK_post_script_detach_state) (struct script_state *st, bool dequeue_event); typedef int (*HPMHOOK_pre_script_db_free_code_sub) (union DBKey *key, struct DBData **data, va_list ap); @@ -5972,8 +6064,10 @@ typedef int (*HPMHOOK_pre_script_string_dup) (char **str); typedef int (*HPMHOOK_post_script_string_dup) (int retVal___, char *str); typedef void (*HPMHOOK_pre_script_load_translations) (void); typedef void (*HPMHOOK_post_script_load_translations) (void); -typedef void (*HPMHOOK_pre_script_load_translation) (const char **file, uint8 *lang_id, uint32 **total); -typedef void (*HPMHOOK_post_script_load_translation) (const char *file, uint8 lang_id, uint32 *total); +typedef bool (*HPMHOOK_pre_script_load_translation_addstring) (const char **file, uint8 *lang_id, const char **msgctxt, const struct script_string_buf **msgid, const struct script_string_buf **msgstr); +typedef bool (*HPMHOOK_post_script_load_translation_addstring) (bool retVal___, const char *file, uint8 lang_id, const char *msgctxt, const struct script_string_buf *msgid, const struct script_string_buf *msgstr); +typedef int (*HPMHOOK_pre_script_load_translation) (const char **file, uint8 *lang_id); +typedef int (*HPMHOOK_post_script_load_translation) (int retVal___, const char *file, uint8 lang_id); typedef int (*HPMHOOK_pre_script_translation_db_destroyer) (union DBKey *key, struct DBData **data, va_list ap); typedef int (*HPMHOOK_post_script_translation_db_destroyer) (int retVal___, union DBKey key, struct DBData *data, va_list ap); typedef void (*HPMHOOK_pre_script_clear_translations) (bool *reload); @@ -6222,8 +6316,12 @@ typedef int (*HPMHOOK_pre_skill_enchant_elemental_end) (struct block_list **bl, typedef int (*HPMHOOK_post_skill_enchant_elemental_end) (int retVal___, struct block_list *bl, int type); typedef int (*HPMHOOK_pre_skill_not_ok) (uint16 *skill_id, struct map_session_data **sd); typedef int (*HPMHOOK_post_skill_not_ok) (int retVal___, uint16 skill_id, struct map_session_data *sd); +typedef int (*HPMHOOK_pre_skill_not_ok_unknown) (uint16 *skill_id, struct map_session_data **sd); +typedef int (*HPMHOOK_post_skill_not_ok_unknown) (int retVal___, uint16 skill_id, struct map_session_data *sd); typedef int (*HPMHOOK_pre_skill_not_ok_hom) (uint16 *skill_id, struct homun_data **hd); typedef int (*HPMHOOK_post_skill_not_ok_hom) (int retVal___, uint16 skill_id, struct homun_data *hd); +typedef int (*HPMHOOK_pre_skill_not_ok_hom_unknown) (uint16 *skill_id, struct homun_data **hd); +typedef int (*HPMHOOK_post_skill_not_ok_hom_unknown) (int retVal___, uint16 skill_id, struct homun_data *hd); typedef int (*HPMHOOK_pre_skill_not_ok_mercenary) (uint16 *skill_id, struct mercenary_data **md); typedef int (*HPMHOOK_post_skill_not_ok_mercenary) (int retVal___, uint16 skill_id, struct mercenary_data *md); typedef int (*HPMHOOK_pre_skill_chastle_mob_changetarget) (struct block_list **bl, va_list ap); @@ -6234,6 +6332,8 @@ typedef int (*HPMHOOK_pre_skill_produce_mix) (struct map_session_data **sd, uint typedef int (*HPMHOOK_post_skill_produce_mix) (int retVal___, struct map_session_data *sd, uint16 skill_id, int nameid, int slot1, int slot2, int slot3, int qty); typedef int (*HPMHOOK_pre_skill_arrow_create) (struct map_session_data **sd, int *nameid); typedef int (*HPMHOOK_post_skill_arrow_create) (int retVal___, struct map_session_data *sd, int nameid); +typedef void (*HPMHOOK_pre_skill_castend_type) (int *type, struct block_list **src, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag); +typedef void (*HPMHOOK_post_skill_castend_type) (int type, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag); typedef int (*HPMHOOK_pre_skill_castend_nodamage_id) (struct block_list **src, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag); typedef int (*HPMHOOK_post_skill_castend_nodamage_id) (int retVal___, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag); typedef int (*HPMHOOK_pre_skill_castend_damage_id) (struct block_list **src, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag); @@ -6318,6 +6418,8 @@ typedef void (*HPMHOOK_pre_skill_unitsetmapcell) (struct skill_unit **src, uint1 typedef void (*HPMHOOK_post_skill_unitsetmapcell) (struct skill_unit *src, uint16 skill_id, uint16 skill_lv, cell_t cell, bool flag); typedef int (*HPMHOOK_pre_skill_unit_onplace_timer) (struct skill_unit **src, struct block_list **bl, int64 *tick); typedef int (*HPMHOOK_post_skill_unit_onplace_timer) (int retVal___, struct skill_unit *src, struct block_list *bl, int64 tick); +typedef void (*HPMHOOK_pre_skill_unit_onplace_timer_unknown) (struct skill_unit **src, struct block_list **bl, int64 **tick); +typedef void (*HPMHOOK_post_skill_unit_onplace_timer_unknown) (struct skill_unit *src, struct block_list *bl, int64 *tick); typedef int (*HPMHOOK_pre_skill_unit_effect) (struct block_list **bl, va_list ap); typedef int (*HPMHOOK_post_skill_unit_effect) (int retVal___, struct block_list *bl, va_list ap); typedef int (*HPMHOOK_pre_skill_unit_timer_sub_onplace) (struct block_list **bl, va_list ap); @@ -6338,16 +6440,44 @@ typedef int (*HPMHOOK_pre_skill_unit_timer_sub) (union DBKey *key, struct DBData typedef int (*HPMHOOK_post_skill_unit_timer_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap); typedef void (*HPMHOOK_pre_skill_init_unit_layout) (void); typedef void (*HPMHOOK_post_skill_init_unit_layout) (void); -typedef bool (*HPMHOOK_pre_skill_parse_row_skilldb) (char **split[], int *columns, int *current); -typedef bool (*HPMHOOK_post_skill_parse_row_skilldb) (bool retVal___, char *split[], int columns, int current); -typedef bool (*HPMHOOK_pre_skill_parse_row_requiredb) (char **split[], int *columns, int *current); -typedef bool (*HPMHOOK_post_skill_parse_row_requiredb) (bool retVal___, char *split[], int columns, int current); -typedef bool (*HPMHOOK_pre_skill_parse_row_castdb) (char **split[], int *columns, int *current); -typedef bool (*HPMHOOK_post_skill_parse_row_castdb) (bool retVal___, char *split[], int columns, int current); -typedef bool (*HPMHOOK_pre_skill_parse_row_castnodexdb) (char **split[], int *columns, int *current); -typedef bool (*HPMHOOK_post_skill_parse_row_castnodexdb) (bool retVal___, char *split[], int columns, int current); -typedef bool (*HPMHOOK_pre_skill_parse_row_unitdb) (char **split[], int *columns, int *current); -typedef bool (*HPMHOOK_post_skill_parse_row_unitdb) (bool retVal___, char *split[], int columns, int current); +typedef void (*HPMHOOK_pre_skill_init_unit_layout_unknown) (int *skill_idx); +typedef void (*HPMHOOK_post_skill_init_unit_layout_unknown) (int skill_idx); +typedef void (*HPMHOOK_pre_skill_validate_hittype) (struct config_setting_t **conf, struct s_skill_db **sk); +typedef void (*HPMHOOK_post_skill_validate_hittype) (struct config_setting_t *conf, struct s_skill_db *sk); +typedef void (*HPMHOOK_pre_skill_validate_skilltype) (struct config_setting_t **conf, struct s_skill_db **sk); +typedef void (*HPMHOOK_post_skill_validate_skilltype) (struct config_setting_t *conf, struct s_skill_db *sk); +typedef void (*HPMHOOK_pre_skill_validate_attacktype) (struct config_setting_t **conf, struct s_skill_db **sk); +typedef void (*HPMHOOK_post_skill_validate_attacktype) (struct config_setting_t *conf, struct s_skill_db *sk); +typedef void (*HPMHOOK_pre_skill_validate_element) (struct config_setting_t **conf, struct s_skill_db **sk); +typedef void (*HPMHOOK_post_skill_validate_element) (struct config_setting_t *conf, struct s_skill_db *sk); +typedef void (*HPMHOOK_pre_skill_validate_skillinfo) (struct config_setting_t **conf, struct s_skill_db **sk); +typedef void (*HPMHOOK_post_skill_validate_skillinfo) (struct config_setting_t *conf, struct s_skill_db *sk); +typedef void (*HPMHOOK_pre_skill_validate_damagetype) (struct config_setting_t **conf, struct s_skill_db **sk); +typedef void (*HPMHOOK_post_skill_validate_damagetype) (struct config_setting_t *conf, struct s_skill_db *sk); +typedef void (*HPMHOOK_pre_skill_validate_castnodex) (struct config_setting_t **conf, struct s_skill_db **sk, bool *delay); +typedef void (*HPMHOOK_post_skill_validate_castnodex) (struct config_setting_t *conf, struct s_skill_db *sk, bool delay); +typedef void (*HPMHOOK_pre_skill_validate_weapontype) (struct config_setting_t **conf, struct s_skill_db **sk); +typedef void (*HPMHOOK_post_skill_validate_weapontype) (struct config_setting_t *conf, struct s_skill_db *sk); +typedef void (*HPMHOOK_pre_skill_validate_ammotype) (struct config_setting_t **conf, struct s_skill_db **sk); +typedef void (*HPMHOOK_post_skill_validate_ammotype) (struct config_setting_t *conf, struct s_skill_db *sk); +typedef void (*HPMHOOK_pre_skill_validate_state) (struct config_setting_t **conf, struct s_skill_db **sk); +typedef void (*HPMHOOK_post_skill_validate_state) (struct config_setting_t *conf, struct s_skill_db *sk); +typedef void (*HPMHOOK_pre_skill_validate_item_requirements) (struct config_setting_t **conf, struct s_skill_db **sk); +typedef void (*HPMHOOK_post_skill_validate_item_requirements) (struct config_setting_t *conf, struct s_skill_db *sk); +typedef void (*HPMHOOK_pre_skill_validate_unit_target) (struct config_setting_t **conf, struct s_skill_db **sk); +typedef void (*HPMHOOK_post_skill_validate_unit_target) (struct config_setting_t *conf, struct s_skill_db *sk); +typedef void (*HPMHOOK_pre_skill_validate_unit_flag) (struct config_setting_t **conf, struct s_skill_db **sk); +typedef void (*HPMHOOK_post_skill_validate_unit_flag) (struct config_setting_t *conf, struct s_skill_db *sk); +typedef void (*HPMHOOK_pre_skill_validate_additional_fields) (struct config_setting_t **conf, struct s_skill_db **sk); +typedef void (*HPMHOOK_post_skill_validate_additional_fields) (struct config_setting_t *conf, struct s_skill_db *sk); +typedef bool (*HPMHOOK_pre_skill_validate_skilldb) (struct s_skill_db **skt, const char **source); +typedef bool (*HPMHOOK_post_skill_validate_skilldb) (bool retVal___, struct s_skill_db *skt, const char *source); +typedef bool (*HPMHOOK_pre_skill_read_skilldb) (const char **filename); +typedef bool (*HPMHOOK_post_skill_read_skilldb) (bool retVal___, const char *filename); +typedef void (*HPMHOOK_pre_skill_config_set_level) (struct config_setting_t **conf, int **arr); +typedef void (*HPMHOOK_post_skill_config_set_level) (struct config_setting_t *conf, int *arr); +typedef void (*HPMHOOK_pre_skill_level_set_value) (int **arr, int *value); +typedef void (*HPMHOOK_post_skill_level_set_value) (int *arr, int value); typedef bool (*HPMHOOK_pre_skill_parse_row_producedb) (char **split[], int *columns, int *current); typedef bool (*HPMHOOK_post_skill_parse_row_producedb) (bool retVal___, char *split[], int columns, int current); typedef bool (*HPMHOOK_pre_skill_parse_row_createarrowdb) (char **split[], int *columns, int *current); @@ -6460,6 +6590,12 @@ typedef bool (*HPMHOOK_pre_skill_get_requirement_item_unknown) (struct status_ch typedef bool (*HPMHOOK_post_skill_get_requirement_item_unknown) (bool retVal___, struct status_change *sc, struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv, uint16 *idx, int *i); typedef void (*HPMHOOK_pre_skill_get_requirement_unknown) (struct status_change **sc, struct map_session_data **sd, uint16 **skill_id, uint16 **skill_lv, struct skill_condition **req); typedef void (*HPMHOOK_post_skill_get_requirement_unknown) (struct status_change *sc, struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv, struct skill_condition *req); +typedef int (*HPMHOOK_pre_skill_splash_target) (struct block_list **bl); +typedef int (*HPMHOOK_post_skill_splash_target) (int retVal___, struct block_list *bl); +typedef int (*HPMHOOK_pre_skill_check_npc_chaospanic) (struct block_list **bl, va_list args); +typedef int (*HPMHOOK_post_skill_check_npc_chaospanic) (int retVal___, struct block_list *bl, va_list args); +typedef int (*HPMHOOK_pre_skill_count_wos) (struct block_list **bl, va_list ap); +typedef int (*HPMHOOK_post_skill_count_wos) (int retVal___, struct block_list *bl, va_list ap); #endif // MAP_SKILL_H #ifdef COMMON_SOCKET_H /* sockt */ typedef void (*HPMHOOK_pre_sockt_init) (void); @@ -6810,6 +6946,14 @@ typedef void (*HPMHOOK_pre_status_read_job_db) (void); typedef void (*HPMHOOK_post_status_read_job_db) (void); typedef void (*HPMHOOK_pre_status_read_job_db_sub) (int *idx, const char **name, struct config_setting_t **jdb); typedef void (*HPMHOOK_post_status_read_job_db_sub) (int idx, const char *name, struct config_setting_t *jdb); +typedef void (*HPMHOOK_pre_status_set_sc) (uint16 *skill_id, sc_type *sc, int *icon, unsigned int *flag); +typedef void (*HPMHOOK_post_status_set_sc) (uint16 skill_id, sc_type sc, int icon, unsigned int flag); +typedef void (*HPMHOOK_pre_status_copy) (struct status_data **a, const struct status_data **b); +typedef void (*HPMHOOK_post_status_copy) (struct status_data *a, const struct status_data *b); +typedef unsigned short (*HPMHOOK_pre_status_base_matk_min) (const struct status_data **st); +typedef unsigned short (*HPMHOOK_post_status_base_matk_min) (unsigned short retVal___, const struct status_data *st); +typedef unsigned short (*HPMHOOK_pre_status_base_matk_max) (const struct status_data **st); +typedef unsigned short (*HPMHOOK_post_status_base_matk_max) (unsigned short retVal___, const struct status_data *st); #endif // MAP_STATUS_H #ifdef MAP_STORAGE_H /* storage */ typedef void (*HPMHOOK_pre_storage_reconnect) (void); @@ -6947,6 +7091,30 @@ typedef void (*HPMHOOK_post_sysinfo_init) (void); typedef void (*HPMHOOK_pre_sysinfo_final) (void); typedef void (*HPMHOOK_post_sysinfo_final) (void); #endif // COMMON_SYSINFO_H +#ifdef COMMON_THREAD_H /* thread */ +typedef void (*HPMHOOK_pre_thread_init) (void); +typedef void (*HPMHOOK_post_thread_init) (void); +typedef void (*HPMHOOK_pre_thread_final) (void); +typedef void (*HPMHOOK_post_thread_final) (void); +typedef struct thread_handle* (*HPMHOOK_pre_thread_create) (threadFunc *entry_point, void **param); +typedef struct thread_handle* (*HPMHOOK_post_thread_create) (struct thread_handle* retVal___, threadFunc entry_point, void *param); +typedef struct thread_handle* (*HPMHOOK_pre_thread_create_opt) (threadFunc *entry_point, void **param, size_t *stack_size, enum thread_priority *prio); +typedef struct thread_handle* (*HPMHOOK_post_thread_create_opt) (struct thread_handle* retVal___, threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio); +typedef void (*HPMHOOK_pre_thread_destroy) (struct thread_handle **handle); +typedef void (*HPMHOOK_post_thread_destroy) (struct thread_handle *handle); +typedef struct thread_handle* (*HPMHOOK_pre_thread_self) (void); +typedef struct thread_handle* (*HPMHOOK_post_thread_self) (struct thread_handle* retVal___); +typedef int (*HPMHOOK_pre_thread_get_tid) (void); +typedef int (*HPMHOOK_post_thread_get_tid) (int retVal___); +typedef bool (*HPMHOOK_pre_thread_wait) (struct thread_handle **handle, void ***out_exit_code); +typedef bool (*HPMHOOK_post_thread_wait) (bool retVal___, struct thread_handle *handle, void **out_exit_code); +typedef void (*HPMHOOK_pre_thread_prio_set) (struct thread_handle **handle, enum thread_priority *prio); +typedef void (*HPMHOOK_post_thread_prio_set) (struct thread_handle *handle, enum thread_priority prio); +typedef enum thread_priority (*HPMHOOK_pre_thread_prio_get) (struct thread_handle **handle); +typedef enum thread_priority (*HPMHOOK_post_thread_prio_get) (enum thread_priority retVal___, struct thread_handle *handle); +typedef void (*HPMHOOK_pre_thread_yield) (void); +typedef void (*HPMHOOK_post_thread_yield) (void); +#endif // COMMON_THREAD_H #ifdef COMMON_TIMER_H /* timer */ typedef int64 (*HPMHOOK_pre_timer_gettick) (void); typedef int64 (*HPMHOOK_post_timer_gettick) (int64 retVal___); diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc index 7210920e5..f51ddcffc 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc @@ -23,6 +23,8 @@ * as it will get overwritten. */ +/* GENERATED FILE DO NOT EDIT */ + struct { struct HPMHookPoint *HP_HCache_init_pre; struct HPMHookPoint *HP_HCache_init_post; @@ -406,6 +408,10 @@ struct { struct HPMHookPoint *HP_DB_init_post; struct HPMHookPoint *HP_DB_final_pre; struct HPMHookPoint *HP_DB_final_post; + struct HPMHookPoint *HP_des_decrypt_block_pre; + struct HPMHookPoint *HP_des_decrypt_block_post; + struct HPMHookPoint *HP_des_decrypt_pre; + struct HPMHookPoint *HP_des_decrypt_post; struct HPMHookPoint *HP_geoip_getcountry_pre; struct HPMHookPoint *HP_geoip_getcountry_post; struct HPMHookPoint *HP_geoip_final_pre; @@ -1150,6 +1156,32 @@ struct { struct HPMHookPoint *HP_mapindex_id2name_post; struct HPMHookPoint *HP_mapindex_check_default_pre; struct HPMHookPoint *HP_mapindex_check_default_post; + struct HPMHookPoint *HP_md5_string_pre; + struct HPMHookPoint *HP_md5_string_post; + struct HPMHookPoint *HP_md5_binary_pre; + struct HPMHookPoint *HP_md5_binary_post; + struct HPMHookPoint *HP_md5_salt_pre; + struct HPMHookPoint *HP_md5_salt_post; + struct HPMHookPoint *HP_mutex_create_pre; + struct HPMHookPoint *HP_mutex_create_post; + struct HPMHookPoint *HP_mutex_destroy_pre; + struct HPMHookPoint *HP_mutex_destroy_post; + struct HPMHookPoint *HP_mutex_lock_pre; + struct HPMHookPoint *HP_mutex_lock_post; + struct HPMHookPoint *HP_mutex_trylock_pre; + struct HPMHookPoint *HP_mutex_trylock_post; + struct HPMHookPoint *HP_mutex_unlock_pre; + struct HPMHookPoint *HP_mutex_unlock_post; + struct HPMHookPoint *HP_mutex_cond_create_pre; + struct HPMHookPoint *HP_mutex_cond_create_post; + struct HPMHookPoint *HP_mutex_cond_destroy_pre; + struct HPMHookPoint *HP_mutex_cond_destroy_post; + struct HPMHookPoint *HP_mutex_cond_wait_pre; + struct HPMHookPoint *HP_mutex_cond_wait_post; + struct HPMHookPoint *HP_mutex_cond_signal_pre; + struct HPMHookPoint *HP_mutex_cond_signal_post; + struct HPMHookPoint *HP_mutex_cond_broadcast_pre; + struct HPMHookPoint *HP_mutex_cond_broadcast_post; struct HPMHookPoint *HP_nullpo_assert_report_pre; struct HPMHookPoint *HP_nullpo_assert_report_post; struct HPMHookPoint *HP_pincode_handle_pre; @@ -1172,6 +1204,22 @@ struct { struct HPMHookPoint *HP_pincode_check_post; struct HPMHookPoint *HP_pincode_config_read_pre; struct HPMHookPoint *HP_pincode_config_read_post; + struct HPMHookPoint *HP_rnd_init_pre; + struct HPMHookPoint *HP_rnd_init_post; + struct HPMHookPoint *HP_rnd_final_pre; + struct HPMHookPoint *HP_rnd_final_post; + struct HPMHookPoint *HP_rnd_seed_pre; + struct HPMHookPoint *HP_rnd_seed_post; + struct HPMHookPoint *HP_rnd_random_pre; + struct HPMHookPoint *HP_rnd_random_post; + struct HPMHookPoint *HP_rnd_roll_pre; + struct HPMHookPoint *HP_rnd_roll_post; + struct HPMHookPoint *HP_rnd_value_pre; + struct HPMHookPoint *HP_rnd_value_post; + struct HPMHookPoint *HP_rnd_uniform_pre; + struct HPMHookPoint *HP_rnd_uniform_post; + struct HPMHookPoint *HP_rnd_uniform53_pre; + struct HPMHookPoint *HP_rnd_uniform53_post; struct HPMHookPoint *HP_showmsg_init_pre; struct HPMHookPoint *HP_showmsg_init_post; struct HPMHookPoint *HP_showmsg_final_pre; @@ -1400,6 +1448,28 @@ struct { struct HPMHookPoint *HP_sysinfo_init_post; struct HPMHookPoint *HP_sysinfo_final_pre; struct HPMHookPoint *HP_sysinfo_final_post; + struct HPMHookPoint *HP_thread_init_pre; + struct HPMHookPoint *HP_thread_init_post; + struct HPMHookPoint *HP_thread_final_pre; + struct HPMHookPoint *HP_thread_final_post; + struct HPMHookPoint *HP_thread_create_pre; + struct HPMHookPoint *HP_thread_create_post; + struct HPMHookPoint *HP_thread_create_opt_pre; + struct HPMHookPoint *HP_thread_create_opt_post; + struct HPMHookPoint *HP_thread_destroy_pre; + struct HPMHookPoint *HP_thread_destroy_post; + struct HPMHookPoint *HP_thread_self_pre; + struct HPMHookPoint *HP_thread_self_post; + struct HPMHookPoint *HP_thread_get_tid_pre; + struct HPMHookPoint *HP_thread_get_tid_post; + struct HPMHookPoint *HP_thread_wait_pre; + struct HPMHookPoint *HP_thread_wait_post; + struct HPMHookPoint *HP_thread_prio_set_pre; + struct HPMHookPoint *HP_thread_prio_set_post; + struct HPMHookPoint *HP_thread_prio_get_pre; + struct HPMHookPoint *HP_thread_prio_get_post; + struct HPMHookPoint *HP_thread_yield_pre; + struct HPMHookPoint *HP_thread_yield_post; struct HPMHookPoint *HP_timer_gettick_pre; struct HPMHookPoint *HP_timer_gettick_post; struct HPMHookPoint *HP_timer_gettick_nocache_pre; @@ -1811,6 +1881,10 @@ struct { int HP_DB_init_post; int HP_DB_final_pre; int HP_DB_final_post; + int HP_des_decrypt_block_pre; + int HP_des_decrypt_block_post; + int HP_des_decrypt_pre; + int HP_des_decrypt_post; int HP_geoip_getcountry_pre; int HP_geoip_getcountry_post; int HP_geoip_final_pre; @@ -2555,6 +2629,32 @@ struct { int HP_mapindex_id2name_post; int HP_mapindex_check_default_pre; int HP_mapindex_check_default_post; + int HP_md5_string_pre; + int HP_md5_string_post; + int HP_md5_binary_pre; + int HP_md5_binary_post; + int HP_md5_salt_pre; + int HP_md5_salt_post; + int HP_mutex_create_pre; + int HP_mutex_create_post; + int HP_mutex_destroy_pre; + int HP_mutex_destroy_post; + int HP_mutex_lock_pre; + int HP_mutex_lock_post; + int HP_mutex_trylock_pre; + int HP_mutex_trylock_post; + int HP_mutex_unlock_pre; + int HP_mutex_unlock_post; + int HP_mutex_cond_create_pre; + int HP_mutex_cond_create_post; + int HP_mutex_cond_destroy_pre; + int HP_mutex_cond_destroy_post; + int HP_mutex_cond_wait_pre; + int HP_mutex_cond_wait_post; + int HP_mutex_cond_signal_pre; + int HP_mutex_cond_signal_post; + int HP_mutex_cond_broadcast_pre; + int HP_mutex_cond_broadcast_post; int HP_nullpo_assert_report_pre; int HP_nullpo_assert_report_post; int HP_pincode_handle_pre; @@ -2577,6 +2677,22 @@ struct { int HP_pincode_check_post; int HP_pincode_config_read_pre; int HP_pincode_config_read_post; + int HP_rnd_init_pre; + int HP_rnd_init_post; + int HP_rnd_final_pre; + int HP_rnd_final_post; + int HP_rnd_seed_pre; + int HP_rnd_seed_post; + int HP_rnd_random_pre; + int HP_rnd_random_post; + int HP_rnd_roll_pre; + int HP_rnd_roll_post; + int HP_rnd_value_pre; + int HP_rnd_value_post; + int HP_rnd_uniform_pre; + int HP_rnd_uniform_post; + int HP_rnd_uniform53_pre; + int HP_rnd_uniform53_post; int HP_showmsg_init_pre; int HP_showmsg_init_post; int HP_showmsg_final_pre; @@ -2805,6 +2921,28 @@ struct { int HP_sysinfo_init_post; int HP_sysinfo_final_pre; int HP_sysinfo_final_post; + int HP_thread_init_pre; + int HP_thread_init_post; + int HP_thread_final_pre; + int HP_thread_final_post; + int HP_thread_create_pre; + int HP_thread_create_post; + int HP_thread_create_opt_pre; + int HP_thread_create_opt_post; + int HP_thread_destroy_pre; + int HP_thread_destroy_post; + int HP_thread_self_pre; + int HP_thread_self_post; + int HP_thread_get_tid_pre; + int HP_thread_get_tid_post; + int HP_thread_wait_pre; + int HP_thread_wait_post; + int HP_thread_prio_set_pre; + int HP_thread_prio_set_post; + int HP_thread_prio_get_pre; + int HP_thread_prio_get_post; + int HP_thread_yield_pre; + int HP_thread_yield_post; int HP_timer_gettick_pre; int HP_timer_gettick_post; int HP_timer_gettick_nocache_pre; @@ -2840,6 +2978,7 @@ struct { struct console_interface console; struct core_interface core; struct db_interface DB; + struct des_interface des; struct geoip_interface geoip; struct inter_auction_interface inter_auction; struct inter_elemental_interface inter_elemental; @@ -2857,8 +2996,11 @@ struct { struct malloc_interface iMalloc; struct mapif_interface mapif; struct mapindex_interface mapindex; + struct md5_interface md5; + struct mutex_interface mutex; struct nullpo_interface nullpo; struct pincode_interface pincode; + struct rnd_interface rnd; struct showmsg_interface showmsg; struct socket_interface sockt; struct sql_interface SQL; @@ -2866,5 +3008,6 @@ struct { struct strlib_interface strlib; struct sv_interface sv; struct sysinfo_interface sysinfo; + struct thread_interface thread; struct timer_interface timer; } source; diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc index daa54e969..4371cf81a 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc @@ -23,6 +23,8 @@ * as it will get overwritten. */ +/* GENERATED FILE DO NOT EDIT */ + struct HookingPointData HookingPoints[] = { /* HCache_interface */ { HP_POP(HCache->init, HP_HCache_init) }, @@ -221,6 +223,9 @@ struct HookingPointData HookingPoints[] = { { HP_POP(DB->data2ptr, HP_DB_data2ptr) }, { HP_POP(DB->init, HP_DB_init) }, { HP_POP(DB->final, HP_DB_final) }, +/* des_interface */ + { HP_POP(des->decrypt_block, HP_des_decrypt_block) }, + { HP_POP(des->decrypt, HP_des_decrypt) }, /* geoip_interface */ { HP_POP(geoip->getcountry, HP_geoip_getcountry) }, { HP_POP(geoip->final, HP_geoip_final) }, @@ -610,6 +615,21 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mapindex->name2id, HP_mapindex_name2id) }, { HP_POP(mapindex->id2name, HP_mapindex_id2name) }, { HP_POP(mapindex->check_default, HP_mapindex_check_default) }, +/* md5_interface */ + { HP_POP(md5->string, HP_md5_string) }, + { HP_POP(md5->binary, HP_md5_binary) }, + { HP_POP(md5->salt, HP_md5_salt) }, +/* mutex_interface */ + { HP_POP(mutex->create, HP_mutex_create) }, + { HP_POP(mutex->destroy, HP_mutex_destroy) }, + { HP_POP(mutex->lock, HP_mutex_lock) }, + { HP_POP(mutex->trylock, HP_mutex_trylock) }, + { HP_POP(mutex->unlock, HP_mutex_unlock) }, + { HP_POP(mutex->cond_create, HP_mutex_cond_create) }, + { HP_POP(mutex->cond_destroy, HP_mutex_cond_destroy) }, + { HP_POP(mutex->cond_wait, HP_mutex_cond_wait) }, + { HP_POP(mutex->cond_signal, HP_mutex_cond_signal) }, + { HP_POP(mutex->cond_broadcast, HP_mutex_cond_broadcast) }, /* nullpo_interface */ { HP_POP(nullpo->assert_report, HP_nullpo_assert_report) }, /* pincode_interface */ @@ -623,6 +643,15 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pincode->compare, HP_pincode_compare) }, { HP_POP(pincode->check, HP_pincode_check) }, { HP_POP(pincode->config_read, HP_pincode_config_read) }, +/* rnd_interface */ + { HP_POP(rnd->init, HP_rnd_init) }, + { HP_POP(rnd->final, HP_rnd_final) }, + { HP_POP(rnd->seed, HP_rnd_seed) }, + { HP_POP(rnd->random, HP_rnd_random) }, + { HP_POP(rnd->roll, HP_rnd_roll) }, + { HP_POP(rnd->value, HP_rnd_value) }, + { HP_POP(rnd->uniform, HP_rnd_uniform) }, + { HP_POP(rnd->uniform53, HP_rnd_uniform53) }, /* showmsg_interface */ { HP_POP(showmsg->init, HP_showmsg_init) }, { HP_POP(showmsg->final, HP_showmsg_final) }, @@ -744,6 +773,18 @@ struct HookingPointData HookingPoints[] = { { HP_POP(sysinfo->is_superuser, HP_sysinfo_is_superuser) }, { HP_POP(sysinfo->init, HP_sysinfo_init) }, { HP_POP(sysinfo->final, HP_sysinfo_final) }, +/* thread_interface */ + { HP_POP(thread->init, HP_thread_init) }, + { HP_POP(thread->final, HP_thread_final) }, + { HP_POP(thread->create, HP_thread_create) }, + { HP_POP(thread->create_opt, HP_thread_create_opt) }, + { HP_POP(thread->destroy, HP_thread_destroy) }, + { HP_POP(thread->self, HP_thread_self) }, + { HP_POP(thread->get_tid, HP_thread_get_tid) }, + { HP_POP(thread->wait, HP_thread_wait) }, + { HP_POP(thread->prio_set, HP_thread_prio_set) }, + { HP_POP(thread->prio_get, HP_thread_prio_get) }, + { HP_POP(thread->yield, HP_thread_yield) }, /* timer_interface */ { HP_POP(timer->gettick, HP_timer_gettick) }, { HP_POP(timer->gettick_nocache, HP_timer_gettick_nocache) }, diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc index df277f3d9..aecffbecd 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc @@ -23,6 +23,8 @@ * as it will get overwritten. */ +/* GENERATED FILE DO NOT EDIT */ + /* HCache_interface */ void HP_HCache_init(void) { int hIndex = 0; @@ -5098,6 +5100,59 @@ void HP_DB_final(void) { } return; } +/* des_interface */ +void HP_des_decrypt_block(struct des_bit64 *block) { + int hIndex = 0; + if( HPMHooks.count.HP_des_decrypt_block_pre ) { + void (*preHookFunc) (struct des_bit64 **block); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_des_decrypt_block_pre[hIndex].func; + preHookFunc(&block); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.des.decrypt_block(block); + } + if( HPMHooks.count.HP_des_decrypt_block_post ) { + void (*postHookFunc) (struct des_bit64 *block); + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_des_decrypt_block_post[hIndex].func; + postHookFunc(block); + } + } + return; +} +void HP_des_decrypt(unsigned char *data, size_t size) { + int hIndex = 0; + if( HPMHooks.count.HP_des_decrypt_pre ) { + void (*preHookFunc) (unsigned char **data, size_t *size); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_des_decrypt_pre[hIndex].func; + preHookFunc(&data, &size); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.des.decrypt(data, size); + } + if( HPMHooks.count.HP_des_decrypt_post ) { + void (*postHookFunc) (unsigned char *data, size_t size); + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_des_decrypt_post[hIndex].func; + postHookFunc(data, size); + } + } + return; +} /* geoip_interface */ const char* HP_geoip_getcountry(uint32 ipnum) { int hIndex = 0; @@ -15065,6 +15120,349 @@ bool HP_mapindex_check_default(void) { } return retVal___; } +/* md5_interface */ +void HP_md5_string(const char *string, char *output) { + int hIndex = 0; + if( HPMHooks.count.HP_md5_string_pre ) { + void (*preHookFunc) (const char **string, char **output); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_string_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_md5_string_pre[hIndex].func; + preHookFunc(&string, &output); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.md5.string(string, output); + } + if( HPMHooks.count.HP_md5_string_post ) { + void (*postHookFunc) (const char *string, char *output); + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_string_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_md5_string_post[hIndex].func; + postHookFunc(string, output); + } + } + return; +} +void HP_md5_binary(const char *string, unsigned char *output) { + int hIndex = 0; + if( HPMHooks.count.HP_md5_binary_pre ) { + void (*preHookFunc) (const char **string, unsigned char **output); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_md5_binary_pre[hIndex].func; + preHookFunc(&string, &output); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.md5.binary(string, output); + } + if( HPMHooks.count.HP_md5_binary_post ) { + void (*postHookFunc) (const char *string, unsigned char *output); + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_md5_binary_post[hIndex].func; + postHookFunc(string, output); + } + } + return; +} +void HP_md5_salt(int len, char *output) { + int hIndex = 0; + if( HPMHooks.count.HP_md5_salt_pre ) { + void (*preHookFunc) (int *len, char **output); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_salt_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_md5_salt_pre[hIndex].func; + preHookFunc(&len, &output); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.md5.salt(len, output); + } + if( HPMHooks.count.HP_md5_salt_post ) { + void (*postHookFunc) (int len, char *output); + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_salt_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_md5_salt_post[hIndex].func; + postHookFunc(len, output); + } + } + return; +} +/* mutex_interface */ +struct mutex_data* HP_mutex_create(void) { + int hIndex = 0; + struct mutex_data* retVal___ = NULL; + if( HPMHooks.count.HP_mutex_create_pre ) { + struct mutex_data* (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_create_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mutex.create(); + } + if( HPMHooks.count.HP_mutex_create_post ) { + struct mutex_data* (*postHookFunc) (struct mutex_data* retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_create_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +void HP_mutex_destroy(struct mutex_data *m) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_destroy_pre ) { + void (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_destroy_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_destroy_pre[hIndex].func; + preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.destroy(m); + } + if( HPMHooks.count.HP_mutex_destroy_post ) { + void (*postHookFunc) (struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_destroy_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_destroy_post[hIndex].func; + postHookFunc(m); + } + } + return; +} +void HP_mutex_lock(struct mutex_data *m) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_lock_pre ) { + void (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_lock_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_lock_pre[hIndex].func; + preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.lock(m); + } + if( HPMHooks.count.HP_mutex_lock_post ) { + void (*postHookFunc) (struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_lock_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_lock_post[hIndex].func; + postHookFunc(m); + } + } + return; +} +bool HP_mutex_trylock(struct mutex_data *m) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_mutex_trylock_pre ) { + bool (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_trylock_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_trylock_pre[hIndex].func; + retVal___ = preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mutex.trylock(m); + } + if( HPMHooks.count.HP_mutex_trylock_post ) { + bool (*postHookFunc) (bool retVal___, struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_trylock_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_trylock_post[hIndex].func; + retVal___ = postHookFunc(retVal___, m); + } + } + return retVal___; +} +void HP_mutex_unlock(struct mutex_data *m) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_unlock_pre ) { + void (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_unlock_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_unlock_pre[hIndex].func; + preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.unlock(m); + } + if( HPMHooks.count.HP_mutex_unlock_post ) { + void (*postHookFunc) (struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_unlock_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_unlock_post[hIndex].func; + postHookFunc(m); + } + } + return; +} +struct cond_data* HP_mutex_cond_create(void) { + int hIndex = 0; + struct cond_data* retVal___ = NULL; + if( HPMHooks.count.HP_mutex_cond_create_pre ) { + struct cond_data* (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_create_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mutex.cond_create(); + } + if( HPMHooks.count.HP_mutex_cond_create_post ) { + struct cond_data* (*postHookFunc) (struct cond_data* retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_create_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +void HP_mutex_cond_destroy(struct cond_data *c) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_destroy_pre ) { + void (*preHookFunc) (struct cond_data **c); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_destroy_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_destroy_pre[hIndex].func; + preHookFunc(&c); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_destroy(c); + } + if( HPMHooks.count.HP_mutex_cond_destroy_post ) { + void (*postHookFunc) (struct cond_data *c); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_destroy_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_destroy_post[hIndex].func; + postHookFunc(c); + } + } + return; +} +void HP_mutex_cond_wait(struct cond_data *c, struct mutex_data *m, sysint timeout_ticks) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_wait_pre ) { + void (*preHookFunc) (struct cond_data **c, struct mutex_data **m, sysint *timeout_ticks); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_wait_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_wait_pre[hIndex].func; + preHookFunc(&c, &m, &timeout_ticks); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_wait(c, m, timeout_ticks); + } + if( HPMHooks.count.HP_mutex_cond_wait_post ) { + void (*postHookFunc) (struct cond_data *c, struct mutex_data *m, sysint timeout_ticks); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_wait_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_wait_post[hIndex].func; + postHookFunc(c, m, timeout_ticks); + } + } + return; +} +void HP_mutex_cond_signal(struct cond_data *c) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_signal_pre ) { + void (*preHookFunc) (struct cond_data **c); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_signal_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_signal_pre[hIndex].func; + preHookFunc(&c); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_signal(c); + } + if( HPMHooks.count.HP_mutex_cond_signal_post ) { + void (*postHookFunc) (struct cond_data *c); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_signal_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_signal_post[hIndex].func; + postHookFunc(c); + } + } + return; +} +void HP_mutex_cond_broadcast(struct cond_data *c) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_broadcast_pre ) { + void (*preHookFunc) (struct cond_data **c); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_broadcast_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_broadcast_pre[hIndex].func; + preHookFunc(&c); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_broadcast(c); + } + if( HPMHooks.count.HP_mutex_cond_broadcast_post ) { + void (*postHookFunc) (struct cond_data *c); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_broadcast_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_broadcast_post[hIndex].func; + postHookFunc(c); + } + } + return; +} /* nullpo_interface */ void HP_nullpo_assert_report(const char *file, int line, const char *func, const char *targetname, const char *title) { int hIndex = 0; @@ -15355,6 +15753,220 @@ bool HP_pincode_config_read(char *w1, char *w2) { } return retVal___; } +/* rnd_interface */ +void HP_rnd_init(void) { + int hIndex = 0; + if( HPMHooks.count.HP_rnd_init_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_init_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_init_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.rnd.init(); + } + if( HPMHooks.count.HP_rnd_init_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_init_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_init_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_rnd_final(void) { + int hIndex = 0; + if( HPMHooks.count.HP_rnd_final_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_final_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_final_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.rnd.final(); + } + if( HPMHooks.count.HP_rnd_final_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_final_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_rnd_seed(uint32 seed) { + int hIndex = 0; + if( HPMHooks.count.HP_rnd_seed_pre ) { + void (*preHookFunc) (uint32 *seed); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_seed_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_seed_pre[hIndex].func; + preHookFunc(&seed); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.rnd.seed(seed); + } + if( HPMHooks.count.HP_rnd_seed_post ) { + void (*postHookFunc) (uint32 seed); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_seed_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_seed_post[hIndex].func; + postHookFunc(seed); + } + } + return; +} +int32 HP_rnd_random(void) { + int hIndex = 0; + int32 retVal___ = 0; + if( HPMHooks.count.HP_rnd_random_pre ) { + int32 (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_random_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_random_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.random(); + } + if( HPMHooks.count.HP_rnd_random_post ) { + int32 (*postHookFunc) (int32 retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_random_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_random_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +uint32 HP_rnd_roll(uint32 dice_faces) { + int hIndex = 0; + uint32 retVal___ = 0; + if( HPMHooks.count.HP_rnd_roll_pre ) { + uint32 (*preHookFunc) (uint32 *dice_faces); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_roll_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_roll_pre[hIndex].func; + retVal___ = preHookFunc(&dice_faces); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.roll(dice_faces); + } + if( HPMHooks.count.HP_rnd_roll_post ) { + uint32 (*postHookFunc) (uint32 retVal___, uint32 dice_faces); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_roll_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_roll_post[hIndex].func; + retVal___ = postHookFunc(retVal___, dice_faces); + } + } + return retVal___; +} +int32 HP_rnd_value(int32 min, int32 max) { + int hIndex = 0; + int32 retVal___ = 0; + if( HPMHooks.count.HP_rnd_value_pre ) { + int32 (*preHookFunc) (int32 *min, int32 *max); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_value_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_value_pre[hIndex].func; + retVal___ = preHookFunc(&min, &max); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.value(min, max); + } + if( HPMHooks.count.HP_rnd_value_post ) { + int32 (*postHookFunc) (int32 retVal___, int32 min, int32 max); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_value_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_value_post[hIndex].func; + retVal___ = postHookFunc(retVal___, min, max); + } + } + return retVal___; +} +double HP_rnd_uniform(void) { + int hIndex = 0; + double retVal___ = 0.; + if( HPMHooks.count.HP_rnd_uniform_pre ) { + double (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_uniform_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.uniform(); + } + if( HPMHooks.count.HP_rnd_uniform_post ) { + double (*postHookFunc) (double retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_uniform_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +double HP_rnd_uniform53(void) { + int hIndex = 0; + double retVal___ = 0.; + if( HPMHooks.count.HP_rnd_uniform53_pre ) { + double (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform53_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_uniform53_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.uniform53(); + } + if( HPMHooks.count.HP_rnd_uniform53_post ) { + double (*postHookFunc) (double retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform53_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_uniform53_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} /* showmsg_interface */ void HP_showmsg_init(void) { int hIndex = 0; @@ -18438,6 +19050,299 @@ void HP_sysinfo_final(void) { } return; } +/* thread_interface */ +void HP_thread_init(void) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_init_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_init_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_init_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.init(); + } + if( HPMHooks.count.HP_thread_init_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_init_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_init_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_thread_final(void) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_final_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_final_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_final_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.final(); + } + if( HPMHooks.count.HP_thread_final_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_final_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +struct thread_handle* HP_thread_create(threadFunc entry_point, void *param) { + int hIndex = 0; + struct thread_handle* retVal___ = NULL; + if( HPMHooks.count.HP_thread_create_pre ) { + struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_create_pre[hIndex].func; + retVal___ = preHookFunc(&entry_point, ¶m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.create(entry_point, param); + } + if( HPMHooks.count.HP_thread_create_post ) { + struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_create_post[hIndex].func; + retVal___ = postHookFunc(retVal___, entry_point, param); + } + } + return retVal___; +} +struct thread_handle* HP_thread_create_opt(threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio) { + int hIndex = 0; + struct thread_handle* retVal___ = NULL; + if( HPMHooks.count.HP_thread_create_opt_pre ) { + struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param, size_t *stack_size, enum thread_priority *prio); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_create_opt_pre[hIndex].func; + retVal___ = preHookFunc(&entry_point, ¶m, &stack_size, &prio); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.create_opt(entry_point, param, stack_size, prio); + } + if( HPMHooks.count.HP_thread_create_opt_post ) { + struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_create_opt_post[hIndex].func; + retVal___ = postHookFunc(retVal___, entry_point, param, stack_size, prio); + } + } + return retVal___; +} +void HP_thread_destroy(struct thread_handle *handle) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_destroy_pre ) { + void (*preHookFunc) (struct thread_handle **handle); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_destroy_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_destroy_pre[hIndex].func; + preHookFunc(&handle); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.destroy(handle); + } + if( HPMHooks.count.HP_thread_destroy_post ) { + void (*postHookFunc) (struct thread_handle *handle); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_destroy_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_destroy_post[hIndex].func; + postHookFunc(handle); + } + } + return; +} +struct thread_handle* HP_thread_self(void) { + int hIndex = 0; + struct thread_handle* retVal___ = NULL; + if( HPMHooks.count.HP_thread_self_pre ) { + struct thread_handle* (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_self_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.self(); + } + if( HPMHooks.count.HP_thread_self_post ) { + struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_self_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +int HP_thread_get_tid(void) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_thread_get_tid_pre ) { + int (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_get_tid_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_get_tid_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.get_tid(); + } + if( HPMHooks.count.HP_thread_get_tid_post ) { + int (*postHookFunc) (int retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_get_tid_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_get_tid_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +bool HP_thread_wait(struct thread_handle *handle, void **out_exit_code) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_thread_wait_pre ) { + bool (*preHookFunc) (struct thread_handle **handle, void ***out_exit_code); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_wait_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_wait_pre[hIndex].func; + retVal___ = preHookFunc(&handle, &out_exit_code); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.wait(handle, out_exit_code); + } + if( HPMHooks.count.HP_thread_wait_post ) { + bool (*postHookFunc) (bool retVal___, struct thread_handle *handle, void **out_exit_code); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_wait_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_wait_post[hIndex].func; + retVal___ = postHookFunc(retVal___, handle, out_exit_code); + } + } + return retVal___; +} +void HP_thread_prio_set(struct thread_handle *handle, enum thread_priority prio) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_prio_set_pre ) { + void (*preHookFunc) (struct thread_handle **handle, enum thread_priority *prio); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_set_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_prio_set_pre[hIndex].func; + preHookFunc(&handle, &prio); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.prio_set(handle, prio); + } + if( HPMHooks.count.HP_thread_prio_set_post ) { + void (*postHookFunc) (struct thread_handle *handle, enum thread_priority prio); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_set_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_prio_set_post[hIndex].func; + postHookFunc(handle, prio); + } + } + return; +} +enum thread_priority HP_thread_prio_get(struct thread_handle *handle) { + int hIndex = 0; + enum thread_priority retVal___ = THREADPRIO_NORMAL; + if( HPMHooks.count.HP_thread_prio_get_pre ) { + enum thread_priority (*preHookFunc) (struct thread_handle **handle); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_get_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_prio_get_pre[hIndex].func; + retVal___ = preHookFunc(&handle); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.prio_get(handle); + } + if( HPMHooks.count.HP_thread_prio_get_post ) { + enum thread_priority (*postHookFunc) (enum thread_priority retVal___, struct thread_handle *handle); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_get_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_prio_get_post[hIndex].func; + retVal___ = postHookFunc(retVal___, handle); + } + } + return retVal___; +} +void HP_thread_yield(void) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_yield_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_yield_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_yield_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.yield(); + } + if( HPMHooks.count.HP_thread_yield_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_yield_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_yield_post[hIndex].func; + postHookFunc(); + } + } + return; +} /* timer_interface */ int64 HP_timer_gettick(void) { int hIndex = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_char.sources.inc b/src/plugins/HPMHooking/HPMHooking_char.sources.inc index d14117add..54ae8f030 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.sources.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.sources.inc @@ -23,12 +23,15 @@ * as it will get overwritten. */ +/* GENERATED FILE DO NOT EDIT */ + memcpy(&HPMHooks.source.HCache, HCache, sizeof(struct HCache_interface)); memcpy(&HPMHooks.source.chr, chr, sizeof(struct char_interface)); memcpy(&HPMHooks.source.cmdline, cmdline, sizeof(struct cmdline_interface)); memcpy(&HPMHooks.source.console, console, sizeof(struct console_interface)); memcpy(&HPMHooks.source.core, core, sizeof(struct core_interface)); memcpy(&HPMHooks.source.DB, DB, sizeof(struct db_interface)); +memcpy(&HPMHooks.source.des, des, sizeof(struct des_interface)); memcpy(&HPMHooks.source.geoip, geoip, sizeof(struct geoip_interface)); memcpy(&HPMHooks.source.inter_auction, inter_auction, sizeof(struct inter_auction_interface)); memcpy(&HPMHooks.source.inter_elemental, inter_elemental, sizeof(struct inter_elemental_interface)); @@ -46,8 +49,11 @@ memcpy(&HPMHooks.source.loginif, loginif, sizeof(struct loginif_interface)); memcpy(&HPMHooks.source.iMalloc, iMalloc, sizeof(struct malloc_interface)); memcpy(&HPMHooks.source.mapif, mapif, sizeof(struct mapif_interface)); memcpy(&HPMHooks.source.mapindex, mapindex, sizeof(struct mapindex_interface)); +memcpy(&HPMHooks.source.md5, md5, sizeof(struct md5_interface)); +memcpy(&HPMHooks.source.mutex, mutex, sizeof(struct mutex_interface)); memcpy(&HPMHooks.source.nullpo, nullpo, sizeof(struct nullpo_interface)); memcpy(&HPMHooks.source.pincode, pincode, sizeof(struct pincode_interface)); +memcpy(&HPMHooks.source.rnd, rnd, sizeof(struct rnd_interface)); memcpy(&HPMHooks.source.showmsg, showmsg, sizeof(struct showmsg_interface)); memcpy(&HPMHooks.source.sockt, sockt, sizeof(struct socket_interface)); memcpy(&HPMHooks.source.SQL, SQL, sizeof(struct sql_interface)); @@ -55,4 +61,5 @@ memcpy(&HPMHooks.source.StrBuf, StrBuf, sizeof(struct stringbuf_interface)); memcpy(&HPMHooks.source.strlib, strlib, sizeof(struct strlib_interface)); memcpy(&HPMHooks.source.sv, sv, sizeof(struct sv_interface)); memcpy(&HPMHooks.source.sysinfo, sysinfo, sizeof(struct sysinfo_interface)); +memcpy(&HPMHooks.source.thread, thread, sizeof(struct thread_interface)); memcpy(&HPMHooks.source.timer, timer, sizeof(struct timer_interface)); diff --git a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc index 88e4f51dd..b97b6ea7f 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc @@ -23,6 +23,8 @@ * as it will get overwritten. */ +/* GENERATED FILE DO NOT EDIT */ + struct { struct HPMHookPoint *HP_HCache_init_pre; struct HPMHookPoint *HP_HCache_init_post; @@ -90,6 +92,10 @@ struct { struct HPMHookPoint *HP_DB_init_post; struct HPMHookPoint *HP_DB_final_pre; struct HPMHookPoint *HP_DB_final_post; + struct HPMHookPoint *HP_des_decrypt_block_pre; + struct HPMHookPoint *HP_des_decrypt_block_post; + struct HPMHookPoint *HP_des_decrypt_pre; + struct HPMHookPoint *HP_des_decrypt_post; struct HPMHookPoint *HP_lclif_init_pre; struct HPMHookPoint *HP_lclif_init_post; struct HPMHookPoint *HP_lclif_final_pre; @@ -398,8 +404,50 @@ struct { struct HPMHookPoint *HP_iMalloc_post_shutdown_post; struct HPMHookPoint *HP_iMalloc_init_messages_pre; struct HPMHookPoint *HP_iMalloc_init_messages_post; + struct HPMHookPoint *HP_md5_string_pre; + struct HPMHookPoint *HP_md5_string_post; + struct HPMHookPoint *HP_md5_binary_pre; + struct HPMHookPoint *HP_md5_binary_post; + struct HPMHookPoint *HP_md5_salt_pre; + struct HPMHookPoint *HP_md5_salt_post; + struct HPMHookPoint *HP_mutex_create_pre; + struct HPMHookPoint *HP_mutex_create_post; + struct HPMHookPoint *HP_mutex_destroy_pre; + struct HPMHookPoint *HP_mutex_destroy_post; + struct HPMHookPoint *HP_mutex_lock_pre; + struct HPMHookPoint *HP_mutex_lock_post; + struct HPMHookPoint *HP_mutex_trylock_pre; + struct HPMHookPoint *HP_mutex_trylock_post; + struct HPMHookPoint *HP_mutex_unlock_pre; + struct HPMHookPoint *HP_mutex_unlock_post; + struct HPMHookPoint *HP_mutex_cond_create_pre; + struct HPMHookPoint *HP_mutex_cond_create_post; + struct HPMHookPoint *HP_mutex_cond_destroy_pre; + struct HPMHookPoint *HP_mutex_cond_destroy_post; + struct HPMHookPoint *HP_mutex_cond_wait_pre; + struct HPMHookPoint *HP_mutex_cond_wait_post; + struct HPMHookPoint *HP_mutex_cond_signal_pre; + struct HPMHookPoint *HP_mutex_cond_signal_post; + struct HPMHookPoint *HP_mutex_cond_broadcast_pre; + struct HPMHookPoint *HP_mutex_cond_broadcast_post; struct HPMHookPoint *HP_nullpo_assert_report_pre; struct HPMHookPoint *HP_nullpo_assert_report_post; + struct HPMHookPoint *HP_rnd_init_pre; + struct HPMHookPoint *HP_rnd_init_post; + struct HPMHookPoint *HP_rnd_final_pre; + struct HPMHookPoint *HP_rnd_final_post; + struct HPMHookPoint *HP_rnd_seed_pre; + struct HPMHookPoint *HP_rnd_seed_post; + struct HPMHookPoint *HP_rnd_random_pre; + struct HPMHookPoint *HP_rnd_random_post; + struct HPMHookPoint *HP_rnd_roll_pre; + struct HPMHookPoint *HP_rnd_roll_post; + struct HPMHookPoint *HP_rnd_value_pre; + struct HPMHookPoint *HP_rnd_value_post; + struct HPMHookPoint *HP_rnd_uniform_pre; + struct HPMHookPoint *HP_rnd_uniform_post; + struct HPMHookPoint *HP_rnd_uniform53_pre; + struct HPMHookPoint *HP_rnd_uniform53_post; struct HPMHookPoint *HP_showmsg_init_pre; struct HPMHookPoint *HP_showmsg_init_post; struct HPMHookPoint *HP_showmsg_final_pre; @@ -628,6 +676,28 @@ struct { struct HPMHookPoint *HP_sysinfo_init_post; struct HPMHookPoint *HP_sysinfo_final_pre; struct HPMHookPoint *HP_sysinfo_final_post; + struct HPMHookPoint *HP_thread_init_pre; + struct HPMHookPoint *HP_thread_init_post; + struct HPMHookPoint *HP_thread_final_pre; + struct HPMHookPoint *HP_thread_final_post; + struct HPMHookPoint *HP_thread_create_pre; + struct HPMHookPoint *HP_thread_create_post; + struct HPMHookPoint *HP_thread_create_opt_pre; + struct HPMHookPoint *HP_thread_create_opt_post; + struct HPMHookPoint *HP_thread_destroy_pre; + struct HPMHookPoint *HP_thread_destroy_post; + struct HPMHookPoint *HP_thread_self_pre; + struct HPMHookPoint *HP_thread_self_post; + struct HPMHookPoint *HP_thread_get_tid_pre; + struct HPMHookPoint *HP_thread_get_tid_post; + struct HPMHookPoint *HP_thread_wait_pre; + struct HPMHookPoint *HP_thread_wait_post; + struct HPMHookPoint *HP_thread_prio_set_pre; + struct HPMHookPoint *HP_thread_prio_set_post; + struct HPMHookPoint *HP_thread_prio_get_pre; + struct HPMHookPoint *HP_thread_prio_get_post; + struct HPMHookPoint *HP_thread_yield_pre; + struct HPMHookPoint *HP_thread_yield_post; struct HPMHookPoint *HP_timer_gettick_pre; struct HPMHookPoint *HP_timer_gettick_post; struct HPMHookPoint *HP_timer_gettick_nocache_pre; @@ -723,6 +793,10 @@ struct { int HP_DB_init_post; int HP_DB_final_pre; int HP_DB_final_post; + int HP_des_decrypt_block_pre; + int HP_des_decrypt_block_post; + int HP_des_decrypt_pre; + int HP_des_decrypt_post; int HP_lclif_init_pre; int HP_lclif_init_post; int HP_lclif_final_pre; @@ -1031,8 +1105,50 @@ struct { int HP_iMalloc_post_shutdown_post; int HP_iMalloc_init_messages_pre; int HP_iMalloc_init_messages_post; + int HP_md5_string_pre; + int HP_md5_string_post; + int HP_md5_binary_pre; + int HP_md5_binary_post; + int HP_md5_salt_pre; + int HP_md5_salt_post; + int HP_mutex_create_pre; + int HP_mutex_create_post; + int HP_mutex_destroy_pre; + int HP_mutex_destroy_post; + int HP_mutex_lock_pre; + int HP_mutex_lock_post; + int HP_mutex_trylock_pre; + int HP_mutex_trylock_post; + int HP_mutex_unlock_pre; + int HP_mutex_unlock_post; + int HP_mutex_cond_create_pre; + int HP_mutex_cond_create_post; + int HP_mutex_cond_destroy_pre; + int HP_mutex_cond_destroy_post; + int HP_mutex_cond_wait_pre; + int HP_mutex_cond_wait_post; + int HP_mutex_cond_signal_pre; + int HP_mutex_cond_signal_post; + int HP_mutex_cond_broadcast_pre; + int HP_mutex_cond_broadcast_post; int HP_nullpo_assert_report_pre; int HP_nullpo_assert_report_post; + int HP_rnd_init_pre; + int HP_rnd_init_post; + int HP_rnd_final_pre; + int HP_rnd_final_post; + int HP_rnd_seed_pre; + int HP_rnd_seed_post; + int HP_rnd_random_pre; + int HP_rnd_random_post; + int HP_rnd_roll_pre; + int HP_rnd_roll_post; + int HP_rnd_value_pre; + int HP_rnd_value_post; + int HP_rnd_uniform_pre; + int HP_rnd_uniform_post; + int HP_rnd_uniform53_pre; + int HP_rnd_uniform53_post; int HP_showmsg_init_pre; int HP_showmsg_init_post; int HP_showmsg_final_pre; @@ -1261,6 +1377,28 @@ struct { int HP_sysinfo_init_post; int HP_sysinfo_final_pre; int HP_sysinfo_final_post; + int HP_thread_init_pre; + int HP_thread_init_post; + int HP_thread_final_pre; + int HP_thread_final_post; + int HP_thread_create_pre; + int HP_thread_create_post; + int HP_thread_create_opt_pre; + int HP_thread_create_opt_post; + int HP_thread_destroy_pre; + int HP_thread_destroy_post; + int HP_thread_self_pre; + int HP_thread_self_post; + int HP_thread_get_tid_pre; + int HP_thread_get_tid_post; + int HP_thread_wait_pre; + int HP_thread_wait_post; + int HP_thread_prio_set_pre; + int HP_thread_prio_set_post; + int HP_thread_prio_get_pre; + int HP_thread_prio_get_post; + int HP_thread_yield_pre; + int HP_thread_yield_post; int HP_timer_gettick_pre; int HP_timer_gettick_post; int HP_timer_gettick_nocache_pre; @@ -1295,12 +1433,16 @@ struct { struct console_interface console; struct core_interface core; struct db_interface DB; + struct des_interface des; struct lclif_interface lclif; struct lclif_interface_private PRIV__lclif; struct libconfig_interface libconfig; struct login_interface login; struct malloc_interface iMalloc; + struct md5_interface md5; + struct mutex_interface mutex; struct nullpo_interface nullpo; + struct rnd_interface rnd; struct showmsg_interface showmsg; struct socket_interface sockt; struct sql_interface SQL; @@ -1308,5 +1450,6 @@ struct { struct strlib_interface strlib; struct sv_interface sv; struct sysinfo_interface sysinfo; + struct thread_interface thread; struct timer_interface timer; } source; diff --git a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc index 21ca25355..2d3e37bc3 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc @@ -23,6 +23,8 @@ * as it will get overwritten. */ +/* GENERATED FILE DO NOT EDIT */ + struct HookingPointData HookingPoints[] = { /* HCache_interface */ { HP_POP(HCache->init, HP_HCache_init) }, @@ -62,6 +64,9 @@ struct HookingPointData HookingPoints[] = { { HP_POP(DB->data2ptr, HP_DB_data2ptr) }, { HP_POP(DB->init, HP_DB_init) }, { HP_POP(DB->final, HP_DB_final) }, +/* des_interface */ + { HP_POP(des->decrypt_block, HP_des_decrypt_block) }, + { HP_POP(des->decrypt, HP_des_decrypt) }, /* lclif_interface */ { HP_POP(lclif->init, HP_lclif_init) }, { HP_POP(lclif->final, HP_lclif_final) }, @@ -221,8 +226,32 @@ struct HookingPointData HookingPoints[] = { { HP_POP(iMalloc->usage, HP_iMalloc_usage) }, { HP_POP(iMalloc->post_shutdown, HP_iMalloc_post_shutdown) }, { HP_POP(iMalloc->init_messages, HP_iMalloc_init_messages) }, +/* md5_interface */ + { HP_POP(md5->string, HP_md5_string) }, + { HP_POP(md5->binary, HP_md5_binary) }, + { HP_POP(md5->salt, HP_md5_salt) }, +/* mutex_interface */ + { HP_POP(mutex->create, HP_mutex_create) }, + { HP_POP(mutex->destroy, HP_mutex_destroy) }, + { HP_POP(mutex->lock, HP_mutex_lock) }, + { HP_POP(mutex->trylock, HP_mutex_trylock) }, + { HP_POP(mutex->unlock, HP_mutex_unlock) }, + { HP_POP(mutex->cond_create, HP_mutex_cond_create) }, + { HP_POP(mutex->cond_destroy, HP_mutex_cond_destroy) }, + { HP_POP(mutex->cond_wait, HP_mutex_cond_wait) }, + { HP_POP(mutex->cond_signal, HP_mutex_cond_signal) }, + { HP_POP(mutex->cond_broadcast, HP_mutex_cond_broadcast) }, /* nullpo_interface */ { HP_POP(nullpo->assert_report, HP_nullpo_assert_report) }, +/* rnd_interface */ + { HP_POP(rnd->init, HP_rnd_init) }, + { HP_POP(rnd->final, HP_rnd_final) }, + { HP_POP(rnd->seed, HP_rnd_seed) }, + { HP_POP(rnd->random, HP_rnd_random) }, + { HP_POP(rnd->roll, HP_rnd_roll) }, + { HP_POP(rnd->value, HP_rnd_value) }, + { HP_POP(rnd->uniform, HP_rnd_uniform) }, + { HP_POP(rnd->uniform53, HP_rnd_uniform53) }, /* showmsg_interface */ { HP_POP(showmsg->init, HP_showmsg_init) }, { HP_POP(showmsg->final, HP_showmsg_final) }, @@ -344,6 +373,18 @@ struct HookingPointData HookingPoints[] = { { HP_POP(sysinfo->is_superuser, HP_sysinfo_is_superuser) }, { HP_POP(sysinfo->init, HP_sysinfo_init) }, { HP_POP(sysinfo->final, HP_sysinfo_final) }, +/* thread_interface */ + { HP_POP(thread->init, HP_thread_init) }, + { HP_POP(thread->final, HP_thread_final) }, + { HP_POP(thread->create, HP_thread_create) }, + { HP_POP(thread->create_opt, HP_thread_create_opt) }, + { HP_POP(thread->destroy, HP_thread_destroy) }, + { HP_POP(thread->self, HP_thread_self) }, + { HP_POP(thread->get_tid, HP_thread_get_tid) }, + { HP_POP(thread->wait, HP_thread_wait) }, + { HP_POP(thread->prio_set, HP_thread_prio_set) }, + { HP_POP(thread->prio_get, HP_thread_prio_get) }, + { HP_POP(thread->yield, HP_thread_yield) }, /* timer_interface */ { HP_POP(timer->gettick, HP_timer_gettick) }, { HP_POP(timer->gettick_nocache, HP_timer_gettick_nocache) }, diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc index 3c31062b8..013a56104 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc @@ -23,6 +23,8 @@ * as it will get overwritten. */ +/* GENERATED FILE DO NOT EDIT */ + /* HCache_interface */ void HP_HCache_init(void) { int hIndex = 0; @@ -909,6 +911,59 @@ void HP_DB_final(void) { } return; } +/* des_interface */ +void HP_des_decrypt_block(struct des_bit64 *block) { + int hIndex = 0; + if( HPMHooks.count.HP_des_decrypt_block_pre ) { + void (*preHookFunc) (struct des_bit64 **block); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_des_decrypt_block_pre[hIndex].func; + preHookFunc(&block); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.des.decrypt_block(block); + } + if( HPMHooks.count.HP_des_decrypt_block_post ) { + void (*postHookFunc) (struct des_bit64 *block); + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_des_decrypt_block_post[hIndex].func; + postHookFunc(block); + } + } + return; +} +void HP_des_decrypt(unsigned char *data, size_t size) { + int hIndex = 0; + if( HPMHooks.count.HP_des_decrypt_pre ) { + void (*preHookFunc) (unsigned char **data, size_t *size); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_des_decrypt_pre[hIndex].func; + preHookFunc(&data, &size); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.des.decrypt(data, size); + } + if( HPMHooks.count.HP_des_decrypt_post ) { + void (*postHookFunc) (unsigned char *data, size_t size); + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_des_decrypt_post[hIndex].func; + postHookFunc(data, size); + } + } + return; +} /* lclif_interface */ void HP_lclif_init(void) { int hIndex = 0; @@ -5034,6 +5089,349 @@ void HP_iMalloc_init_messages(void) { } return; } +/* md5_interface */ +void HP_md5_string(const char *string, char *output) { + int hIndex = 0; + if( HPMHooks.count.HP_md5_string_pre ) { + void (*preHookFunc) (const char **string, char **output); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_string_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_md5_string_pre[hIndex].func; + preHookFunc(&string, &output); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.md5.string(string, output); + } + if( HPMHooks.count.HP_md5_string_post ) { + void (*postHookFunc) (const char *string, char *output); + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_string_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_md5_string_post[hIndex].func; + postHookFunc(string, output); + } + } + return; +} +void HP_md5_binary(const char *string, unsigned char *output) { + int hIndex = 0; + if( HPMHooks.count.HP_md5_binary_pre ) { + void (*preHookFunc) (const char **string, unsigned char **output); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_md5_binary_pre[hIndex].func; + preHookFunc(&string, &output); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.md5.binary(string, output); + } + if( HPMHooks.count.HP_md5_binary_post ) { + void (*postHookFunc) (const char *string, unsigned char *output); + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_md5_binary_post[hIndex].func; + postHookFunc(string, output); + } + } + return; +} +void HP_md5_salt(int len, char *output) { + int hIndex = 0; + if( HPMHooks.count.HP_md5_salt_pre ) { + void (*preHookFunc) (int *len, char **output); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_salt_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_md5_salt_pre[hIndex].func; + preHookFunc(&len, &output); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.md5.salt(len, output); + } + if( HPMHooks.count.HP_md5_salt_post ) { + void (*postHookFunc) (int len, char *output); + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_salt_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_md5_salt_post[hIndex].func; + postHookFunc(len, output); + } + } + return; +} +/* mutex_interface */ +struct mutex_data* HP_mutex_create(void) { + int hIndex = 0; + struct mutex_data* retVal___ = NULL; + if( HPMHooks.count.HP_mutex_create_pre ) { + struct mutex_data* (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_create_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mutex.create(); + } + if( HPMHooks.count.HP_mutex_create_post ) { + struct mutex_data* (*postHookFunc) (struct mutex_data* retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_create_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +void HP_mutex_destroy(struct mutex_data *m) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_destroy_pre ) { + void (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_destroy_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_destroy_pre[hIndex].func; + preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.destroy(m); + } + if( HPMHooks.count.HP_mutex_destroy_post ) { + void (*postHookFunc) (struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_destroy_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_destroy_post[hIndex].func; + postHookFunc(m); + } + } + return; +} +void HP_mutex_lock(struct mutex_data *m) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_lock_pre ) { + void (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_lock_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_lock_pre[hIndex].func; + preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.lock(m); + } + if( HPMHooks.count.HP_mutex_lock_post ) { + void (*postHookFunc) (struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_lock_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_lock_post[hIndex].func; + postHookFunc(m); + } + } + return; +} +bool HP_mutex_trylock(struct mutex_data *m) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_mutex_trylock_pre ) { + bool (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_trylock_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_trylock_pre[hIndex].func; + retVal___ = preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mutex.trylock(m); + } + if( HPMHooks.count.HP_mutex_trylock_post ) { + bool (*postHookFunc) (bool retVal___, struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_trylock_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_trylock_post[hIndex].func; + retVal___ = postHookFunc(retVal___, m); + } + } + return retVal___; +} +void HP_mutex_unlock(struct mutex_data *m) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_unlock_pre ) { + void (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_unlock_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_unlock_pre[hIndex].func; + preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.unlock(m); + } + if( HPMHooks.count.HP_mutex_unlock_post ) { + void (*postHookFunc) (struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_unlock_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_unlock_post[hIndex].func; + postHookFunc(m); + } + } + return; +} +struct cond_data* HP_mutex_cond_create(void) { + int hIndex = 0; + struct cond_data* retVal___ = NULL; + if( HPMHooks.count.HP_mutex_cond_create_pre ) { + struct cond_data* (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_create_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mutex.cond_create(); + } + if( HPMHooks.count.HP_mutex_cond_create_post ) { + struct cond_data* (*postHookFunc) (struct cond_data* retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_create_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +void HP_mutex_cond_destroy(struct cond_data *c) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_destroy_pre ) { + void (*preHookFunc) (struct cond_data **c); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_destroy_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_destroy_pre[hIndex].func; + preHookFunc(&c); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_destroy(c); + } + if( HPMHooks.count.HP_mutex_cond_destroy_post ) { + void (*postHookFunc) (struct cond_data *c); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_destroy_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_destroy_post[hIndex].func; + postHookFunc(c); + } + } + return; +} +void HP_mutex_cond_wait(struct cond_data *c, struct mutex_data *m, sysint timeout_ticks) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_wait_pre ) { + void (*preHookFunc) (struct cond_data **c, struct mutex_data **m, sysint *timeout_ticks); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_wait_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_wait_pre[hIndex].func; + preHookFunc(&c, &m, &timeout_ticks); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_wait(c, m, timeout_ticks); + } + if( HPMHooks.count.HP_mutex_cond_wait_post ) { + void (*postHookFunc) (struct cond_data *c, struct mutex_data *m, sysint timeout_ticks); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_wait_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_wait_post[hIndex].func; + postHookFunc(c, m, timeout_ticks); + } + } + return; +} +void HP_mutex_cond_signal(struct cond_data *c) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_signal_pre ) { + void (*preHookFunc) (struct cond_data **c); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_signal_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_signal_pre[hIndex].func; + preHookFunc(&c); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_signal(c); + } + if( HPMHooks.count.HP_mutex_cond_signal_post ) { + void (*postHookFunc) (struct cond_data *c); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_signal_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_signal_post[hIndex].func; + postHookFunc(c); + } + } + return; +} +void HP_mutex_cond_broadcast(struct cond_data *c) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_broadcast_pre ) { + void (*preHookFunc) (struct cond_data **c); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_broadcast_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_broadcast_pre[hIndex].func; + preHookFunc(&c); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_broadcast(c); + } + if( HPMHooks.count.HP_mutex_cond_broadcast_post ) { + void (*postHookFunc) (struct cond_data *c); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_broadcast_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_broadcast_post[hIndex].func; + postHookFunc(c); + } + } + return; +} /* nullpo_interface */ void HP_nullpo_assert_report(const char *file, int line, const char *func, const char *targetname, const char *title) { int hIndex = 0; @@ -5061,6 +5459,220 @@ void HP_nullpo_assert_report(const char *file, int line, const char *func, const } return; } +/* rnd_interface */ +void HP_rnd_init(void) { + int hIndex = 0; + if( HPMHooks.count.HP_rnd_init_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_init_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_init_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.rnd.init(); + } + if( HPMHooks.count.HP_rnd_init_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_init_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_init_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_rnd_final(void) { + int hIndex = 0; + if( HPMHooks.count.HP_rnd_final_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_final_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_final_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.rnd.final(); + } + if( HPMHooks.count.HP_rnd_final_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_final_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_rnd_seed(uint32 seed) { + int hIndex = 0; + if( HPMHooks.count.HP_rnd_seed_pre ) { + void (*preHookFunc) (uint32 *seed); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_seed_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_seed_pre[hIndex].func; + preHookFunc(&seed); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.rnd.seed(seed); + } + if( HPMHooks.count.HP_rnd_seed_post ) { + void (*postHookFunc) (uint32 seed); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_seed_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_seed_post[hIndex].func; + postHookFunc(seed); + } + } + return; +} +int32 HP_rnd_random(void) { + int hIndex = 0; + int32 retVal___ = 0; + if( HPMHooks.count.HP_rnd_random_pre ) { + int32 (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_random_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_random_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.random(); + } + if( HPMHooks.count.HP_rnd_random_post ) { + int32 (*postHookFunc) (int32 retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_random_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_random_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +uint32 HP_rnd_roll(uint32 dice_faces) { + int hIndex = 0; + uint32 retVal___ = 0; + if( HPMHooks.count.HP_rnd_roll_pre ) { + uint32 (*preHookFunc) (uint32 *dice_faces); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_roll_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_roll_pre[hIndex].func; + retVal___ = preHookFunc(&dice_faces); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.roll(dice_faces); + } + if( HPMHooks.count.HP_rnd_roll_post ) { + uint32 (*postHookFunc) (uint32 retVal___, uint32 dice_faces); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_roll_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_roll_post[hIndex].func; + retVal___ = postHookFunc(retVal___, dice_faces); + } + } + return retVal___; +} +int32 HP_rnd_value(int32 min, int32 max) { + int hIndex = 0; + int32 retVal___ = 0; + if( HPMHooks.count.HP_rnd_value_pre ) { + int32 (*preHookFunc) (int32 *min, int32 *max); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_value_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_value_pre[hIndex].func; + retVal___ = preHookFunc(&min, &max); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.value(min, max); + } + if( HPMHooks.count.HP_rnd_value_post ) { + int32 (*postHookFunc) (int32 retVal___, int32 min, int32 max); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_value_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_value_post[hIndex].func; + retVal___ = postHookFunc(retVal___, min, max); + } + } + return retVal___; +} +double HP_rnd_uniform(void) { + int hIndex = 0; + double retVal___ = 0.; + if( HPMHooks.count.HP_rnd_uniform_pre ) { + double (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_uniform_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.uniform(); + } + if( HPMHooks.count.HP_rnd_uniform_post ) { + double (*postHookFunc) (double retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_uniform_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +double HP_rnd_uniform53(void) { + int hIndex = 0; + double retVal___ = 0.; + if( HPMHooks.count.HP_rnd_uniform53_pre ) { + double (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform53_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_uniform53_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.uniform53(); + } + if( HPMHooks.count.HP_rnd_uniform53_post ) { + double (*postHookFunc) (double retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform53_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_uniform53_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} /* showmsg_interface */ void HP_showmsg_init(void) { int hIndex = 0; @@ -8144,6 +8756,299 @@ void HP_sysinfo_final(void) { } return; } +/* thread_interface */ +void HP_thread_init(void) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_init_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_init_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_init_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.init(); + } + if( HPMHooks.count.HP_thread_init_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_init_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_init_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_thread_final(void) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_final_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_final_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_final_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.final(); + } + if( HPMHooks.count.HP_thread_final_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_final_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +struct thread_handle* HP_thread_create(threadFunc entry_point, void *param) { + int hIndex = 0; + struct thread_handle* retVal___ = NULL; + if( HPMHooks.count.HP_thread_create_pre ) { + struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_create_pre[hIndex].func; + retVal___ = preHookFunc(&entry_point, ¶m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.create(entry_point, param); + } + if( HPMHooks.count.HP_thread_create_post ) { + struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_create_post[hIndex].func; + retVal___ = postHookFunc(retVal___, entry_point, param); + } + } + return retVal___; +} +struct thread_handle* HP_thread_create_opt(threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio) { + int hIndex = 0; + struct thread_handle* retVal___ = NULL; + if( HPMHooks.count.HP_thread_create_opt_pre ) { + struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param, size_t *stack_size, enum thread_priority *prio); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_create_opt_pre[hIndex].func; + retVal___ = preHookFunc(&entry_point, ¶m, &stack_size, &prio); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.create_opt(entry_point, param, stack_size, prio); + } + if( HPMHooks.count.HP_thread_create_opt_post ) { + struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_create_opt_post[hIndex].func; + retVal___ = postHookFunc(retVal___, entry_point, param, stack_size, prio); + } + } + return retVal___; +} +void HP_thread_destroy(struct thread_handle *handle) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_destroy_pre ) { + void (*preHookFunc) (struct thread_handle **handle); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_destroy_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_destroy_pre[hIndex].func; + preHookFunc(&handle); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.destroy(handle); + } + if( HPMHooks.count.HP_thread_destroy_post ) { + void (*postHookFunc) (struct thread_handle *handle); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_destroy_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_destroy_post[hIndex].func; + postHookFunc(handle); + } + } + return; +} +struct thread_handle* HP_thread_self(void) { + int hIndex = 0; + struct thread_handle* retVal___ = NULL; + if( HPMHooks.count.HP_thread_self_pre ) { + struct thread_handle* (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_self_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.self(); + } + if( HPMHooks.count.HP_thread_self_post ) { + struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_self_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +int HP_thread_get_tid(void) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_thread_get_tid_pre ) { + int (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_get_tid_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_get_tid_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.get_tid(); + } + if( HPMHooks.count.HP_thread_get_tid_post ) { + int (*postHookFunc) (int retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_get_tid_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_get_tid_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +bool HP_thread_wait(struct thread_handle *handle, void **out_exit_code) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_thread_wait_pre ) { + bool (*preHookFunc) (struct thread_handle **handle, void ***out_exit_code); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_wait_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_wait_pre[hIndex].func; + retVal___ = preHookFunc(&handle, &out_exit_code); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.wait(handle, out_exit_code); + } + if( HPMHooks.count.HP_thread_wait_post ) { + bool (*postHookFunc) (bool retVal___, struct thread_handle *handle, void **out_exit_code); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_wait_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_wait_post[hIndex].func; + retVal___ = postHookFunc(retVal___, handle, out_exit_code); + } + } + return retVal___; +} +void HP_thread_prio_set(struct thread_handle *handle, enum thread_priority prio) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_prio_set_pre ) { + void (*preHookFunc) (struct thread_handle **handle, enum thread_priority *prio); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_set_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_prio_set_pre[hIndex].func; + preHookFunc(&handle, &prio); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.prio_set(handle, prio); + } + if( HPMHooks.count.HP_thread_prio_set_post ) { + void (*postHookFunc) (struct thread_handle *handle, enum thread_priority prio); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_set_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_prio_set_post[hIndex].func; + postHookFunc(handle, prio); + } + } + return; +} +enum thread_priority HP_thread_prio_get(struct thread_handle *handle) { + int hIndex = 0; + enum thread_priority retVal___ = THREADPRIO_NORMAL; + if( HPMHooks.count.HP_thread_prio_get_pre ) { + enum thread_priority (*preHookFunc) (struct thread_handle **handle); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_get_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_prio_get_pre[hIndex].func; + retVal___ = preHookFunc(&handle); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.prio_get(handle); + } + if( HPMHooks.count.HP_thread_prio_get_post ) { + enum thread_priority (*postHookFunc) (enum thread_priority retVal___, struct thread_handle *handle); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_get_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_prio_get_post[hIndex].func; + retVal___ = postHookFunc(retVal___, handle); + } + } + return retVal___; +} +void HP_thread_yield(void) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_yield_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_yield_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_yield_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.yield(); + } + if( HPMHooks.count.HP_thread_yield_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_yield_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_yield_post[hIndex].func; + postHookFunc(); + } + } + return; +} /* timer_interface */ int64 HP_timer_gettick(void) { int hIndex = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_login.sources.inc b/src/plugins/HPMHooking/HPMHooking_login.sources.inc index 1c1927619..6677a0c55 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.sources.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.sources.inc @@ -23,17 +23,23 @@ * as it will get overwritten. */ +/* GENERATED FILE DO NOT EDIT */ + memcpy(&HPMHooks.source.HCache, HCache, sizeof(struct HCache_interface)); memcpy(&HPMHooks.source.cmdline, cmdline, sizeof(struct cmdline_interface)); memcpy(&HPMHooks.source.console, console, sizeof(struct console_interface)); memcpy(&HPMHooks.source.core, core, sizeof(struct core_interface)); memcpy(&HPMHooks.source.DB, DB, sizeof(struct db_interface)); +memcpy(&HPMHooks.source.des, des, sizeof(struct des_interface)); memcpy(&HPMHooks.source.lclif, lclif, sizeof(struct lclif_interface)); memcpy(&HPMHooks.source.PRIV__lclif, lclif->p, sizeof(struct lclif_interface_private)); memcpy(&HPMHooks.source.libconfig, libconfig, sizeof(struct libconfig_interface)); memcpy(&HPMHooks.source.login, login, sizeof(struct login_interface)); memcpy(&HPMHooks.source.iMalloc, iMalloc, sizeof(struct malloc_interface)); +memcpy(&HPMHooks.source.md5, md5, sizeof(struct md5_interface)); +memcpy(&HPMHooks.source.mutex, mutex, sizeof(struct mutex_interface)); memcpy(&HPMHooks.source.nullpo, nullpo, sizeof(struct nullpo_interface)); +memcpy(&HPMHooks.source.rnd, rnd, sizeof(struct rnd_interface)); memcpy(&HPMHooks.source.showmsg, showmsg, sizeof(struct showmsg_interface)); memcpy(&HPMHooks.source.sockt, sockt, sizeof(struct socket_interface)); memcpy(&HPMHooks.source.SQL, SQL, sizeof(struct sql_interface)); @@ -41,4 +47,5 @@ memcpy(&HPMHooks.source.StrBuf, StrBuf, sizeof(struct stringbuf_interface)); memcpy(&HPMHooks.source.strlib, strlib, sizeof(struct strlib_interface)); memcpy(&HPMHooks.source.sv, sv, sizeof(struct sv_interface)); memcpy(&HPMHooks.source.sysinfo, sysinfo, sizeof(struct sysinfo_interface)); +memcpy(&HPMHooks.source.thread, thread, sizeof(struct thread_interface)); memcpy(&HPMHooks.source.timer, timer, sizeof(struct timer_interface)); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 1de0b6077..06c4acc50 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -23,6 +23,8 @@ * as it will get overwritten. */ +/* GENERATED FILE DO NOT EDIT */ + struct { struct HPMHookPoint *HP_HCache_init_pre; struct HPMHookPoint *HP_HCache_init_post; @@ -108,12 +110,16 @@ struct { struct HPMHookPoint *HP_battle_calc_attack_post; struct HPMHookPoint *HP_battle_calc_damage_pre; struct HPMHookPoint *HP_battle_calc_damage_post; + struct HPMHookPoint *HP_battle_calc_pc_damage_pre; + struct HPMHookPoint *HP_battle_calc_pc_damage_post; struct HPMHookPoint *HP_battle_calc_gvg_damage_pre; struct HPMHookPoint *HP_battle_calc_gvg_damage_post; struct HPMHookPoint *HP_battle_calc_bg_damage_pre; struct HPMHookPoint *HP_battle_calc_bg_damage_post; struct HPMHookPoint *HP_battle_weapon_attack_pre; struct HPMHookPoint *HP_battle_weapon_attack_post; + struct HPMHookPoint *HP_battle_check_arrows_pre; + struct HPMHookPoint *HP_battle_check_arrows_post; struct HPMHookPoint *HP_battle_calc_weapon_attack_pre; struct HPMHookPoint *HP_battle_calc_weapon_attack_post; struct HPMHookPoint *HP_battle_delay_damage_pre; @@ -832,6 +838,8 @@ struct { struct HPMHookPoint *HP_clif_skill_itemlistwindow_post; struct HPMHookPoint *HP_clif_sc_load_pre; struct HPMHookPoint *HP_clif_sc_load_post; + struct HPMHookPoint *HP_clif_sc_continue_pre; + struct HPMHookPoint *HP_clif_sc_continue_post; struct HPMHookPoint *HP_clif_sc_end_pre; struct HPMHookPoint *HP_clif_sc_end_post; struct HPMHookPoint *HP_clif_initialstatus_pre; @@ -894,8 +902,8 @@ struct { struct HPMHookPoint *HP_clif_skill_estimation_post; struct HPMHookPoint *HP_clif_skill_warppoint_pre; struct HPMHookPoint *HP_clif_skill_warppoint_post; - struct HPMHookPoint *HP_clif_skillcasting_pre; - struct HPMHookPoint *HP_clif_skillcasting_post; + struct HPMHookPoint *HP_clif_useskill_pre; + struct HPMHookPoint *HP_clif_useskill_post; struct HPMHookPoint *HP_clif_produce_effect_pre; struct HPMHookPoint *HP_clif_produce_effect_post; struct HPMHookPoint *HP_clif_devotion_pre; @@ -1390,6 +1398,10 @@ struct { struct HPMHookPoint *HP_clif_comparemergeitem_post; struct HPMHookPoint *HP_clif_ackmergeitems_pre; struct HPMHookPoint *HP_clif_ackmergeitems_post; + struct HPMHookPoint *HP_clif_isdisguised_pre; + struct HPMHookPoint *HP_clif_isdisguised_post; + struct HPMHookPoint *HP_clif_bl_type_pre; + struct HPMHookPoint *HP_clif_bl_type_post; struct HPMHookPoint *HP_clif_pWantToConnection_pre; struct HPMHookPoint *HP_clif_pWantToConnection_post; struct HPMHookPoint *HP_clif_pLoadEndAck_pre; @@ -1918,6 +1930,10 @@ struct { struct HPMHookPoint *HP_DB_init_post; struct HPMHookPoint *HP_DB_final_pre; struct HPMHookPoint *HP_DB_final_post; + struct HPMHookPoint *HP_des_decrypt_block_pre; + struct HPMHookPoint *HP_des_decrypt_block_post; + struct HPMHookPoint *HP_des_decrypt_pre; + struct HPMHookPoint *HP_des_decrypt_post; struct HPMHookPoint *HP_duel_create_pre; struct HPMHookPoint *HP_duel_create_post; struct HPMHookPoint *HP_duel_invite_pre; @@ -2000,6 +2016,20 @@ struct { struct HPMHookPoint *HP_elemental_ai_timer_post; struct HPMHookPoint *HP_elemental_read_db_pre; struct HPMHookPoint *HP_elemental_read_db_post; + struct HPMHookPoint *HP_grfio_init_pre; + struct HPMHookPoint *HP_grfio_init_post; + struct HPMHookPoint *HP_grfio_final_pre; + struct HPMHookPoint *HP_grfio_final_post; + struct HPMHookPoint *HP_grfio_reads_pre; + struct HPMHookPoint *HP_grfio_reads_post; + struct HPMHookPoint *HP_grfio_find_file_pre; + struct HPMHookPoint *HP_grfio_find_file_post; + struct HPMHookPoint *HP_grfio_crc32_pre; + struct HPMHookPoint *HP_grfio_crc32_post; + struct HPMHookPoint *HP_grfio_decode_zip_pre; + struct HPMHookPoint *HP_grfio_decode_zip_post; + struct HPMHookPoint *HP_grfio_encode_zip_pre; + struct HPMHookPoint *HP_grfio_encode_zip_post; struct HPMHookPoint *HP_guild_init_pre; struct HPMHookPoint *HP_guild_init_post; struct HPMHookPoint *HP_guild_final_pre; @@ -3300,6 +3330,12 @@ struct { struct HPMHookPoint *HP_mapreg_reload_post; struct HPMHookPoint *HP_mapreg_config_read_pre; struct HPMHookPoint *HP_mapreg_config_read_post; + struct HPMHookPoint *HP_md5_string_pre; + struct HPMHookPoint *HP_md5_string_post; + struct HPMHookPoint *HP_md5_binary_pre; + struct HPMHookPoint *HP_md5_binary_post; + struct HPMHookPoint *HP_md5_salt_pre; + struct HPMHookPoint *HP_md5_salt_post; struct HPMHookPoint *HP_mercenary_init_pre; struct HPMHookPoint *HP_mercenary_init_post; struct HPMHookPoint *HP_mercenary_class_pre; @@ -3556,6 +3592,26 @@ struct { struct HPMHookPoint *HP_mob_clear_spawninfo_post; struct HPMHookPoint *HP_mob_destroy_mob_db_pre; struct HPMHookPoint *HP_mob_destroy_mob_db_post; + struct HPMHookPoint *HP_mutex_create_pre; + struct HPMHookPoint *HP_mutex_create_post; + struct HPMHookPoint *HP_mutex_destroy_pre; + struct HPMHookPoint *HP_mutex_destroy_post; + struct HPMHookPoint *HP_mutex_lock_pre; + struct HPMHookPoint *HP_mutex_lock_post; + struct HPMHookPoint *HP_mutex_trylock_pre; + struct HPMHookPoint *HP_mutex_trylock_post; + struct HPMHookPoint *HP_mutex_unlock_pre; + struct HPMHookPoint *HP_mutex_unlock_post; + struct HPMHookPoint *HP_mutex_cond_create_pre; + struct HPMHookPoint *HP_mutex_cond_create_post; + struct HPMHookPoint *HP_mutex_cond_destroy_pre; + struct HPMHookPoint *HP_mutex_cond_destroy_post; + struct HPMHookPoint *HP_mutex_cond_wait_pre; + struct HPMHookPoint *HP_mutex_cond_wait_post; + struct HPMHookPoint *HP_mutex_cond_signal_pre; + struct HPMHookPoint *HP_mutex_cond_signal_post; + struct HPMHookPoint *HP_mutex_cond_broadcast_pre; + struct HPMHookPoint *HP_mutex_cond_broadcast_post; struct HPMHookPoint *HP_npc_chat_sub_pre; struct HPMHookPoint *HP_npc_chat_sub_post; struct HPMHookPoint *HP_npc_chat_finalize_pre; @@ -4490,6 +4546,22 @@ struct { struct HPMHookPoint *HP_quest_read_db_post; struct HPMHookPoint *HP_quest_read_db_sub_pre; struct HPMHookPoint *HP_quest_read_db_sub_post; + struct HPMHookPoint *HP_rnd_init_pre; + struct HPMHookPoint *HP_rnd_init_post; + struct HPMHookPoint *HP_rnd_final_pre; + struct HPMHookPoint *HP_rnd_final_post; + struct HPMHookPoint *HP_rnd_seed_pre; + struct HPMHookPoint *HP_rnd_seed_post; + struct HPMHookPoint *HP_rnd_random_pre; + struct HPMHookPoint *HP_rnd_random_post; + struct HPMHookPoint *HP_rnd_roll_pre; + struct HPMHookPoint *HP_rnd_roll_post; + struct HPMHookPoint *HP_rnd_value_pre; + struct HPMHookPoint *HP_rnd_value_post; + struct HPMHookPoint *HP_rnd_uniform_pre; + struct HPMHookPoint *HP_rnd_uniform_post; + struct HPMHookPoint *HP_rnd_uniform53_pre; + struct HPMHookPoint *HP_rnd_uniform53_post; struct HPMHookPoint *HP_script_init_pre; struct HPMHookPoint *HP_script_init_post; struct HPMHookPoint *HP_script_final_pre; @@ -4666,6 +4738,16 @@ struct { struct HPMHookPoint *HP_script_parse_variable_post; struct HPMHookPoint *HP_script_parse_simpleexpr_pre; struct HPMHookPoint *HP_script_parse_simpleexpr_post; + struct HPMHookPoint *HP_script_parse_simpleexpr_paren_pre; + struct HPMHookPoint *HP_script_parse_simpleexpr_paren_post; + struct HPMHookPoint *HP_script_parse_simpleexpr_number_pre; + struct HPMHookPoint *HP_script_parse_simpleexpr_number_post; + struct HPMHookPoint *HP_script_parse_simpleexpr_string_pre; + struct HPMHookPoint *HP_script_parse_simpleexpr_string_post; + struct HPMHookPoint *HP_script_parse_simpleexpr_name_pre; + struct HPMHookPoint *HP_script_parse_simpleexpr_name_post; + struct HPMHookPoint *HP_script_add_translatable_string_pre; + struct HPMHookPoint *HP_script_add_translatable_string_post; struct HPMHookPoint *HP_script_parse_expr_pre; struct HPMHookPoint *HP_script_parse_expr_post; struct HPMHookPoint *HP_script_parse_line_pre; @@ -4808,6 +4890,8 @@ struct { struct HPMHookPoint *HP_script_string_dup_post; struct HPMHookPoint *HP_script_load_translations_pre; struct HPMHookPoint *HP_script_load_translations_post; + struct HPMHookPoint *HP_script_load_translation_addstring_pre; + struct HPMHookPoint *HP_script_load_translation_addstring_post; struct HPMHookPoint *HP_script_load_translation_pre; struct HPMHookPoint *HP_script_load_translation_post; struct HPMHookPoint *HP_script_translation_db_destroyer_pre; @@ -5052,8 +5136,12 @@ struct { struct HPMHookPoint *HP_skill_enchant_elemental_end_post; struct HPMHookPoint *HP_skill_not_ok_pre; struct HPMHookPoint *HP_skill_not_ok_post; + struct HPMHookPoint *HP_skill_not_ok_unknown_pre; + struct HPMHookPoint *HP_skill_not_ok_unknown_post; struct HPMHookPoint *HP_skill_not_ok_hom_pre; struct HPMHookPoint *HP_skill_not_ok_hom_post; + struct HPMHookPoint *HP_skill_not_ok_hom_unknown_pre; + struct HPMHookPoint *HP_skill_not_ok_hom_unknown_post; struct HPMHookPoint *HP_skill_not_ok_mercenary_pre; struct HPMHookPoint *HP_skill_not_ok_mercenary_post; struct HPMHookPoint *HP_skill_chastle_mob_changetarget_pre; @@ -5064,6 +5152,8 @@ struct { struct HPMHookPoint *HP_skill_produce_mix_post; struct HPMHookPoint *HP_skill_arrow_create_pre; struct HPMHookPoint *HP_skill_arrow_create_post; + struct HPMHookPoint *HP_skill_castend_type_pre; + struct HPMHookPoint *HP_skill_castend_type_post; struct HPMHookPoint *HP_skill_castend_nodamage_id_pre; struct HPMHookPoint *HP_skill_castend_nodamage_id_post; struct HPMHookPoint *HP_skill_castend_damage_id_pre; @@ -5148,6 +5238,8 @@ struct { struct HPMHookPoint *HP_skill_unitsetmapcell_post; struct HPMHookPoint *HP_skill_unit_onplace_timer_pre; struct HPMHookPoint *HP_skill_unit_onplace_timer_post; + struct HPMHookPoint *HP_skill_unit_onplace_timer_unknown_pre; + struct HPMHookPoint *HP_skill_unit_onplace_timer_unknown_post; struct HPMHookPoint *HP_skill_unit_effect_pre; struct HPMHookPoint *HP_skill_unit_effect_post; struct HPMHookPoint *HP_skill_unit_timer_sub_onplace_pre; @@ -5168,16 +5260,44 @@ struct { struct HPMHookPoint *HP_skill_unit_timer_sub_post; struct HPMHookPoint *HP_skill_init_unit_layout_pre; struct HPMHookPoint *HP_skill_init_unit_layout_post; - struct HPMHookPoint *HP_skill_parse_row_skilldb_pre; - struct HPMHookPoint *HP_skill_parse_row_skilldb_post; - struct HPMHookPoint *HP_skill_parse_row_requiredb_pre; - struct HPMHookPoint *HP_skill_parse_row_requiredb_post; - struct HPMHookPoint *HP_skill_parse_row_castdb_pre; - struct HPMHookPoint *HP_skill_parse_row_castdb_post; - struct HPMHookPoint *HP_skill_parse_row_castnodexdb_pre; - struct HPMHookPoint *HP_skill_parse_row_castnodexdb_post; - struct HPMHookPoint *HP_skill_parse_row_unitdb_pre; - struct HPMHookPoint *HP_skill_parse_row_unitdb_post; + struct HPMHookPoint *HP_skill_init_unit_layout_unknown_pre; + struct HPMHookPoint *HP_skill_init_unit_layout_unknown_post; + struct HPMHookPoint *HP_skill_validate_hittype_pre; + struct HPMHookPoint *HP_skill_validate_hittype_post; + struct HPMHookPoint *HP_skill_validate_skilltype_pre; + struct HPMHookPoint *HP_skill_validate_skilltype_post; + struct HPMHookPoint *HP_skill_validate_attacktype_pre; + struct HPMHookPoint *HP_skill_validate_attacktype_post; + struct HPMHookPoint *HP_skill_validate_element_pre; + struct HPMHookPoint *HP_skill_validate_element_post; + struct HPMHookPoint *HP_skill_validate_skillinfo_pre; + struct HPMHookPoint *HP_skill_validate_skillinfo_post; + struct HPMHookPoint *HP_skill_validate_damagetype_pre; + struct HPMHookPoint *HP_skill_validate_damagetype_post; + struct HPMHookPoint *HP_skill_validate_castnodex_pre; + struct HPMHookPoint *HP_skill_validate_castnodex_post; + struct HPMHookPoint *HP_skill_validate_weapontype_pre; + struct HPMHookPoint *HP_skill_validate_weapontype_post; + struct HPMHookPoint *HP_skill_validate_ammotype_pre; + struct HPMHookPoint *HP_skill_validate_ammotype_post; + struct HPMHookPoint *HP_skill_validate_state_pre; + struct HPMHookPoint *HP_skill_validate_state_post; + struct HPMHookPoint *HP_skill_validate_item_requirements_pre; + struct HPMHookPoint *HP_skill_validate_item_requirements_post; + struct HPMHookPoint *HP_skill_validate_unit_target_pre; + struct HPMHookPoint *HP_skill_validate_unit_target_post; + struct HPMHookPoint *HP_skill_validate_unit_flag_pre; + struct HPMHookPoint *HP_skill_validate_unit_flag_post; + struct HPMHookPoint *HP_skill_validate_additional_fields_pre; + struct HPMHookPoint *HP_skill_validate_additional_fields_post; + struct HPMHookPoint *HP_skill_validate_skilldb_pre; + struct HPMHookPoint *HP_skill_validate_skilldb_post; + struct HPMHookPoint *HP_skill_read_skilldb_pre; + struct HPMHookPoint *HP_skill_read_skilldb_post; + struct HPMHookPoint *HP_skill_config_set_level_pre; + struct HPMHookPoint *HP_skill_config_set_level_post; + struct HPMHookPoint *HP_skill_level_set_value_pre; + struct HPMHookPoint *HP_skill_level_set_value_post; struct HPMHookPoint *HP_skill_parse_row_producedb_pre; struct HPMHookPoint *HP_skill_parse_row_producedb_post; struct HPMHookPoint *HP_skill_parse_row_createarrowdb_pre; @@ -5290,6 +5410,12 @@ struct { struct HPMHookPoint *HP_skill_get_requirement_item_unknown_post; struct HPMHookPoint *HP_skill_get_requirement_unknown_pre; struct HPMHookPoint *HP_skill_get_requirement_unknown_post; + struct HPMHookPoint *HP_skill_splash_target_pre; + struct HPMHookPoint *HP_skill_splash_target_post; + struct HPMHookPoint *HP_skill_check_npc_chaospanic_pre; + struct HPMHookPoint *HP_skill_check_npc_chaospanic_post; + struct HPMHookPoint *HP_skill_count_wos_pre; + struct HPMHookPoint *HP_skill_count_wos_post; struct HPMHookPoint *HP_sockt_init_pre; struct HPMHookPoint *HP_sockt_init_post; struct HPMHookPoint *HP_sockt_final_pre; @@ -5634,6 +5760,14 @@ struct { struct HPMHookPoint *HP_status_read_job_db_post; struct HPMHookPoint *HP_status_read_job_db_sub_pre; struct HPMHookPoint *HP_status_read_job_db_sub_post; + struct HPMHookPoint *HP_status_set_sc_pre; + struct HPMHookPoint *HP_status_set_sc_post; + struct HPMHookPoint *HP_status_copy_pre; + struct HPMHookPoint *HP_status_copy_post; + struct HPMHookPoint *HP_status_base_matk_min_pre; + struct HPMHookPoint *HP_status_base_matk_min_post; + struct HPMHookPoint *HP_status_base_matk_max_pre; + struct HPMHookPoint *HP_status_base_matk_max_post; struct HPMHookPoint *HP_storage_reconnect_pre; struct HPMHookPoint *HP_storage_reconnect_post; struct HPMHookPoint *HP_storage_delitem_pre; @@ -5760,6 +5894,28 @@ struct { struct HPMHookPoint *HP_sysinfo_init_post; struct HPMHookPoint *HP_sysinfo_final_pre; struct HPMHookPoint *HP_sysinfo_final_post; + struct HPMHookPoint *HP_thread_init_pre; + struct HPMHookPoint *HP_thread_init_post; + struct HPMHookPoint *HP_thread_final_pre; + struct HPMHookPoint *HP_thread_final_post; + struct HPMHookPoint *HP_thread_create_pre; + struct HPMHookPoint *HP_thread_create_post; + struct HPMHookPoint *HP_thread_create_opt_pre; + struct HPMHookPoint *HP_thread_create_opt_post; + struct HPMHookPoint *HP_thread_destroy_pre; + struct HPMHookPoint *HP_thread_destroy_post; + struct HPMHookPoint *HP_thread_self_pre; + struct HPMHookPoint *HP_thread_self_post; + struct HPMHookPoint *HP_thread_get_tid_pre; + struct HPMHookPoint *HP_thread_get_tid_post; + struct HPMHookPoint *HP_thread_wait_pre; + struct HPMHookPoint *HP_thread_wait_post; + struct HPMHookPoint *HP_thread_prio_set_pre; + struct HPMHookPoint *HP_thread_prio_set_post; + struct HPMHookPoint *HP_thread_prio_get_pre; + struct HPMHookPoint *HP_thread_prio_get_post; + struct HPMHookPoint *HP_thread_yield_pre; + struct HPMHookPoint *HP_thread_yield_post; struct HPMHookPoint *HP_timer_gettick_pre; struct HPMHookPoint *HP_timer_gettick_post; struct HPMHookPoint *HP_timer_gettick_nocache_pre; @@ -6005,12 +6161,16 @@ struct { int HP_battle_calc_attack_post; int HP_battle_calc_damage_pre; int HP_battle_calc_damage_post; + int HP_battle_calc_pc_damage_pre; + int HP_battle_calc_pc_damage_post; int HP_battle_calc_gvg_damage_pre; int HP_battle_calc_gvg_damage_post; int HP_battle_calc_bg_damage_pre; int HP_battle_calc_bg_damage_post; int HP_battle_weapon_attack_pre; int HP_battle_weapon_attack_post; + int HP_battle_check_arrows_pre; + int HP_battle_check_arrows_post; int HP_battle_calc_weapon_attack_pre; int HP_battle_calc_weapon_attack_post; int HP_battle_delay_damage_pre; @@ -6729,6 +6889,8 @@ struct { int HP_clif_skill_itemlistwindow_post; int HP_clif_sc_load_pre; int HP_clif_sc_load_post; + int HP_clif_sc_continue_pre; + int HP_clif_sc_continue_post; int HP_clif_sc_end_pre; int HP_clif_sc_end_post; int HP_clif_initialstatus_pre; @@ -6791,8 +6953,8 @@ struct { int HP_clif_skill_estimation_post; int HP_clif_skill_warppoint_pre; int HP_clif_skill_warppoint_post; - int HP_clif_skillcasting_pre; - int HP_clif_skillcasting_post; + int HP_clif_useskill_pre; + int HP_clif_useskill_post; int HP_clif_produce_effect_pre; int HP_clif_produce_effect_post; int HP_clif_devotion_pre; @@ -7287,6 +7449,10 @@ struct { int HP_clif_comparemergeitem_post; int HP_clif_ackmergeitems_pre; int HP_clif_ackmergeitems_post; + int HP_clif_isdisguised_pre; + int HP_clif_isdisguised_post; + int HP_clif_bl_type_pre; + int HP_clif_bl_type_post; int HP_clif_pWantToConnection_pre; int HP_clif_pWantToConnection_post; int HP_clif_pLoadEndAck_pre; @@ -7815,6 +7981,10 @@ struct { int HP_DB_init_post; int HP_DB_final_pre; int HP_DB_final_post; + int HP_des_decrypt_block_pre; + int HP_des_decrypt_block_post; + int HP_des_decrypt_pre; + int HP_des_decrypt_post; int HP_duel_create_pre; int HP_duel_create_post; int HP_duel_invite_pre; @@ -7897,6 +8067,20 @@ struct { int HP_elemental_ai_timer_post; int HP_elemental_read_db_pre; int HP_elemental_read_db_post; + int HP_grfio_init_pre; + int HP_grfio_init_post; + int HP_grfio_final_pre; + int HP_grfio_final_post; + int HP_grfio_reads_pre; + int HP_grfio_reads_post; + int HP_grfio_find_file_pre; + int HP_grfio_find_file_post; + int HP_grfio_crc32_pre; + int HP_grfio_crc32_post; + int HP_grfio_decode_zip_pre; + int HP_grfio_decode_zip_post; + int HP_grfio_encode_zip_pre; + int HP_grfio_encode_zip_post; int HP_guild_init_pre; int HP_guild_init_post; int HP_guild_final_pre; @@ -9197,6 +9381,12 @@ struct { int HP_mapreg_reload_post; int HP_mapreg_config_read_pre; int HP_mapreg_config_read_post; + int HP_md5_string_pre; + int HP_md5_string_post; + int HP_md5_binary_pre; + int HP_md5_binary_post; + int HP_md5_salt_pre; + int HP_md5_salt_post; int HP_mercenary_init_pre; int HP_mercenary_init_post; int HP_mercenary_class_pre; @@ -9453,6 +9643,26 @@ struct { int HP_mob_clear_spawninfo_post; int HP_mob_destroy_mob_db_pre; int HP_mob_destroy_mob_db_post; + int HP_mutex_create_pre; + int HP_mutex_create_post; + int HP_mutex_destroy_pre; + int HP_mutex_destroy_post; + int HP_mutex_lock_pre; + int HP_mutex_lock_post; + int HP_mutex_trylock_pre; + int HP_mutex_trylock_post; + int HP_mutex_unlock_pre; + int HP_mutex_unlock_post; + int HP_mutex_cond_create_pre; + int HP_mutex_cond_create_post; + int HP_mutex_cond_destroy_pre; + int HP_mutex_cond_destroy_post; + int HP_mutex_cond_wait_pre; + int HP_mutex_cond_wait_post; + int HP_mutex_cond_signal_pre; + int HP_mutex_cond_signal_post; + int HP_mutex_cond_broadcast_pre; + int HP_mutex_cond_broadcast_post; int HP_npc_chat_sub_pre; int HP_npc_chat_sub_post; int HP_npc_chat_finalize_pre; @@ -10387,6 +10597,22 @@ struct { int HP_quest_read_db_post; int HP_quest_read_db_sub_pre; int HP_quest_read_db_sub_post; + int HP_rnd_init_pre; + int HP_rnd_init_post; + int HP_rnd_final_pre; + int HP_rnd_final_post; + int HP_rnd_seed_pre; + int HP_rnd_seed_post; + int HP_rnd_random_pre; + int HP_rnd_random_post; + int HP_rnd_roll_pre; + int HP_rnd_roll_post; + int HP_rnd_value_pre; + int HP_rnd_value_post; + int HP_rnd_uniform_pre; + int HP_rnd_uniform_post; + int HP_rnd_uniform53_pre; + int HP_rnd_uniform53_post; int HP_script_init_pre; int HP_script_init_post; int HP_script_final_pre; @@ -10563,6 +10789,16 @@ struct { int HP_script_parse_variable_post; int HP_script_parse_simpleexpr_pre; int HP_script_parse_simpleexpr_post; + int HP_script_parse_simpleexpr_paren_pre; + int HP_script_parse_simpleexpr_paren_post; + int HP_script_parse_simpleexpr_number_pre; + int HP_script_parse_simpleexpr_number_post; + int HP_script_parse_simpleexpr_string_pre; + int HP_script_parse_simpleexpr_string_post; + int HP_script_parse_simpleexpr_name_pre; + int HP_script_parse_simpleexpr_name_post; + int HP_script_add_translatable_string_pre; + int HP_script_add_translatable_string_post; int HP_script_parse_expr_pre; int HP_script_parse_expr_post; int HP_script_parse_line_pre; @@ -10705,6 +10941,8 @@ struct { int HP_script_string_dup_post; int HP_script_load_translations_pre; int HP_script_load_translations_post; + int HP_script_load_translation_addstring_pre; + int HP_script_load_translation_addstring_post; int HP_script_load_translation_pre; int HP_script_load_translation_post; int HP_script_translation_db_destroyer_pre; @@ -10949,8 +11187,12 @@ struct { int HP_skill_enchant_elemental_end_post; int HP_skill_not_ok_pre; int HP_skill_not_ok_post; + int HP_skill_not_ok_unknown_pre; + int HP_skill_not_ok_unknown_post; int HP_skill_not_ok_hom_pre; int HP_skill_not_ok_hom_post; + int HP_skill_not_ok_hom_unknown_pre; + int HP_skill_not_ok_hom_unknown_post; int HP_skill_not_ok_mercenary_pre; int HP_skill_not_ok_mercenary_post; int HP_skill_chastle_mob_changetarget_pre; @@ -10961,6 +11203,8 @@ struct { int HP_skill_produce_mix_post; int HP_skill_arrow_create_pre; int HP_skill_arrow_create_post; + int HP_skill_castend_type_pre; + int HP_skill_castend_type_post; int HP_skill_castend_nodamage_id_pre; int HP_skill_castend_nodamage_id_post; int HP_skill_castend_damage_id_pre; @@ -11045,6 +11289,8 @@ struct { int HP_skill_unitsetmapcell_post; int HP_skill_unit_onplace_timer_pre; int HP_skill_unit_onplace_timer_post; + int HP_skill_unit_onplace_timer_unknown_pre; + int HP_skill_unit_onplace_timer_unknown_post; int HP_skill_unit_effect_pre; int HP_skill_unit_effect_post; int HP_skill_unit_timer_sub_onplace_pre; @@ -11065,16 +11311,44 @@ struct { int HP_skill_unit_timer_sub_post; int HP_skill_init_unit_layout_pre; int HP_skill_init_unit_layout_post; - int HP_skill_parse_row_skilldb_pre; - int HP_skill_parse_row_skilldb_post; - int HP_skill_parse_row_requiredb_pre; - int HP_skill_parse_row_requiredb_post; - int HP_skill_parse_row_castdb_pre; - int HP_skill_parse_row_castdb_post; - int HP_skill_parse_row_castnodexdb_pre; - int HP_skill_parse_row_castnodexdb_post; - int HP_skill_parse_row_unitdb_pre; - int HP_skill_parse_row_unitdb_post; + int HP_skill_init_unit_layout_unknown_pre; + int HP_skill_init_unit_layout_unknown_post; + int HP_skill_validate_hittype_pre; + int HP_skill_validate_hittype_post; + int HP_skill_validate_skilltype_pre; + int HP_skill_validate_skilltype_post; + int HP_skill_validate_attacktype_pre; + int HP_skill_validate_attacktype_post; + int HP_skill_validate_element_pre; + int HP_skill_validate_element_post; + int HP_skill_validate_skillinfo_pre; + int HP_skill_validate_skillinfo_post; + int HP_skill_validate_damagetype_pre; + int HP_skill_validate_damagetype_post; + int HP_skill_validate_castnodex_pre; + int HP_skill_validate_castnodex_post; + int HP_skill_validate_weapontype_pre; + int HP_skill_validate_weapontype_post; + int HP_skill_validate_ammotype_pre; + int HP_skill_validate_ammotype_post; + int HP_skill_validate_state_pre; + int HP_skill_validate_state_post; + int HP_skill_validate_item_requirements_pre; + int HP_skill_validate_item_requirements_post; + int HP_skill_validate_unit_target_pre; + int HP_skill_validate_unit_target_post; + int HP_skill_validate_unit_flag_pre; + int HP_skill_validate_unit_flag_post; + int HP_skill_validate_additional_fields_pre; + int HP_skill_validate_additional_fields_post; + int HP_skill_validate_skilldb_pre; + int HP_skill_validate_skilldb_post; + int HP_skill_read_skilldb_pre; + int HP_skill_read_skilldb_post; + int HP_skill_config_set_level_pre; + int HP_skill_config_set_level_post; + int HP_skill_level_set_value_pre; + int HP_skill_level_set_value_post; int HP_skill_parse_row_producedb_pre; int HP_skill_parse_row_producedb_post; int HP_skill_parse_row_createarrowdb_pre; @@ -11187,6 +11461,12 @@ struct { int HP_skill_get_requirement_item_unknown_post; int HP_skill_get_requirement_unknown_pre; int HP_skill_get_requirement_unknown_post; + int HP_skill_splash_target_pre; + int HP_skill_splash_target_post; + int HP_skill_check_npc_chaospanic_pre; + int HP_skill_check_npc_chaospanic_post; + int HP_skill_count_wos_pre; + int HP_skill_count_wos_post; int HP_sockt_init_pre; int HP_sockt_init_post; int HP_sockt_final_pre; @@ -11531,6 +11811,14 @@ struct { int HP_status_read_job_db_post; int HP_status_read_job_db_sub_pre; int HP_status_read_job_db_sub_post; + int HP_status_set_sc_pre; + int HP_status_set_sc_post; + int HP_status_copy_pre; + int HP_status_copy_post; + int HP_status_base_matk_min_pre; + int HP_status_base_matk_min_post; + int HP_status_base_matk_max_pre; + int HP_status_base_matk_max_post; int HP_storage_reconnect_pre; int HP_storage_reconnect_post; int HP_storage_delitem_pre; @@ -11657,6 +11945,28 @@ struct { int HP_sysinfo_init_post; int HP_sysinfo_final_pre; int HP_sysinfo_final_post; + int HP_thread_init_pre; + int HP_thread_init_post; + int HP_thread_final_pre; + int HP_thread_final_post; + int HP_thread_create_pre; + int HP_thread_create_post; + int HP_thread_create_opt_pre; + int HP_thread_create_opt_post; + int HP_thread_destroy_pre; + int HP_thread_destroy_post; + int HP_thread_self_pre; + int HP_thread_self_post; + int HP_thread_get_tid_pre; + int HP_thread_get_tid_post; + int HP_thread_wait_pre; + int HP_thread_wait_post; + int HP_thread_prio_set_pre; + int HP_thread_prio_set_post; + int HP_thread_prio_get_pre; + int HP_thread_prio_get_post; + int HP_thread_yield_pre; + int HP_thread_yield_post; int HP_timer_gettick_pre; int HP_timer_gettick_post; int HP_timer_gettick_nocache_pre; @@ -11831,8 +12141,10 @@ struct { struct console_interface console; struct core_interface core; struct db_interface DB; + struct des_interface des; struct duel_interface duel; struct elemental_interface elemental; + struct grfio_interface grfio; struct guild_interface guild; struct guild_storage_interface gstorage; struct homunculus_interface homun; @@ -11848,8 +12160,10 @@ struct { struct mapindex_interface mapindex; struct mapit_interface mapit; struct mapreg_interface mapreg; + struct md5_interface md5; struct mercenary_interface mercenary; struct mob_interface mob; + struct mutex_interface mutex; struct npc_chat_interface npc_chat; struct npc_interface npc; struct nullpo_interface nullpo; @@ -11860,6 +12174,7 @@ struct { struct pcre_interface libpcre; struct pet_interface pet; struct quest_interface quest; + struct rnd_interface rnd; struct script_interface script; struct searchstore_interface searchstore; struct showmsg_interface showmsg; @@ -11872,6 +12187,7 @@ struct { struct strlib_interface strlib; struct sv_interface sv; struct sysinfo_interface sysinfo; + struct thread_interface thread; struct timer_interface timer; struct trade_interface trade; struct unit_interface unit; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index b18d11d66..2cef7f135 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -23,6 +23,8 @@ * as it will get overwritten. */ +/* GENERATED FILE DO NOT EDIT */ + struct HookingPointData HookingPoints[] = { /* HCache_interface */ { HP_POP(HCache->init, HP_HCache_init) }, @@ -69,9 +71,11 @@ struct HookingPointData HookingPoints[] = { { HP_POP(battle->final, HP_battle_final) }, { HP_POP(battle->calc_attack, HP_battle_calc_attack) }, { HP_POP(battle->calc_damage, HP_battle_calc_damage) }, + { HP_POP(battle->calc_pc_damage, HP_battle_calc_pc_damage) }, { HP_POP(battle->calc_gvg_damage, HP_battle_calc_gvg_damage) }, { HP_POP(battle->calc_bg_damage, HP_battle_calc_bg_damage) }, { HP_POP(battle->weapon_attack, HP_battle_weapon_attack) }, + { HP_POP(battle->check_arrows, HP_battle_check_arrows) }, { HP_POP(battle->calc_weapon_attack, HP_battle_calc_weapon_attack) }, { HP_POP(battle->delay_damage, HP_battle_delay_damage) }, { HP_POP(battle->drain, HP_battle_drain) }, @@ -437,6 +441,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->autoshadowspell_list, HP_clif_autoshadowspell_list) }, { HP_POP(clif->skill_itemlistwindow, HP_clif_skill_itemlistwindow) }, { HP_POP(clif->sc_load, HP_clif_sc_load) }, + { HP_POP(clif->sc_continue, HP_clif_sc_continue) }, { HP_POP(clif->sc_end, HP_clif_sc_end) }, { HP_POP(clif->initialstatus, HP_clif_initialstatus) }, { HP_POP(clif->cooldown_list, HP_clif_cooldown_list) }, @@ -468,7 +473,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->skill_poseffect, HP_clif_skill_poseffect) }, { HP_POP(clif->skill_estimation, HP_clif_skill_estimation) }, { HP_POP(clif->skill_warppoint, HP_clif_skill_warppoint) }, - { HP_POP(clif->skillcasting, HP_clif_skillcasting) }, + { HP_POP(clif->useskill, HP_clif_useskill) }, { HP_POP(clif->produce_effect, HP_clif_produce_effect) }, { HP_POP(clif->devotion, HP_clif_devotion) }, { HP_POP(clif->spiritball, HP_clif_spiritball) }, @@ -716,6 +721,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->cancelmergeitem, HP_clif_cancelmergeitem) }, { HP_POP(clif->comparemergeitem, HP_clif_comparemergeitem) }, { HP_POP(clif->ackmergeitems, HP_clif_ackmergeitems) }, + { HP_POP(clif->isdisguised, HP_clif_isdisguised) }, + { HP_POP(clif->bl_type, HP_clif_bl_type) }, { HP_POP(clif->pWantToConnection, HP_clif_pWantToConnection) }, { HP_POP(clif->pLoadEndAck, HP_clif_pLoadEndAck) }, { HP_POP(clif->pTickSend, HP_clif_pTickSend) }, @@ -984,6 +991,9 @@ struct HookingPointData HookingPoints[] = { { HP_POP(DB->data2ptr, HP_DB_data2ptr) }, { HP_POP(DB->init, HP_DB_init) }, { HP_POP(DB->final, HP_DB_final) }, +/* des_interface */ + { HP_POP(des->decrypt_block, HP_des_decrypt_block) }, + { HP_POP(des->decrypt, HP_des_decrypt) }, /* duel_interface */ { HP_POP(duel->create, HP_duel_create) }, { HP_POP(duel->invite, HP_duel_invite) }, @@ -1027,6 +1037,14 @@ struct HookingPointData HookingPoints[] = { { HP_POP(elemental->ai_sub_foreachclient, HP_elemental_ai_sub_foreachclient) }, { HP_POP(elemental->ai_timer, HP_elemental_ai_timer) }, { HP_POP(elemental->read_db, HP_elemental_read_db) }, +/* grfio_interface */ + { HP_POP(grfio->init, HP_grfio_init) }, + { HP_POP(grfio->final, HP_grfio_final) }, + { HP_POP(grfio->reads, HP_grfio_reads) }, + { HP_POP(grfio->find_file, HP_grfio_find_file) }, + { HP_POP(grfio->crc32, HP_grfio_crc32) }, + { HP_POP(grfio->decode_zip, HP_grfio_decode_zip) }, + { HP_POP(grfio->encode_zip, HP_grfio_encode_zip) }, /* guild_interface */ { HP_POP(guild->init, HP_guild_init) }, { HP_POP(guild->final, HP_guild_final) }, @@ -1692,6 +1710,10 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mapreg->destroyreg, HP_mapreg_destroyreg) }, { HP_POP(mapreg->reload, HP_mapreg_reload) }, { HP_POP(mapreg->config_read, HP_mapreg_config_read) }, +/* md5_interface */ + { HP_POP(md5->string, HP_md5_string) }, + { HP_POP(md5->binary, HP_md5_binary) }, + { HP_POP(md5->salt, HP_md5_salt) }, /* mercenary_interface */ { HP_POP(mercenary->init, HP_mercenary_init) }, { HP_POP(mercenary->class, HP_mercenary_class) }, @@ -1822,6 +1844,17 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mob->load, HP_mob_load) }, { HP_POP(mob->clear_spawninfo, HP_mob_clear_spawninfo) }, { HP_POP(mob->destroy_mob_db, HP_mob_destroy_mob_db) }, +/* mutex_interface */ + { HP_POP(mutex->create, HP_mutex_create) }, + { HP_POP(mutex->destroy, HP_mutex_destroy) }, + { HP_POP(mutex->lock, HP_mutex_lock) }, + { HP_POP(mutex->trylock, HP_mutex_trylock) }, + { HP_POP(mutex->unlock, HP_mutex_unlock) }, + { HP_POP(mutex->cond_create, HP_mutex_cond_create) }, + { HP_POP(mutex->cond_destroy, HP_mutex_cond_destroy) }, + { HP_POP(mutex->cond_wait, HP_mutex_cond_wait) }, + { HP_POP(mutex->cond_signal, HP_mutex_cond_signal) }, + { HP_POP(mutex->cond_broadcast, HP_mutex_cond_broadcast) }, /* npc_chat_interface */ { HP_POP(npc_chat->sub, HP_npc_chat_sub) }, { HP_POP(npc_chat->finalize, HP_npc_chat_finalize) }, @@ -2299,6 +2332,15 @@ struct HookingPointData HookingPoints[] = { { HP_POP(quest->clear, HP_quest_clear) }, { HP_POP(quest->read_db, HP_quest_read_db) }, { HP_POP(quest->read_db_sub, HP_quest_read_db_sub) }, +/* rnd_interface */ + { HP_POP(rnd->init, HP_rnd_init) }, + { HP_POP(rnd->final, HP_rnd_final) }, + { HP_POP(rnd->seed, HP_rnd_seed) }, + { HP_POP(rnd->random, HP_rnd_random) }, + { HP_POP(rnd->roll, HP_rnd_roll) }, + { HP_POP(rnd->value, HP_rnd_value) }, + { HP_POP(rnd->uniform, HP_rnd_uniform) }, + { HP_POP(rnd->uniform53, HP_rnd_uniform53) }, /* script_interface */ { HP_POP(script->init, HP_script_init) }, { HP_POP(script->final, HP_script_final) }, @@ -2388,6 +2430,11 @@ struct HookingPointData HookingPoints[] = { { HP_POP(script->parse_nextline, HP_script_parse_nextline) }, { HP_POP(script->parse_variable, HP_script_parse_variable) }, { HP_POP(script->parse_simpleexpr, HP_script_parse_simpleexpr) }, + { HP_POP(script->parse_simpleexpr_paren, HP_script_parse_simpleexpr_paren) }, + { HP_POP(script->parse_simpleexpr_number, HP_script_parse_simpleexpr_number) }, + { HP_POP(script->parse_simpleexpr_string, HP_script_parse_simpleexpr_string) }, + { HP_POP(script->parse_simpleexpr_name, HP_script_parse_simpleexpr_name) }, + { HP_POP(script->add_translatable_string, HP_script_add_translatable_string) }, { HP_POP(script->parse_expr, HP_script_parse_expr) }, { HP_POP(script->parse_line, HP_script_parse_line) }, { HP_POP(script->read_constdb, HP_script_read_constdb) }, @@ -2459,6 +2506,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(script->mapindexname2id, HP_script_mapindexname2id) }, { HP_POP(script->string_dup, HP_script_string_dup) }, { HP_POP(script->load_translations, HP_script_load_translations) }, + { HP_POP(script->load_translation_addstring, HP_script_load_translation_addstring) }, { HP_POP(script->load_translation, HP_script_load_translation) }, { HP_POP(script->translation_db_destroyer, HP_script_translation_db_destroyer) }, { HP_POP(script->clear_translations, HP_script_clear_translations) }, @@ -2584,12 +2632,15 @@ struct HookingPointData HookingPoints[] = { { HP_POP(skill->can_cloak, HP_skill_can_cloak) }, { HP_POP(skill->enchant_elemental_end, HP_skill_enchant_elemental_end) }, { HP_POP(skill->not_ok, HP_skill_not_ok) }, + { HP_POP(skill->not_ok_unknown, HP_skill_not_ok_unknown) }, { HP_POP(skill->not_ok_hom, HP_skill_not_ok_hom) }, + { HP_POP(skill->not_ok_hom_unknown, HP_skill_not_ok_hom_unknown) }, { HP_POP(skill->not_ok_mercenary, HP_skill_not_ok_mercenary) }, { HP_POP(skill->chastle_mob_changetarget, HP_skill_chastle_mob_changetarget) }, { HP_POP(skill->can_produce_mix, HP_skill_can_produce_mix) }, { HP_POP(skill->produce_mix, HP_skill_produce_mix) }, { HP_POP(skill->arrow_create, HP_skill_arrow_create) }, + { HP_POP(skill->castend_type, HP_skill_castend_type) }, { HP_POP(skill->castend_nodamage_id, HP_skill_castend_nodamage_id) }, { HP_POP(skill->castend_damage_id, HP_skill_castend_damage_id) }, { HP_POP(skill->castend_pos2, HP_skill_castend_pos2) }, @@ -2632,6 +2683,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(skill->sit_out, HP_skill_sit_out) }, { HP_POP(skill->unitsetmapcell, HP_skill_unitsetmapcell) }, { HP_POP(skill->unit_onplace_timer, HP_skill_unit_onplace_timer) }, + { HP_POP(skill->unit_onplace_timer_unknown, HP_skill_unit_onplace_timer_unknown) }, { HP_POP(skill->unit_effect, HP_skill_unit_effect) }, { HP_POP(skill->unit_timer_sub_onplace, HP_skill_unit_timer_sub_onplace) }, { HP_POP(skill->unit_move_sub, HP_skill_unit_move_sub) }, @@ -2642,11 +2694,25 @@ struct HookingPointData HookingPoints[] = { { HP_POP(skill->unit_timer, HP_skill_unit_timer) }, { HP_POP(skill->unit_timer_sub, HP_skill_unit_timer_sub) }, { HP_POP(skill->init_unit_layout, HP_skill_init_unit_layout) }, - { HP_POP(skill->parse_row_skilldb, HP_skill_parse_row_skilldb) }, - { HP_POP(skill->parse_row_requiredb, HP_skill_parse_row_requiredb) }, - { HP_POP(skill->parse_row_castdb, HP_skill_parse_row_castdb) }, - { HP_POP(skill->parse_row_castnodexdb, HP_skill_parse_row_castnodexdb) }, - { HP_POP(skill->parse_row_unitdb, HP_skill_parse_row_unitdb) }, + { HP_POP(skill->init_unit_layout_unknown, HP_skill_init_unit_layout_unknown) }, + { HP_POP(skill->validate_hittype, HP_skill_validate_hittype) }, + { HP_POP(skill->validate_skilltype, HP_skill_validate_skilltype) }, + { HP_POP(skill->validate_attacktype, HP_skill_validate_attacktype) }, + { HP_POP(skill->validate_element, HP_skill_validate_element) }, + { HP_POP(skill->validate_skillinfo, HP_skill_validate_skillinfo) }, + { HP_POP(skill->validate_damagetype, HP_skill_validate_damagetype) }, + { HP_POP(skill->validate_castnodex, HP_skill_validate_castnodex) }, + { HP_POP(skill->validate_weapontype, HP_skill_validate_weapontype) }, + { HP_POP(skill->validate_ammotype, HP_skill_validate_ammotype) }, + { HP_POP(skill->validate_state, HP_skill_validate_state) }, + { HP_POP(skill->validate_item_requirements, HP_skill_validate_item_requirements) }, + { HP_POP(skill->validate_unit_target, HP_skill_validate_unit_target) }, + { HP_POP(skill->validate_unit_flag, HP_skill_validate_unit_flag) }, + { HP_POP(skill->validate_additional_fields, HP_skill_validate_additional_fields) }, + { HP_POP(skill->validate_skilldb, HP_skill_validate_skilldb) }, + { HP_POP(skill->read_skilldb, HP_skill_read_skilldb) }, + { HP_POP(skill->config_set_level, HP_skill_config_set_level) }, + { HP_POP(skill->level_set_value, HP_skill_level_set_value) }, { HP_POP(skill->parse_row_producedb, HP_skill_parse_row_producedb) }, { HP_POP(skill->parse_row_createarrowdb, HP_skill_parse_row_createarrowdb) }, { HP_POP(skill->parse_row_abradb, HP_skill_parse_row_abradb) }, @@ -2703,6 +2769,9 @@ struct HookingPointData HookingPoints[] = { { HP_POP(skill->get_requirement_off_unknown, HP_skill_get_requirement_off_unknown) }, { HP_POP(skill->get_requirement_item_unknown, HP_skill_get_requirement_item_unknown) }, { HP_POP(skill->get_requirement_unknown, HP_skill_get_requirement_unknown) }, + { HP_POP(skill->splash_target, HP_skill_splash_target) }, + { HP_POP(skill->check_npc_chaospanic, HP_skill_check_npc_chaospanic) }, + { HP_POP(skill->count_wos, HP_skill_count_wos) }, /* socket_interface */ { HP_POP(sockt->init, HP_sockt_init) }, { HP_POP(sockt->final, HP_sockt_final) }, @@ -2878,6 +2947,10 @@ struct HookingPointData HookingPoints[] = { { HP_POP(status->readdb_scconfig, HP_status_readdb_scconfig) }, { HP_POP(status->read_job_db, HP_status_read_job_db) }, { HP_POP(status->read_job_db_sub, HP_status_read_job_db_sub) }, + { HP_POP(status->set_sc, HP_status_set_sc) }, + { HP_POP(status->copy, HP_status_copy) }, + { HP_POP(status->base_matk_min, HP_status_base_matk_min) }, + { HP_POP(status->base_matk_max, HP_status_base_matk_max) }, /* storage_interface */ { HP_POP(storage->reconnect, HP_storage_reconnect) }, { HP_POP(storage->delitem, HP_storage_delitem) }, @@ -2946,6 +3019,18 @@ struct HookingPointData HookingPoints[] = { { HP_POP(sysinfo->is_superuser, HP_sysinfo_is_superuser) }, { HP_POP(sysinfo->init, HP_sysinfo_init) }, { HP_POP(sysinfo->final, HP_sysinfo_final) }, +/* thread_interface */ + { HP_POP(thread->init, HP_thread_init) }, + { HP_POP(thread->final, HP_thread_final) }, + { HP_POP(thread->create, HP_thread_create) }, + { HP_POP(thread->create_opt, HP_thread_create_opt) }, + { HP_POP(thread->destroy, HP_thread_destroy) }, + { HP_POP(thread->self, HP_thread_self) }, + { HP_POP(thread->get_tid, HP_thread_get_tid) }, + { HP_POP(thread->wait, HP_thread_wait) }, + { HP_POP(thread->prio_set, HP_thread_prio_set) }, + { HP_POP(thread->prio_get, HP_thread_prio_get) }, + { HP_POP(thread->yield, HP_thread_yield) }, /* timer_interface */ { HP_POP(timer->gettick, HP_timer_gettick) }, { HP_POP(timer->gettick_nocache, HP_timer_gettick_nocache) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index ab2def6cd..8a343473c 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -23,6 +23,8 @@ * as it will get overwritten. */ +/* GENERATED FILE DO NOT EDIT */ + /* HCache_interface */ void HP_HCache_init(void) { int hIndex = 0; @@ -1184,6 +1186,33 @@ int64 HP_battle_calc_damage(struct block_list *src, struct block_list *bl, struc } return retVal___; } +int64 HP_battle_calc_pc_damage(struct block_list *src, struct block_list *bl, struct Damage *d, int64 damage, uint16 skill_id, uint16 skill_lv) { + int hIndex = 0; + int64 retVal___ = 0; + if( HPMHooks.count.HP_battle_calc_pc_damage_pre ) { + int64 (*preHookFunc) (struct block_list **src, struct block_list **bl, struct Damage **d, int64 *damage, uint16 *skill_id, uint16 *skill_lv); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_pc_damage_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_battle_calc_pc_damage_pre[hIndex].func; + retVal___ = preHookFunc(&src, &bl, &d, &damage, &skill_id, &skill_lv); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.battle.calc_pc_damage(src, bl, d, damage, skill_id, skill_lv); + } + if( HPMHooks.count.HP_battle_calc_pc_damage_post ) { + int64 (*postHookFunc) (int64 retVal___, struct block_list *src, struct block_list *bl, struct Damage *d, int64 damage, uint16 skill_id, uint16 skill_lv); + for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_pc_damage_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_battle_calc_pc_damage_post[hIndex].func; + retVal___ = postHookFunc(retVal___, src, bl, d, damage, skill_id, skill_lv); + } + } + return retVal___; +} int64 HP_battle_calc_gvg_damage(struct block_list *src, struct block_list *bl, int64 damage, int div_, uint16 skill_id, uint16 skill_lv, int flag) { int hIndex = 0; int64 retVal___ = 0; @@ -1265,6 +1294,33 @@ enum damage_lv HP_battle_weapon_attack(struct block_list *bl, struct block_list } return retVal___; } +bool HP_battle_check_arrows(struct map_session_data *sd) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_battle_check_arrows_pre ) { + bool (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_check_arrows_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_battle_check_arrows_pre[hIndex].func; + retVal___ = preHookFunc(&sd); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.battle.check_arrows(sd); + } + if( HPMHooks.count.HP_battle_check_arrows_post ) { + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd); + for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_check_arrows_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_battle_check_arrows_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd); + } + } + return retVal___; +} struct Damage HP_battle_calc_weapon_attack(struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int wflag) { int hIndex = 0; struct Damage retVal___ = { 0 }; @@ -4344,15 +4400,15 @@ bool HP_chat_kick(struct map_session_data *sd, const char *kickusername) { } return retVal___; } -bool HP_chat_create_npc_chat(struct npc_data *nd, const char *title, int limit, bool pub, int trigger, const char *ev, int zeny, int minLvl, int maxLvl) { +bool HP_chat_create_npc_chat(struct npc_data *nd, const char *title, int limit, bool pub, int trigger, const char *ev, int zeny, int min_level, int max_level) { int hIndex = 0; bool retVal___ = false; if( HPMHooks.count.HP_chat_create_npc_chat_pre ) { - bool (*preHookFunc) (struct npc_data **nd, const char **title, int *limit, bool *pub, int *trigger, const char **ev, int *zeny, int *minLvl, int *maxLvl); + bool (*preHookFunc) (struct npc_data **nd, const char **title, int *limit, bool *pub, int *trigger, const char **ev, int *zeny, int *min_level, int *max_level); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_create_npc_chat_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_chat_create_npc_chat_pre[hIndex].func; - retVal___ = preHookFunc(&nd, &title, &limit, &pub, &trigger, &ev, &zeny, &minLvl, &maxLvl); + retVal___ = preHookFunc(&nd, &title, &limit, &pub, &trigger, &ev, &zeny, &min_level, &max_level); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -4360,13 +4416,13 @@ bool HP_chat_create_npc_chat(struct npc_data *nd, const char *title, int limit, } } { - retVal___ = HPMHooks.source.chat.create_npc_chat(nd, title, limit, pub, trigger, ev, zeny, minLvl, maxLvl); + retVal___ = HPMHooks.source.chat.create_npc_chat(nd, title, limit, pub, trigger, ev, zeny, min_level, max_level); } if( HPMHooks.count.HP_chat_create_npc_chat_post ) { - bool (*postHookFunc) (bool retVal___, struct npc_data *nd, const char *title, int limit, bool pub, int trigger, const char *ev, int zeny, int minLvl, int maxLvl); + bool (*postHookFunc) (bool retVal___, struct npc_data *nd, const char *title, int limit, bool pub, int trigger, const char *ev, int zeny, int min_level, int max_level); for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_create_npc_chat_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_chat_create_npc_chat_post[hIndex].func; - retVal___ = postHookFunc(retVal___, nd, title, limit, pub, trigger, ev, zeny, minLvl, maxLvl); + retVal___ = postHookFunc(retVal___, nd, title, limit, pub, trigger, ev, zeny, min_level, max_level); } } return retVal___; @@ -4506,15 +4562,15 @@ bool HP_chat_trigger_event(struct chat_data *cd) { } return retVal___; } -struct chat_data* HP_chat_create(struct block_list *bl, const char *title, const char *pass, int limit, bool pub, int trigger, const char *ev, int zeny, int minLvl, int maxLvl) { +struct chat_data* HP_chat_create(struct block_list *bl, const char *title, const char *pass, int limit, bool pub, int trigger, const char *ev, int zeny, int min_level, int max_level) { int hIndex = 0; struct chat_data* retVal___ = NULL; if( HPMHooks.count.HP_chat_create_pre ) { - struct chat_data* (*preHookFunc) (struct block_list **bl, const char **title, const char **pass, int *limit, bool *pub, int *trigger, const char **ev, int *zeny, int *minLvl, int *maxLvl); + struct chat_data* (*preHookFunc) (struct block_list **bl, const char **title, const char **pass, int *limit, bool *pub, int *trigger, const char **ev, int *zeny, int *min_level, int *max_level); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_create_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_chat_create_pre[hIndex].func; - retVal___ = preHookFunc(&bl, &title, &pass, &limit, &pub, &trigger, &ev, &zeny, &minLvl, &maxLvl); + retVal___ = preHookFunc(&bl, &title, &pass, &limit, &pub, &trigger, &ev, &zeny, &min_level, &max_level); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -4522,13 +4578,13 @@ struct chat_data* HP_chat_create(struct block_list *bl, const char *title, const } } { - retVal___ = HPMHooks.source.chat.create(bl, title, pass, limit, pub, trigger, ev, zeny, minLvl, maxLvl); + retVal___ = HPMHooks.source.chat.create(bl, title, pass, limit, pub, trigger, ev, zeny, min_level, max_level); } if( HPMHooks.count.HP_chat_create_post ) { - struct chat_data* (*postHookFunc) (struct chat_data* retVal___, struct block_list *bl, const char *title, const char *pass, int limit, bool pub, int trigger, const char *ev, int zeny, int minLvl, int maxLvl); + struct chat_data* (*postHookFunc) (struct chat_data* retVal___, struct block_list *bl, const char *title, const char *pass, int limit, bool pub, int trigger, const char *ev, int zeny, int min_level, int max_level); for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_create_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_chat_create_post[hIndex].func; - retVal___ = postHookFunc(retVal___, bl, title, pass, limit, pub, trigger, ev, zeny, minLvl, maxLvl); + retVal___ = postHookFunc(retVal___, bl, title, pass, limit, pub, trigger, ev, zeny, min_level, max_level); } } return retVal___; @@ -10837,6 +10893,32 @@ void HP_clif_sc_load(struct block_list *bl, int tid, enum send_target target, in } return; } +void HP_clif_sc_continue(struct block_list *bl, int tid, enum send_target target, int type, int val1, int val2, int val3) { + int hIndex = 0; + if( HPMHooks.count.HP_clif_sc_continue_pre ) { + void (*preHookFunc) (struct block_list **bl, int *tid, enum send_target *target, int *type, int *val1, int *val2, int *val3); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_sc_continue_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_clif_sc_continue_pre[hIndex].func; + preHookFunc(&bl, &tid, &target, &type, &val1, &val2, &val3); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.sc_continue(bl, tid, target, type, val1, val2, val3); + } + if( HPMHooks.count.HP_clif_sc_continue_post ) { + void (*postHookFunc) (struct block_list *bl, int tid, enum send_target target, int type, int val1, int val2, int val3); + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_sc_continue_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_clif_sc_continue_post[hIndex].func; + postHookFunc(bl, tid, target, type, val1, val2, val3); + } + } + return; +} void HP_clif_sc_end(struct block_list *bl, int tid, enum send_target target, int type) { int hIndex = 0; if( HPMHooks.count.HP_clif_sc_end_pre ) { @@ -11646,14 +11728,14 @@ void HP_clif_skill_warppoint(struct map_session_data *sd, uint16 skill_id, uint1 } return; } -void HP_clif_skillcasting(struct block_list *bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, int property, int casttime) { +void HP_clif_useskill(struct block_list *bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, uint16 skill_lv, int casttime) { int hIndex = 0; - if( HPMHooks.count.HP_clif_skillcasting_pre ) { - void (*preHookFunc) (struct block_list **bl, int *src_id, int *dst_id, int *dst_x, int *dst_y, uint16 *skill_id, int *property, int *casttime); + if( HPMHooks.count.HP_clif_useskill_pre ) { + void (*preHookFunc) (struct block_list **bl, int *src_id, int *dst_id, int *dst_x, int *dst_y, uint16 *skill_id, uint16 *skill_lv, int *casttime); *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillcasting_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_clif_skillcasting_pre[hIndex].func; - preHookFunc(&bl, &src_id, &dst_id, &dst_x, &dst_y, &skill_id, &property, &casttime); + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_useskill_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_clif_useskill_pre[hIndex].func; + preHookFunc(&bl, &src_id, &dst_id, &dst_x, &dst_y, &skill_id, &skill_lv, &casttime); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -11661,13 +11743,13 @@ void HP_clif_skillcasting(struct block_list *bl, int src_id, int dst_id, int dst } } { - HPMHooks.source.clif.skillcasting(bl, src_id, dst_id, dst_x, dst_y, skill_id, property, casttime); + HPMHooks.source.clif.useskill(bl, src_id, dst_id, dst_x, dst_y, skill_id, skill_lv, casttime); } - if( HPMHooks.count.HP_clif_skillcasting_post ) { - void (*postHookFunc) (struct block_list *bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, int property, int casttime); - for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillcasting_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_clif_skillcasting_post[hIndex].func; - postHookFunc(bl, src_id, dst_id, dst_x, dst_y, skill_id, property, casttime); + if( HPMHooks.count.HP_clif_useskill_post ) { + void (*postHookFunc) (struct block_list *bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, uint16 skill_lv, int casttime); + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_useskill_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_clif_useskill_post[hIndex].func; + postHookFunc(bl, src_id, dst_id, dst_x, dst_y, skill_id, skill_lv, casttime); } } return; @@ -18110,6 +18192,60 @@ void HP_clif_ackmergeitems(int fd, struct map_session_data *sd) { } return; } +bool HP_clif_isdisguised(struct block_list *bl) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_clif_isdisguised_pre ) { + bool (*preHookFunc) (struct block_list **bl); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_isdisguised_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_clif_isdisguised_pre[hIndex].func; + retVal___ = preHookFunc(&bl); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clif.isdisguised(bl); + } + if( HPMHooks.count.HP_clif_isdisguised_post ) { + bool (*postHookFunc) (bool retVal___, struct block_list *bl); + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_isdisguised_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_clif_isdisguised_post[hIndex].func; + retVal___ = postHookFunc(retVal___, bl); + } + } + return retVal___; +} +unsigned char HP_clif_bl_type(struct block_list *bl) { + int hIndex = 0; + unsigned char retVal___ = 0; + if( HPMHooks.count.HP_clif_bl_type_pre ) { + unsigned char (*preHookFunc) (struct block_list **bl); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bl_type_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_clif_bl_type_pre[hIndex].func; + retVal___ = preHookFunc(&bl); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clif.bl_type(bl); + } + if( HPMHooks.count.HP_clif_bl_type_post ) { + unsigned char (*postHookFunc) (unsigned char retVal___, struct block_list *bl); + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bl_type_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_clif_bl_type_post[hIndex].func; + retVal___ = postHookFunc(retVal___, bl); + } + } + return retVal___; +} void HP_clif_pWantToConnection(int fd, struct map_session_data *sd) { int hIndex = 0; if( HPMHooks.count.HP_clif_pWantToConnection_pre ) { @@ -25000,6 +25136,59 @@ void HP_DB_final(void) { } return; } +/* des_interface */ +void HP_des_decrypt_block(struct des_bit64 *block) { + int hIndex = 0; + if( HPMHooks.count.HP_des_decrypt_block_pre ) { + void (*preHookFunc) (struct des_bit64 **block); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_des_decrypt_block_pre[hIndex].func; + preHookFunc(&block); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.des.decrypt_block(block); + } + if( HPMHooks.count.HP_des_decrypt_block_post ) { + void (*postHookFunc) (struct des_bit64 *block); + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_des_decrypt_block_post[hIndex].func; + postHookFunc(block); + } + } + return; +} +void HP_des_decrypt(unsigned char *data, size_t size) { + int hIndex = 0; + if( HPMHooks.count.HP_des_decrypt_pre ) { + void (*preHookFunc) (unsigned char **data, size_t *size); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_des_decrypt_pre[hIndex].func; + preHookFunc(&data, &size); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.des.decrypt(data, size); + } + if( HPMHooks.count.HP_des_decrypt_post ) { + void (*postHookFunc) (unsigned char *data, size_t size); + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_des_decrypt_post[hIndex].func; + postHookFunc(data, size); + } + } + return; +} /* duel_interface */ int HP_duel_create(struct map_session_data *sd, const unsigned int maxpl) { int hIndex = 0; @@ -26108,6 +26297,194 @@ int HP_elemental_read_db(void) { } return retVal___; } +/* grfio_interface */ +void HP_grfio_init(const char *fname) { + int hIndex = 0; + if( HPMHooks.count.HP_grfio_init_pre ) { + void (*preHookFunc) (const char **fname); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_init_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_grfio_init_pre[hIndex].func; + preHookFunc(&fname); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.grfio.init(fname); + } + if( HPMHooks.count.HP_grfio_init_post ) { + void (*postHookFunc) (const char *fname); + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_init_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_grfio_init_post[hIndex].func; + postHookFunc(fname); + } + } + return; +} +void HP_grfio_final(void) { + int hIndex = 0; + if( HPMHooks.count.HP_grfio_final_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_final_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_grfio_final_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.grfio.final(); + } + if( HPMHooks.count.HP_grfio_final_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_final_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_grfio_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void* HP_grfio_reads(const char *fname, int *size) { + int hIndex = 0; + void* retVal___ = NULL; + if( HPMHooks.count.HP_grfio_reads_pre ) { + void* (*preHookFunc) (const char **fname, int **size); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_reads_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_grfio_reads_pre[hIndex].func; + retVal___ = preHookFunc(&fname, &size); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.grfio.reads(fname, size); + } + if( HPMHooks.count.HP_grfio_reads_post ) { + void* (*postHookFunc) (void* retVal___, const char *fname, int *size); + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_reads_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_grfio_reads_post[hIndex].func; + retVal___ = postHookFunc(retVal___, fname, size); + } + } + return retVal___; +} +const char* HP_grfio_find_file(const char *fname) { + int hIndex = 0; + const char* retVal___ = NULL; + if( HPMHooks.count.HP_grfio_find_file_pre ) { + const char* (*preHookFunc) (const char **fname); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_find_file_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_grfio_find_file_pre[hIndex].func; + retVal___ = preHookFunc(&fname); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.grfio.find_file(fname); + } + if( HPMHooks.count.HP_grfio_find_file_post ) { + const char* (*postHookFunc) (const char* retVal___, const char *fname); + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_find_file_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_grfio_find_file_post[hIndex].func; + retVal___ = postHookFunc(retVal___, fname); + } + } + return retVal___; +} +unsigned long HP_grfio_crc32(const unsigned char *buf, unsigned int len) { + int hIndex = 0; + unsigned long retVal___ = 0; + if( HPMHooks.count.HP_grfio_crc32_pre ) { + unsigned long (*preHookFunc) (const unsigned char **buf, unsigned int *len); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_crc32_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_grfio_crc32_pre[hIndex].func; + retVal___ = preHookFunc(&buf, &len); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.grfio.crc32(buf, len); + } + if( HPMHooks.count.HP_grfio_crc32_post ) { + unsigned long (*postHookFunc) (unsigned long retVal___, const unsigned char *buf, unsigned int len); + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_crc32_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_grfio_crc32_post[hIndex].func; + retVal___ = postHookFunc(retVal___, buf, len); + } + } + return retVal___; +} +int HP_grfio_decode_zip(void *dest, unsigned long *dest_len, const void *source, unsigned long source_len) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_grfio_decode_zip_pre ) { + int (*preHookFunc) (void **dest, unsigned long **dest_len, const void **source, unsigned long *source_len); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_decode_zip_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_grfio_decode_zip_pre[hIndex].func; + retVal___ = preHookFunc(&dest, &dest_len, &source, &source_len); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.grfio.decode_zip(dest, dest_len, source, source_len); + } + if( HPMHooks.count.HP_grfio_decode_zip_post ) { + int (*postHookFunc) (int retVal___, void *dest, unsigned long *dest_len, const void *source, unsigned long source_len); + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_decode_zip_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_grfio_decode_zip_post[hIndex].func; + retVal___ = postHookFunc(retVal___, dest, dest_len, source, source_len); + } + } + return retVal___; +} +int HP_grfio_encode_zip(void *dest, unsigned long *dest_len, const void *source, unsigned long source_len) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_grfio_encode_zip_pre ) { + int (*preHookFunc) (void **dest, unsigned long **dest_len, const void **source, unsigned long *source_len); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_encode_zip_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_grfio_encode_zip_pre[hIndex].func; + retVal___ = preHookFunc(&dest, &dest_len, &source, &source_len); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.grfio.encode_zip(dest, dest_len, source, source_len); + } + if( HPMHooks.count.HP_grfio_encode_zip_post ) { + int (*postHookFunc) (int retVal___, void *dest, unsigned long *dest_len, const void *source, unsigned long source_len); + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_encode_zip_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_grfio_encode_zip_post[hIndex].func; + retVal___ = postHookFunc(retVal___, dest, dest_len, source, source_len); + } + } + return retVal___; +} /* guild_interface */ void HP_guild_init(bool minimal) { int hIndex = 0; @@ -43700,6 +44077,85 @@ bool HP_mapreg_config_read(const char *w1, const char *w2) { } return retVal___; } +/* md5_interface */ +void HP_md5_string(const char *string, char *output) { + int hIndex = 0; + if( HPMHooks.count.HP_md5_string_pre ) { + void (*preHookFunc) (const char **string, char **output); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_string_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_md5_string_pre[hIndex].func; + preHookFunc(&string, &output); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.md5.string(string, output); + } + if( HPMHooks.count.HP_md5_string_post ) { + void (*postHookFunc) (const char *string, char *output); + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_string_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_md5_string_post[hIndex].func; + postHookFunc(string, output); + } + } + return; +} +void HP_md5_binary(const char *string, unsigned char *output) { + int hIndex = 0; + if( HPMHooks.count.HP_md5_binary_pre ) { + void (*preHookFunc) (const char **string, unsigned char **output); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_md5_binary_pre[hIndex].func; + preHookFunc(&string, &output); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.md5.binary(string, output); + } + if( HPMHooks.count.HP_md5_binary_post ) { + void (*postHookFunc) (const char *string, unsigned char *output); + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_md5_binary_post[hIndex].func; + postHookFunc(string, output); + } + } + return; +} +void HP_md5_salt(int len, char *output) { + int hIndex = 0; + if( HPMHooks.count.HP_md5_salt_pre ) { + void (*preHookFunc) (int *len, char **output); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_salt_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_md5_salt_pre[hIndex].func; + preHookFunc(&len, &output); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.md5.salt(len, output); + } + if( HPMHooks.count.HP_md5_salt_post ) { + void (*postHookFunc) (int len, char *output); + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_salt_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_md5_salt_post[hIndex].func; + postHookFunc(len, output); + } + } + return; +} /* mercenary_interface */ void HP_mercenary_init(bool minimal) { int hIndex = 0; @@ -47225,6 +47681,270 @@ void HP_mob_destroy_mob_db(int index) { } return; } +/* mutex_interface */ +struct mutex_data* HP_mutex_create(void) { + int hIndex = 0; + struct mutex_data* retVal___ = NULL; + if( HPMHooks.count.HP_mutex_create_pre ) { + struct mutex_data* (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_create_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mutex.create(); + } + if( HPMHooks.count.HP_mutex_create_post ) { + struct mutex_data* (*postHookFunc) (struct mutex_data* retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_create_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +void HP_mutex_destroy(struct mutex_data *m) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_destroy_pre ) { + void (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_destroy_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_destroy_pre[hIndex].func; + preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.destroy(m); + } + if( HPMHooks.count.HP_mutex_destroy_post ) { + void (*postHookFunc) (struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_destroy_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_destroy_post[hIndex].func; + postHookFunc(m); + } + } + return; +} +void HP_mutex_lock(struct mutex_data *m) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_lock_pre ) { + void (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_lock_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_lock_pre[hIndex].func; + preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.lock(m); + } + if( HPMHooks.count.HP_mutex_lock_post ) { + void (*postHookFunc) (struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_lock_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_lock_post[hIndex].func; + postHookFunc(m); + } + } + return; +} +bool HP_mutex_trylock(struct mutex_data *m) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_mutex_trylock_pre ) { + bool (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_trylock_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_trylock_pre[hIndex].func; + retVal___ = preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mutex.trylock(m); + } + if( HPMHooks.count.HP_mutex_trylock_post ) { + bool (*postHookFunc) (bool retVal___, struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_trylock_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_trylock_post[hIndex].func; + retVal___ = postHookFunc(retVal___, m); + } + } + return retVal___; +} +void HP_mutex_unlock(struct mutex_data *m) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_unlock_pre ) { + void (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_unlock_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_unlock_pre[hIndex].func; + preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.unlock(m); + } + if( HPMHooks.count.HP_mutex_unlock_post ) { + void (*postHookFunc) (struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_unlock_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_unlock_post[hIndex].func; + postHookFunc(m); + } + } + return; +} +struct cond_data* HP_mutex_cond_create(void) { + int hIndex = 0; + struct cond_data* retVal___ = NULL; + if( HPMHooks.count.HP_mutex_cond_create_pre ) { + struct cond_data* (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_create_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mutex.cond_create(); + } + if( HPMHooks.count.HP_mutex_cond_create_post ) { + struct cond_data* (*postHookFunc) (struct cond_data* retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_create_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +void HP_mutex_cond_destroy(struct cond_data *c) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_destroy_pre ) { + void (*preHookFunc) (struct cond_data **c); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_destroy_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_destroy_pre[hIndex].func; + preHookFunc(&c); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_destroy(c); + } + if( HPMHooks.count.HP_mutex_cond_destroy_post ) { + void (*postHookFunc) (struct cond_data *c); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_destroy_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_destroy_post[hIndex].func; + postHookFunc(c); + } + } + return; +} +void HP_mutex_cond_wait(struct cond_data *c, struct mutex_data *m, sysint timeout_ticks) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_wait_pre ) { + void (*preHookFunc) (struct cond_data **c, struct mutex_data **m, sysint *timeout_ticks); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_wait_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_wait_pre[hIndex].func; + preHookFunc(&c, &m, &timeout_ticks); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_wait(c, m, timeout_ticks); + } + if( HPMHooks.count.HP_mutex_cond_wait_post ) { + void (*postHookFunc) (struct cond_data *c, struct mutex_data *m, sysint timeout_ticks); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_wait_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_wait_post[hIndex].func; + postHookFunc(c, m, timeout_ticks); + } + } + return; +} +void HP_mutex_cond_signal(struct cond_data *c) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_signal_pre ) { + void (*preHookFunc) (struct cond_data **c); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_signal_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_signal_pre[hIndex].func; + preHookFunc(&c); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_signal(c); + } + if( HPMHooks.count.HP_mutex_cond_signal_post ) { + void (*postHookFunc) (struct cond_data *c); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_signal_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_signal_post[hIndex].func; + postHookFunc(c); + } + } + return; +} +void HP_mutex_cond_broadcast(struct cond_data *c) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_broadcast_pre ) { + void (*preHookFunc) (struct cond_data **c); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_broadcast_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_broadcast_pre[hIndex].func; + preHookFunc(&c); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_broadcast(c); + } + if( HPMHooks.count.HP_mutex_cond_broadcast_post ) { + void (*postHookFunc) (struct cond_data *c); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_broadcast_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_broadcast_post[hIndex].func; + postHookFunc(c); + } + } + return; +} /* npc_chat_interface */ int HP_npc_chat_sub(struct block_list *bl, va_list ap) { int hIndex = 0; @@ -54182,11 +54902,11 @@ int HP_pc_stop_following(struct map_session_data *sd) { } return retVal___; } -unsigned int HP_pc_maxbaselv(struct map_session_data *sd) { +int HP_pc_maxbaselv(const struct map_session_data *sd) { int hIndex = 0; - unsigned int retVal___ = 0; + int retVal___ = 0; if( HPMHooks.count.HP_pc_maxbaselv_pre ) { - unsigned int (*preHookFunc) (struct map_session_data **sd); + int (*preHookFunc) (const struct map_session_data **sd); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_maxbaselv_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_pc_maxbaselv_pre[hIndex].func; @@ -54201,7 +54921,7 @@ unsigned int HP_pc_maxbaselv(struct map_session_data *sd) { retVal___ = HPMHooks.source.pc.maxbaselv(sd); } if( HPMHooks.count.HP_pc_maxbaselv_post ) { - unsigned int (*postHookFunc) (unsigned int retVal___, struct map_session_data *sd); + int (*postHookFunc) (int retVal___, const struct map_session_data *sd); for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_maxbaselv_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_pc_maxbaselv_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd); @@ -54209,11 +54929,11 @@ unsigned int HP_pc_maxbaselv(struct map_session_data *sd) { } return retVal___; } -unsigned int HP_pc_maxjoblv(struct map_session_data *sd) { +int HP_pc_maxjoblv(const struct map_session_data *sd) { int hIndex = 0; - unsigned int retVal___ = 0; + int retVal___ = 0; if( HPMHooks.count.HP_pc_maxjoblv_pre ) { - unsigned int (*preHookFunc) (struct map_session_data **sd); + int (*preHookFunc) (const struct map_session_data **sd); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_maxjoblv_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_pc_maxjoblv_pre[hIndex].func; @@ -54228,7 +54948,7 @@ unsigned int HP_pc_maxjoblv(struct map_session_data *sd) { retVal___ = HPMHooks.source.pc.maxjoblv(sd); } if( HPMHooks.count.HP_pc_maxjoblv_post ) { - unsigned int (*postHookFunc) (unsigned int retVal___, struct map_session_data *sd); + int (*postHookFunc) (int retVal___, const struct map_session_data *sd); for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_maxjoblv_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_pc_maxjoblv_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd); @@ -54317,11 +55037,11 @@ bool HP_pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned } return retVal___; } -unsigned int HP_pc_nextbaseexp(struct map_session_data *sd) { +unsigned int HP_pc_nextbaseexp(const struct map_session_data *sd) { int hIndex = 0; unsigned int retVal___ = 0; if( HPMHooks.count.HP_pc_nextbaseexp_pre ) { - unsigned int (*preHookFunc) (struct map_session_data **sd); + unsigned int (*preHookFunc) (const struct map_session_data **sd); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_nextbaseexp_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_pc_nextbaseexp_pre[hIndex].func; @@ -54336,7 +55056,7 @@ unsigned int HP_pc_nextbaseexp(struct map_session_data *sd) { retVal___ = HPMHooks.source.pc.nextbaseexp(sd); } if( HPMHooks.count.HP_pc_nextbaseexp_post ) { - unsigned int (*postHookFunc) (unsigned int retVal___, struct map_session_data *sd); + unsigned int (*postHookFunc) (unsigned int retVal___, const struct map_session_data *sd); for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_nextbaseexp_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_pc_nextbaseexp_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd); @@ -54344,11 +55064,11 @@ unsigned int HP_pc_nextbaseexp(struct map_session_data *sd) { } return retVal___; } -unsigned int HP_pc_thisbaseexp(struct map_session_data *sd) { +unsigned int HP_pc_thisbaseexp(const struct map_session_data *sd) { int hIndex = 0; unsigned int retVal___ = 0; if( HPMHooks.count.HP_pc_thisbaseexp_pre ) { - unsigned int (*preHookFunc) (struct map_session_data **sd); + unsigned int (*preHookFunc) (const struct map_session_data **sd); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_thisbaseexp_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_pc_thisbaseexp_pre[hIndex].func; @@ -54363,7 +55083,7 @@ unsigned int HP_pc_thisbaseexp(struct map_session_data *sd) { retVal___ = HPMHooks.source.pc.thisbaseexp(sd); } if( HPMHooks.count.HP_pc_thisbaseexp_post ) { - unsigned int (*postHookFunc) (unsigned int retVal___, struct map_session_data *sd); + unsigned int (*postHookFunc) (unsigned int retVal___, const struct map_session_data *sd); for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_thisbaseexp_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_pc_thisbaseexp_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd); @@ -54371,11 +55091,11 @@ unsigned int HP_pc_thisbaseexp(struct map_session_data *sd) { } return retVal___; } -unsigned int HP_pc_nextjobexp(struct map_session_data *sd) { +unsigned int HP_pc_nextjobexp(const struct map_session_data *sd) { int hIndex = 0; unsigned int retVal___ = 0; if( HPMHooks.count.HP_pc_nextjobexp_pre ) { - unsigned int (*preHookFunc) (struct map_session_data **sd); + unsigned int (*preHookFunc) (const struct map_session_data **sd); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_nextjobexp_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_pc_nextjobexp_pre[hIndex].func; @@ -54390,7 +55110,7 @@ unsigned int HP_pc_nextjobexp(struct map_session_data *sd) { retVal___ = HPMHooks.source.pc.nextjobexp(sd); } if( HPMHooks.count.HP_pc_nextjobexp_post ) { - unsigned int (*postHookFunc) (unsigned int retVal___, struct map_session_data *sd); + unsigned int (*postHookFunc) (unsigned int retVal___, const struct map_session_data *sd); for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_nextjobexp_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_pc_nextjobexp_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd); @@ -54398,11 +55118,11 @@ unsigned int HP_pc_nextjobexp(struct map_session_data *sd) { } return retVal___; } -unsigned int HP_pc_thisjobexp(struct map_session_data *sd) { +unsigned int HP_pc_thisjobexp(const struct map_session_data *sd) { int hIndex = 0; unsigned int retVal___ = 0; if( HPMHooks.count.HP_pc_thisjobexp_pre ) { - unsigned int (*preHookFunc) (struct map_session_data **sd); + unsigned int (*preHookFunc) (const struct map_session_data **sd); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_thisjobexp_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_pc_thisjobexp_pre[hIndex].func; @@ -54417,7 +55137,7 @@ unsigned int HP_pc_thisjobexp(struct map_session_data *sd) { retVal___ = HPMHooks.source.pc.thisjobexp(sd); } if( HPMHooks.count.HP_pc_thisjobexp_post ) { - unsigned int (*postHookFunc) (unsigned int retVal___, struct map_session_data *sd); + unsigned int (*postHookFunc) (unsigned int retVal___, const struct map_session_data *sd); for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_thisjobexp_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_pc_thisjobexp_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd); @@ -55414,11 +56134,11 @@ int HP_pc_equiplookall(struct map_session_data *sd) { } return retVal___; } -int HP_pc_readparam(struct map_session_data *sd, int type) { +int HP_pc_readparam(const struct map_session_data *sd, int type) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_pc_readparam_pre ) { - int (*preHookFunc) (struct map_session_data **sd, int *type); + int (*preHookFunc) (const struct map_session_data **sd, int *type); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_readparam_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_pc_readparam_pre[hIndex].func; @@ -55433,7 +56153,7 @@ int HP_pc_readparam(struct map_session_data *sd, int type) { retVal___ = HPMHooks.source.pc.readparam(sd, type); } if( HPMHooks.count.HP_pc_readparam_post ) { - int (*postHookFunc) (int retVal___, struct map_session_data *sd, int type); + int (*postHookFunc) (int retVal___, const struct map_session_data *sd, int type); for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_readparam_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_pc_readparam_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd, type); @@ -59879,6 +60599,220 @@ struct quest_db* HP_quest_read_db_sub(struct config_setting_t *cs, int n, const } return retVal___; } +/* rnd_interface */ +void HP_rnd_init(void) { + int hIndex = 0; + if( HPMHooks.count.HP_rnd_init_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_init_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_init_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.rnd.init(); + } + if( HPMHooks.count.HP_rnd_init_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_init_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_init_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_rnd_final(void) { + int hIndex = 0; + if( HPMHooks.count.HP_rnd_final_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_final_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_final_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.rnd.final(); + } + if( HPMHooks.count.HP_rnd_final_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_final_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_rnd_seed(uint32 seed) { + int hIndex = 0; + if( HPMHooks.count.HP_rnd_seed_pre ) { + void (*preHookFunc) (uint32 *seed); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_seed_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_seed_pre[hIndex].func; + preHookFunc(&seed); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.rnd.seed(seed); + } + if( HPMHooks.count.HP_rnd_seed_post ) { + void (*postHookFunc) (uint32 seed); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_seed_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_seed_post[hIndex].func; + postHookFunc(seed); + } + } + return; +} +int32 HP_rnd_random(void) { + int hIndex = 0; + int32 retVal___ = 0; + if( HPMHooks.count.HP_rnd_random_pre ) { + int32 (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_random_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_random_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.random(); + } + if( HPMHooks.count.HP_rnd_random_post ) { + int32 (*postHookFunc) (int32 retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_random_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_random_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +uint32 HP_rnd_roll(uint32 dice_faces) { + int hIndex = 0; + uint32 retVal___ = 0; + if( HPMHooks.count.HP_rnd_roll_pre ) { + uint32 (*preHookFunc) (uint32 *dice_faces); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_roll_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_roll_pre[hIndex].func; + retVal___ = preHookFunc(&dice_faces); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.roll(dice_faces); + } + if( HPMHooks.count.HP_rnd_roll_post ) { + uint32 (*postHookFunc) (uint32 retVal___, uint32 dice_faces); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_roll_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_roll_post[hIndex].func; + retVal___ = postHookFunc(retVal___, dice_faces); + } + } + return retVal___; +} +int32 HP_rnd_value(int32 min, int32 max) { + int hIndex = 0; + int32 retVal___ = 0; + if( HPMHooks.count.HP_rnd_value_pre ) { + int32 (*preHookFunc) (int32 *min, int32 *max); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_value_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_value_pre[hIndex].func; + retVal___ = preHookFunc(&min, &max); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.value(min, max); + } + if( HPMHooks.count.HP_rnd_value_post ) { + int32 (*postHookFunc) (int32 retVal___, int32 min, int32 max); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_value_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_value_post[hIndex].func; + retVal___ = postHookFunc(retVal___, min, max); + } + } + return retVal___; +} +double HP_rnd_uniform(void) { + int hIndex = 0; + double retVal___ = 0.; + if( HPMHooks.count.HP_rnd_uniform_pre ) { + double (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_uniform_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.uniform(); + } + if( HPMHooks.count.HP_rnd_uniform_post ) { + double (*postHookFunc) (double retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_uniform_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +double HP_rnd_uniform53(void) { + int hIndex = 0; + double retVal___ = 0.; + if( HPMHooks.count.HP_rnd_uniform53_pre ) { + double (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform53_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_uniform53_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.uniform53(); + } + if( HPMHooks.count.HP_rnd_uniform53_post ) { + double (*postHookFunc) (double retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform53_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_uniform53_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} /* script_interface */ void HP_script_init(bool minimal) { int hIndex = 0; @@ -61692,11 +62626,11 @@ const char* HP_script_parse_syntax(const char *p) { } return retVal___; } -c_op HP_script_get_com(unsigned char *scriptbuf, int *pos) { +c_op HP_script_get_com(const struct script_buf *scriptbuf, int *pos) { int hIndex = 0; c_op retVal___ = C_NOP; if( HPMHooks.count.HP_script_get_com_pre ) { - c_op (*preHookFunc) (unsigned char **scriptbuf, int **pos); + c_op (*preHookFunc) (const struct script_buf **scriptbuf, int **pos); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_com_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_script_get_com_pre[hIndex].func; @@ -61711,7 +62645,7 @@ c_op HP_script_get_com(unsigned char *scriptbuf, int *pos) { retVal___ = HPMHooks.source.script.get_com(scriptbuf, pos); } if( HPMHooks.count.HP_script_get_com_post ) { - c_op (*postHookFunc) (c_op retVal___, unsigned char *scriptbuf, int *pos); + c_op (*postHookFunc) (c_op retVal___, const struct script_buf *scriptbuf, int *pos); for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_com_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_script_get_com_post[hIndex].func; retVal___ = postHookFunc(retVal___, scriptbuf, pos); @@ -61719,11 +62653,11 @@ c_op HP_script_get_com(unsigned char *scriptbuf, int *pos) { } return retVal___; } -int HP_script_get_num(unsigned char *scriptbuf, int *pos) { +int HP_script_get_num(const struct script_buf *scriptbuf, int *pos) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_script_get_num_pre ) { - int (*preHookFunc) (unsigned char **scriptbuf, int **pos); + int (*preHookFunc) (const struct script_buf **scriptbuf, int **pos); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_num_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_script_get_num_pre[hIndex].func; @@ -61738,7 +62672,7 @@ int HP_script_get_num(unsigned char *scriptbuf, int *pos) { retVal___ = HPMHooks.source.script.get_num(scriptbuf, pos); } if( HPMHooks.count.HP_script_get_num_post ) { - int (*postHookFunc) (int retVal___, unsigned char *scriptbuf, int *pos); + int (*postHookFunc) (int retVal___, const struct script_buf *scriptbuf, int *pos); for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_num_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_script_get_num_post[hIndex].func; retVal___ = postHookFunc(retVal___, scriptbuf, pos); @@ -62221,6 +63155,140 @@ const char* HP_script_parse_simpleexpr(const char *p) { } return retVal___; } +const char* HP_script_parse_simpleexpr_paren(const char *p) { + int hIndex = 0; + const char* retVal___ = NULL; + if( HPMHooks.count.HP_script_parse_simpleexpr_paren_pre ) { + const char* (*preHookFunc) (const char **p); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_paren_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_paren_pre[hIndex].func; + retVal___ = preHookFunc(&p); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.script.parse_simpleexpr_paren(p); + } + if( HPMHooks.count.HP_script_parse_simpleexpr_paren_post ) { + const char* (*postHookFunc) (const char* retVal___, const char *p); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_paren_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_paren_post[hIndex].func; + retVal___ = postHookFunc(retVal___, p); + } + } + return retVal___; +} +const char* HP_script_parse_simpleexpr_number(const char *p) { + int hIndex = 0; + const char* retVal___ = NULL; + if( HPMHooks.count.HP_script_parse_simpleexpr_number_pre ) { + const char* (*preHookFunc) (const char **p); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_number_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_number_pre[hIndex].func; + retVal___ = preHookFunc(&p); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.script.parse_simpleexpr_number(p); + } + if( HPMHooks.count.HP_script_parse_simpleexpr_number_post ) { + const char* (*postHookFunc) (const char* retVal___, const char *p); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_number_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_number_post[hIndex].func; + retVal___ = postHookFunc(retVal___, p); + } + } + return retVal___; +} +const char* HP_script_parse_simpleexpr_string(const char *p) { + int hIndex = 0; + const char* retVal___ = NULL; + if( HPMHooks.count.HP_script_parse_simpleexpr_string_pre ) { + const char* (*preHookFunc) (const char **p); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_string_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_string_pre[hIndex].func; + retVal___ = preHookFunc(&p); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.script.parse_simpleexpr_string(p); + } + if( HPMHooks.count.HP_script_parse_simpleexpr_string_post ) { + const char* (*postHookFunc) (const char* retVal___, const char *p); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_string_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_string_post[hIndex].func; + retVal___ = postHookFunc(retVal___, p); + } + } + return retVal___; +} +const char* HP_script_parse_simpleexpr_name(const char *p) { + int hIndex = 0; + const char* retVal___ = NULL; + if( HPMHooks.count.HP_script_parse_simpleexpr_name_pre ) { + const char* (*preHookFunc) (const char **p); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_name_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_name_pre[hIndex].func; + retVal___ = preHookFunc(&p); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.script.parse_simpleexpr_name(p); + } + if( HPMHooks.count.HP_script_parse_simpleexpr_name_post ) { + const char* (*postHookFunc) (const char* retVal___, const char *p); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_name_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_name_post[hIndex].func; + retVal___ = postHookFunc(retVal___, p); + } + } + return retVal___; +} +void HP_script_add_translatable_string(const struct script_string_buf *string, const char *start_point) { + int hIndex = 0; + if( HPMHooks.count.HP_script_add_translatable_string_pre ) { + void (*preHookFunc) (const struct script_string_buf **string, const char **start_point); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_add_translatable_string_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_add_translatable_string_pre[hIndex].func; + preHookFunc(&string, &start_point); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.add_translatable_string(string, start_point); + } + if( HPMHooks.count.HP_script_add_translatable_string_post ) { + void (*postHookFunc) (const struct script_string_buf *string, const char *start_point); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_add_translatable_string_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_add_translatable_string_post[hIndex].func; + postHookFunc(string, start_point); + } + } + return; +} const char* HP_script_parse_expr(const char *p) { int hIndex = 0; const char* retVal___ = NULL; @@ -62824,31 +63892,32 @@ void HP_script_op_1(struct script_state *st, int op) { } return; } -void HP_script_check_buildin_argtype(struct script_state *st, int func) { +bool HP_script_check_buildin_argtype(struct script_state *st, int func) { int hIndex = 0; + bool retVal___ = false; if( HPMHooks.count.HP_script_check_buildin_argtype_pre ) { - void (*preHookFunc) (struct script_state **st, int *func); + bool (*preHookFunc) (struct script_state **st, int *func); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_script_check_buildin_argtype_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_script_check_buildin_argtype_pre[hIndex].func; - preHookFunc(&st, &func); + retVal___ = preHookFunc(&st, &func); } if( *HPMforce_return ) { *HPMforce_return = false; - return; + return retVal___; } } { - HPMHooks.source.script.check_buildin_argtype(st, func); + retVal___ = HPMHooks.source.script.check_buildin_argtype(st, func); } if( HPMHooks.count.HP_script_check_buildin_argtype_post ) { - void (*postHookFunc) (struct script_state *st, int func); + bool (*postHookFunc) (bool retVal___, struct script_state *st, int func); for(hIndex = 0; hIndex < HPMHooks.count.HP_script_check_buildin_argtype_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_script_check_buildin_argtype_post[hIndex].func; - postHookFunc(st, func); + retVal___ = postHookFunc(retVal___, st, func); } } - return; + return retVal___; } void HP_script_detach_state(struct script_state *st, bool dequeue_event) { int hIndex = 0; @@ -64245,31 +65314,59 @@ void HP_script_load_translations(void) { } return; } -void HP_script_load_translation(const char *file, uint8 lang_id, uint32 *total) { +bool HP_script_load_translation_addstring(const char *file, uint8 lang_id, const char *msgctxt, const struct script_string_buf *msgid, const struct script_string_buf *msgstr) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_script_load_translation_addstring_pre ) { + bool (*preHookFunc) (const char **file, uint8 *lang_id, const char **msgctxt, const struct script_string_buf **msgid, const struct script_string_buf **msgstr); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_load_translation_addstring_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_load_translation_addstring_pre[hIndex].func; + retVal___ = preHookFunc(&file, &lang_id, &msgctxt, &msgid, &msgstr); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.script.load_translation_addstring(file, lang_id, msgctxt, msgid, msgstr); + } + if( HPMHooks.count.HP_script_load_translation_addstring_post ) { + bool (*postHookFunc) (bool retVal___, const char *file, uint8 lang_id, const char *msgctxt, const struct script_string_buf *msgid, const struct script_string_buf *msgstr); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_load_translation_addstring_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_load_translation_addstring_post[hIndex].func; + retVal___ = postHookFunc(retVal___, file, lang_id, msgctxt, msgid, msgstr); + } + } + return retVal___; +} +int HP_script_load_translation(const char *file, uint8 lang_id) { int hIndex = 0; + int retVal___ = 0; if( HPMHooks.count.HP_script_load_translation_pre ) { - void (*preHookFunc) (const char **file, uint8 *lang_id, uint32 **total); + int (*preHookFunc) (const char **file, uint8 *lang_id); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_script_load_translation_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_script_load_translation_pre[hIndex].func; - preHookFunc(&file, &lang_id, &total); + retVal___ = preHookFunc(&file, &lang_id); } if( *HPMforce_return ) { *HPMforce_return = false; - return; + return retVal___; } } { - HPMHooks.source.script.load_translation(file, lang_id, total); + retVal___ = HPMHooks.source.script.load_translation(file, lang_id); } if( HPMHooks.count.HP_script_load_translation_post ) { - void (*postHookFunc) (const char *file, uint8 lang_id, uint32 *total); + int (*postHookFunc) (int retVal___, const char *file, uint8 lang_id); for(hIndex = 0; hIndex < HPMHooks.count.HP_script_load_translation_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_script_load_translation_post[hIndex].func; - postHookFunc(file, lang_id, total); + retVal___ = postHookFunc(retVal___, file, lang_id); } } - return; + return retVal___; } int HP_script_translation_db_destroyer(union DBKey key, struct DBData *data, va_list ap) { int hIndex = 0; @@ -67538,6 +68635,33 @@ int HP_skill_not_ok(uint16 skill_id, struct map_session_data *sd) { } return retVal___; } +int HP_skill_not_ok_unknown(uint16 skill_id, struct map_session_data *sd) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_skill_not_ok_unknown_pre ) { + int (*preHookFunc) (uint16 *skill_id, struct map_session_data **sd); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_not_ok_unknown_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_not_ok_unknown_pre[hIndex].func; + retVal___ = preHookFunc(&skill_id, &sd); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.skill.not_ok_unknown(skill_id, sd); + } + if( HPMHooks.count.HP_skill_not_ok_unknown_post ) { + int (*postHookFunc) (int retVal___, uint16 skill_id, struct map_session_data *sd); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_not_ok_unknown_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_not_ok_unknown_post[hIndex].func; + retVal___ = postHookFunc(retVal___, skill_id, sd); + } + } + return retVal___; +} int HP_skill_not_ok_hom(uint16 skill_id, struct homun_data *hd) { int hIndex = 0; int retVal___ = 0; @@ -67565,6 +68689,33 @@ int HP_skill_not_ok_hom(uint16 skill_id, struct homun_data *hd) { } return retVal___; } +int HP_skill_not_ok_hom_unknown(uint16 skill_id, struct homun_data *hd) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_skill_not_ok_hom_unknown_pre ) { + int (*preHookFunc) (uint16 *skill_id, struct homun_data **hd); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_not_ok_hom_unknown_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_not_ok_hom_unknown_pre[hIndex].func; + retVal___ = preHookFunc(&skill_id, &hd); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.skill.not_ok_hom_unknown(skill_id, hd); + } + if( HPMHooks.count.HP_skill_not_ok_hom_unknown_post ) { + int (*postHookFunc) (int retVal___, uint16 skill_id, struct homun_data *hd); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_not_ok_hom_unknown_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_not_ok_hom_unknown_post[hIndex].func; + retVal___ = postHookFunc(retVal___, skill_id, hd); + } + } + return retVal___; +} int HP_skill_not_ok_mercenary(uint16 skill_id, struct mercenary_data *md) { int hIndex = 0; int retVal___ = 0; @@ -67706,6 +68857,32 @@ int HP_skill_arrow_create(struct map_session_data *sd, int nameid) { } return retVal___; } +void HP_skill_castend_type(int type, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) { + int hIndex = 0; + if( HPMHooks.count.HP_skill_castend_type_pre ) { + void (*preHookFunc) (int *type, struct block_list **src, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_type_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_castend_type_pre[hIndex].func; + preHookFunc(&type, &src, &bl, &skill_id, &skill_lv, &tick, &flag); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.skill.castend_type(type, src, bl, skill_id, skill_lv, tick, flag); + } + if( HPMHooks.count.HP_skill_castend_type_post ) { + void (*postHookFunc) (int type, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_type_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_castend_type_post[hIndex].func; + postHookFunc(type, src, bl, skill_id, skill_lv, tick, flag); + } + } + return; +} int HP_skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) { int hIndex = 0; int retVal___ = 0; @@ -68938,6 +70115,32 @@ int HP_skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, i } return retVal___; } +void HP_skill_unit_onplace_timer_unknown(struct skill_unit *src, struct block_list *bl, int64 *tick) { + int hIndex = 0; + if( HPMHooks.count.HP_skill_unit_onplace_timer_unknown_pre ) { + void (*preHookFunc) (struct skill_unit **src, struct block_list **bl, int64 **tick); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onplace_timer_unknown_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_unit_onplace_timer_unknown_pre[hIndex].func; + preHookFunc(&src, &bl, &tick); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.skill.unit_onplace_timer_unknown(src, bl, tick); + } + if( HPMHooks.count.HP_skill_unit_onplace_timer_unknown_post ) { + void (*postHookFunc) (struct skill_unit *src, struct block_list *bl, int64 *tick); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onplace_timer_unknown_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_unit_onplace_timer_unknown_post[hIndex].func; + postHookFunc(src, bl, tick); + } + } + return; +} int HP_skill_unit_effect(struct block_list *bl, va_list ap) { int hIndex = 0; int retVal___ = 0; @@ -69231,96 +70434,405 @@ void HP_skill_init_unit_layout(void) { } return; } -bool HP_skill_parse_row_skilldb(char *split[], int columns, int current) { +void HP_skill_init_unit_layout_unknown(int skill_idx) { int hIndex = 0; - bool retVal___ = false; - if( HPMHooks.count.HP_skill_parse_row_skilldb_pre ) { - bool (*preHookFunc) (char **split[], int *columns, int *current); + if( HPMHooks.count.HP_skill_init_unit_layout_unknown_pre ) { + void (*preHookFunc) (int *skill_idx); *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_skilldb_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_skill_parse_row_skilldb_pre[hIndex].func; - retVal___ = preHookFunc(&split, &columns, ¤t); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_init_unit_layout_unknown_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_init_unit_layout_unknown_pre[hIndex].func; + preHookFunc(&skill_idx); } if( *HPMforce_return ) { *HPMforce_return = false; - return retVal___; + return; } } { - retVal___ = HPMHooks.source.skill.parse_row_skilldb(split, columns, current); + HPMHooks.source.skill.init_unit_layout_unknown(skill_idx); } - if( HPMHooks.count.HP_skill_parse_row_skilldb_post ) { - bool (*postHookFunc) (bool retVal___, char *split[], int columns, int current); - for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_skilldb_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_skill_parse_row_skilldb_post[hIndex].func; - retVal___ = postHookFunc(retVal___, split, columns, current); + if( HPMHooks.count.HP_skill_init_unit_layout_unknown_post ) { + void (*postHookFunc) (int skill_idx); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_init_unit_layout_unknown_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_init_unit_layout_unknown_post[hIndex].func; + postHookFunc(skill_idx); } } - return retVal___; + return; } -bool HP_skill_parse_row_requiredb(char *split[], int columns, int current) { +void HP_skill_validate_hittype(struct config_setting_t *conf, struct s_skill_db *sk) { int hIndex = 0; - bool retVal___ = false; - if( HPMHooks.count.HP_skill_parse_row_requiredb_pre ) { - bool (*preHookFunc) (char **split[], int *columns, int *current); + if( HPMHooks.count.HP_skill_validate_hittype_pre ) { + void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk); *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_requiredb_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_skill_parse_row_requiredb_pre[hIndex].func; - retVal___ = preHookFunc(&split, &columns, ¤t); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_hittype_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_hittype_pre[hIndex].func; + preHookFunc(&conf, &sk); } if( *HPMforce_return ) { *HPMforce_return = false; - return retVal___; + return; } } { - retVal___ = HPMHooks.source.skill.parse_row_requiredb(split, columns, current); + HPMHooks.source.skill.validate_hittype(conf, sk); } - if( HPMHooks.count.HP_skill_parse_row_requiredb_post ) { - bool (*postHookFunc) (bool retVal___, char *split[], int columns, int current); - for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_requiredb_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_skill_parse_row_requiredb_post[hIndex].func; - retVal___ = postHookFunc(retVal___, split, columns, current); + if( HPMHooks.count.HP_skill_validate_hittype_post ) { + void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_hittype_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_hittype_post[hIndex].func; + postHookFunc(conf, sk); } } - return retVal___; + return; } -bool HP_skill_parse_row_castdb(char *split[], int columns, int current) { +void HP_skill_validate_skilltype(struct config_setting_t *conf, struct s_skill_db *sk) { int hIndex = 0; - bool retVal___ = false; - if( HPMHooks.count.HP_skill_parse_row_castdb_pre ) { - bool (*preHookFunc) (char **split[], int *columns, int *current); + if( HPMHooks.count.HP_skill_validate_skilltype_pre ) { + void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk); *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_castdb_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_skill_parse_row_castdb_pre[hIndex].func; - retVal___ = preHookFunc(&split, &columns, ¤t); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_skilltype_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_skilltype_pre[hIndex].func; + preHookFunc(&conf, &sk); } if( *HPMforce_return ) { *HPMforce_return = false; - return retVal___; + return; } } { - retVal___ = HPMHooks.source.skill.parse_row_castdb(split, columns, current); + HPMHooks.source.skill.validate_skilltype(conf, sk); } - if( HPMHooks.count.HP_skill_parse_row_castdb_post ) { - bool (*postHookFunc) (bool retVal___, char *split[], int columns, int current); - for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_castdb_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_skill_parse_row_castdb_post[hIndex].func; - retVal___ = postHookFunc(retVal___, split, columns, current); + if( HPMHooks.count.HP_skill_validate_skilltype_post ) { + void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_skilltype_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_skilltype_post[hIndex].func; + postHookFunc(conf, sk); } } - return retVal___; + return; +} +void HP_skill_validate_attacktype(struct config_setting_t *conf, struct s_skill_db *sk) { + int hIndex = 0; + if( HPMHooks.count.HP_skill_validate_attacktype_pre ) { + void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_attacktype_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_attacktype_pre[hIndex].func; + preHookFunc(&conf, &sk); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.skill.validate_attacktype(conf, sk); + } + if( HPMHooks.count.HP_skill_validate_attacktype_post ) { + void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_attacktype_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_attacktype_post[hIndex].func; + postHookFunc(conf, sk); + } + } + return; +} +void HP_skill_validate_element(struct config_setting_t *conf, struct s_skill_db *sk) { + int hIndex = 0; + if( HPMHooks.count.HP_skill_validate_element_pre ) { + void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_element_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_element_pre[hIndex].func; + preHookFunc(&conf, &sk); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.skill.validate_element(conf, sk); + } + if( HPMHooks.count.HP_skill_validate_element_post ) { + void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_element_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_element_post[hIndex].func; + postHookFunc(conf, sk); + } + } + return; +} +void HP_skill_validate_skillinfo(struct config_setting_t *conf, struct s_skill_db *sk) { + int hIndex = 0; + if( HPMHooks.count.HP_skill_validate_skillinfo_pre ) { + void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_skillinfo_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_skillinfo_pre[hIndex].func; + preHookFunc(&conf, &sk); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.skill.validate_skillinfo(conf, sk); + } + if( HPMHooks.count.HP_skill_validate_skillinfo_post ) { + void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_skillinfo_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_skillinfo_post[hIndex].func; + postHookFunc(conf, sk); + } + } + return; +} +void HP_skill_validate_damagetype(struct config_setting_t *conf, struct s_skill_db *sk) { + int hIndex = 0; + if( HPMHooks.count.HP_skill_validate_damagetype_pre ) { + void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_damagetype_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_damagetype_pre[hIndex].func; + preHookFunc(&conf, &sk); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.skill.validate_damagetype(conf, sk); + } + if( HPMHooks.count.HP_skill_validate_damagetype_post ) { + void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_damagetype_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_damagetype_post[hIndex].func; + postHookFunc(conf, sk); + } + } + return; +} +void HP_skill_validate_castnodex(struct config_setting_t *conf, struct s_skill_db *sk, bool delay) { + int hIndex = 0; + if( HPMHooks.count.HP_skill_validate_castnodex_pre ) { + void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk, bool *delay); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_castnodex_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_castnodex_pre[hIndex].func; + preHookFunc(&conf, &sk, &delay); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.skill.validate_castnodex(conf, sk, delay); + } + if( HPMHooks.count.HP_skill_validate_castnodex_post ) { + void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk, bool delay); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_castnodex_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_castnodex_post[hIndex].func; + postHookFunc(conf, sk, delay); + } + } + return; +} +void HP_skill_validate_weapontype(struct config_setting_t *conf, struct s_skill_db *sk) { + int hIndex = 0; + if( HPMHooks.count.HP_skill_validate_weapontype_pre ) { + void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_weapontype_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_weapontype_pre[hIndex].func; + preHookFunc(&conf, &sk); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.skill.validate_weapontype(conf, sk); + } + if( HPMHooks.count.HP_skill_validate_weapontype_post ) { + void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_weapontype_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_weapontype_post[hIndex].func; + postHookFunc(conf, sk); + } + } + return; +} +void HP_skill_validate_ammotype(struct config_setting_t *conf, struct s_skill_db *sk) { + int hIndex = 0; + if( HPMHooks.count.HP_skill_validate_ammotype_pre ) { + void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_ammotype_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_ammotype_pre[hIndex].func; + preHookFunc(&conf, &sk); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.skill.validate_ammotype(conf, sk); + } + if( HPMHooks.count.HP_skill_validate_ammotype_post ) { + void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_ammotype_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_ammotype_post[hIndex].func; + postHookFunc(conf, sk); + } + } + return; +} +void HP_skill_validate_state(struct config_setting_t *conf, struct s_skill_db *sk) { + int hIndex = 0; + if( HPMHooks.count.HP_skill_validate_state_pre ) { + void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_state_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_state_pre[hIndex].func; + preHookFunc(&conf, &sk); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.skill.validate_state(conf, sk); + } + if( HPMHooks.count.HP_skill_validate_state_post ) { + void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_state_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_state_post[hIndex].func; + postHookFunc(conf, sk); + } + } + return; +} +void HP_skill_validate_item_requirements(struct config_setting_t *conf, struct s_skill_db *sk) { + int hIndex = 0; + if( HPMHooks.count.HP_skill_validate_item_requirements_pre ) { + void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_item_requirements_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_item_requirements_pre[hIndex].func; + preHookFunc(&conf, &sk); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.skill.validate_item_requirements(conf, sk); + } + if( HPMHooks.count.HP_skill_validate_item_requirements_post ) { + void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_item_requirements_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_item_requirements_post[hIndex].func; + postHookFunc(conf, sk); + } + } + return; +} +void HP_skill_validate_unit_target(struct config_setting_t *conf, struct s_skill_db *sk) { + int hIndex = 0; + if( HPMHooks.count.HP_skill_validate_unit_target_pre ) { + void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_unit_target_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_unit_target_pre[hIndex].func; + preHookFunc(&conf, &sk); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.skill.validate_unit_target(conf, sk); + } + if( HPMHooks.count.HP_skill_validate_unit_target_post ) { + void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_unit_target_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_unit_target_post[hIndex].func; + postHookFunc(conf, sk); + } + } + return; +} +void HP_skill_validate_unit_flag(struct config_setting_t *conf, struct s_skill_db *sk) { + int hIndex = 0; + if( HPMHooks.count.HP_skill_validate_unit_flag_pre ) { + void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_unit_flag_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_unit_flag_pre[hIndex].func; + preHookFunc(&conf, &sk); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.skill.validate_unit_flag(conf, sk); + } + if( HPMHooks.count.HP_skill_validate_unit_flag_post ) { + void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_unit_flag_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_unit_flag_post[hIndex].func; + postHookFunc(conf, sk); + } + } + return; +} +void HP_skill_validate_additional_fields(struct config_setting_t *conf, struct s_skill_db *sk) { + int hIndex = 0; + if( HPMHooks.count.HP_skill_validate_additional_fields_pre ) { + void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_additional_fields_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_additional_fields_pre[hIndex].func; + preHookFunc(&conf, &sk); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.skill.validate_additional_fields(conf, sk); + } + if( HPMHooks.count.HP_skill_validate_additional_fields_post ) { + void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_additional_fields_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_additional_fields_post[hIndex].func; + postHookFunc(conf, sk); + } + } + return; } -bool HP_skill_parse_row_castnodexdb(char *split[], int columns, int current) { +bool HP_skill_validate_skilldb(struct s_skill_db *skt, const char *source) { int hIndex = 0; bool retVal___ = false; - if( HPMHooks.count.HP_skill_parse_row_castnodexdb_pre ) { - bool (*preHookFunc) (char **split[], int *columns, int *current); + if( HPMHooks.count.HP_skill_validate_skilldb_pre ) { + bool (*preHookFunc) (struct s_skill_db **skt, const char **source); *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_castnodexdb_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_skill_parse_row_castnodexdb_pre[hIndex].func; - retVal___ = preHookFunc(&split, &columns, ¤t); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_skilldb_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_skilldb_pre[hIndex].func; + retVal___ = preHookFunc(&skt, &source); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -69328,26 +70840,26 @@ bool HP_skill_parse_row_castnodexdb(char *split[], int columns, int current) { } } { - retVal___ = HPMHooks.source.skill.parse_row_castnodexdb(split, columns, current); + retVal___ = HPMHooks.source.skill.validate_skilldb(skt, source); } - if( HPMHooks.count.HP_skill_parse_row_castnodexdb_post ) { - bool (*postHookFunc) (bool retVal___, char *split[], int columns, int current); - for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_castnodexdb_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_skill_parse_row_castnodexdb_post[hIndex].func; - retVal___ = postHookFunc(retVal___, split, columns, current); + if( HPMHooks.count.HP_skill_validate_skilldb_post ) { + bool (*postHookFunc) (bool retVal___, struct s_skill_db *skt, const char *source); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_skilldb_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_skilldb_post[hIndex].func; + retVal___ = postHookFunc(retVal___, skt, source); } } return retVal___; } -bool HP_skill_parse_row_unitdb(char *split[], int columns, int current) { +bool HP_skill_read_skilldb(const char *filename) { int hIndex = 0; bool retVal___ = false; - if( HPMHooks.count.HP_skill_parse_row_unitdb_pre ) { - bool (*preHookFunc) (char **split[], int *columns, int *current); + if( HPMHooks.count.HP_skill_read_skilldb_pre ) { + bool (*preHookFunc) (const char **filename); *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_unitdb_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_skill_parse_row_unitdb_pre[hIndex].func; - retVal___ = preHookFunc(&split, &columns, ¤t); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_read_skilldb_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_read_skilldb_pre[hIndex].func; + retVal___ = preHookFunc(&filename); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -69355,17 +70867,69 @@ bool HP_skill_parse_row_unitdb(char *split[], int columns, int current) { } } { - retVal___ = HPMHooks.source.skill.parse_row_unitdb(split, columns, current); + retVal___ = HPMHooks.source.skill.read_skilldb(filename); } - if( HPMHooks.count.HP_skill_parse_row_unitdb_post ) { - bool (*postHookFunc) (bool retVal___, char *split[], int columns, int current); - for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_unitdb_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_skill_parse_row_unitdb_post[hIndex].func; - retVal___ = postHookFunc(retVal___, split, columns, current); + if( HPMHooks.count.HP_skill_read_skilldb_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_read_skilldb_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_read_skilldb_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename); } } return retVal___; } +void HP_skill_config_set_level(struct config_setting_t *conf, int *arr) { + int hIndex = 0; + if( HPMHooks.count.HP_skill_config_set_level_pre ) { + void (*preHookFunc) (struct config_setting_t **conf, int **arr); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_config_set_level_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_config_set_level_pre[hIndex].func; + preHookFunc(&conf, &arr); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.skill.config_set_level(conf, arr); + } + if( HPMHooks.count.HP_skill_config_set_level_post ) { + void (*postHookFunc) (struct config_setting_t *conf, int *arr); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_config_set_level_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_config_set_level_post[hIndex].func; + postHookFunc(conf, arr); + } + } + return; +} +void HP_skill_level_set_value(int *arr, int value) { + int hIndex = 0; + if( HPMHooks.count.HP_skill_level_set_value_pre ) { + void (*preHookFunc) (int **arr, int *value); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_level_set_value_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_level_set_value_pre[hIndex].func; + preHookFunc(&arr, &value); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.skill.level_set_value(arr, value); + } + if( HPMHooks.count.HP_skill_level_set_value_post ) { + void (*postHookFunc) (int *arr, int value); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_level_set_value_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_level_set_value_post[hIndex].func; + postHookFunc(arr, value); + } + } + return; +} bool HP_skill_parse_row_producedb(char *split[], int columns, int current) { int hIndex = 0; bool retVal___ = false; @@ -70865,6 +72429,99 @@ void HP_skill_get_requirement_unknown(struct status_change *sc, struct map_sessi } return; } +int HP_skill_splash_target(struct block_list *bl) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_skill_splash_target_pre ) { + int (*preHookFunc) (struct block_list **bl); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_splash_target_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_splash_target_pre[hIndex].func; + retVal___ = preHookFunc(&bl); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.skill.splash_target(bl); + } + if( HPMHooks.count.HP_skill_splash_target_post ) { + int (*postHookFunc) (int retVal___, struct block_list *bl); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_splash_target_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_splash_target_post[hIndex].func; + retVal___ = postHookFunc(retVal___, bl); + } + } + return retVal___; +} +int HP_skill_check_npc_chaospanic(struct block_list *bl, va_list args) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_skill_check_npc_chaospanic_pre ) { + int (*preHookFunc) (struct block_list **bl, va_list args); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_npc_chaospanic_pre; hIndex++ ) { + va_list args___copy; va_copy(args___copy, args); + preHookFunc = HPMHooks.list.HP_skill_check_npc_chaospanic_pre[hIndex].func; + retVal___ = preHookFunc(&bl, args___copy); + va_end(args___copy); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + va_list args___copy; va_copy(args___copy, args); + retVal___ = HPMHooks.source.skill.check_npc_chaospanic(bl, args___copy); + va_end(args___copy); + } + if( HPMHooks.count.HP_skill_check_npc_chaospanic_post ) { + int (*postHookFunc) (int retVal___, struct block_list *bl, va_list args); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_npc_chaospanic_post; hIndex++ ) { + va_list args___copy; va_copy(args___copy, args); + postHookFunc = HPMHooks.list.HP_skill_check_npc_chaospanic_post[hIndex].func; + retVal___ = postHookFunc(retVal___, bl, args___copy); + va_end(args___copy); + } + } + return retVal___; +} +int HP_skill_count_wos(struct block_list *bl, va_list ap) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_skill_count_wos_pre ) { + int (*preHookFunc) (struct block_list **bl, va_list ap); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_count_wos_pre; hIndex++ ) { + va_list ap___copy; va_copy(ap___copy, ap); + preHookFunc = HPMHooks.list.HP_skill_count_wos_pre[hIndex].func; + retVal___ = preHookFunc(&bl, ap___copy); + va_end(ap___copy); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + va_list ap___copy; va_copy(ap___copy, ap); + retVal___ = HPMHooks.source.skill.count_wos(bl, ap___copy); + va_end(ap___copy); + } + if( HPMHooks.count.HP_skill_count_wos_post ) { + int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_count_wos_post; hIndex++ ) { + va_list ap___copy; va_copy(ap___copy, ap); + postHookFunc = HPMHooks.list.HP_skill_count_wos_post[hIndex].func; + retVal___ = postHookFunc(retVal___, bl, ap___copy); + va_end(ap___copy); + } + } + return retVal___; +} /* socket_interface */ void HP_sockt_init(void) { int hIndex = 0; @@ -75504,6 +77161,112 @@ void HP_status_read_job_db_sub(int idx, const char *name, struct config_setting_ } return; } +void HP_status_set_sc(uint16 skill_id, sc_type sc, int icon, unsigned int flag) { + int hIndex = 0; + if( HPMHooks.count.HP_status_set_sc_pre ) { + void (*preHookFunc) (uint16 *skill_id, sc_type *sc, int *icon, unsigned int *flag); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_status_set_sc_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_status_set_sc_pre[hIndex].func; + preHookFunc(&skill_id, &sc, &icon, &flag); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.status.set_sc(skill_id, sc, icon, flag); + } + if( HPMHooks.count.HP_status_set_sc_post ) { + void (*postHookFunc) (uint16 skill_id, sc_type sc, int icon, unsigned int flag); + for(hIndex = 0; hIndex < HPMHooks.count.HP_status_set_sc_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_status_set_sc_post[hIndex].func; + postHookFunc(skill_id, sc, icon, flag); + } + } + return; +} +void HP_status_copy(struct status_data *a, const struct status_data *b) { + int hIndex = 0; + if( HPMHooks.count.HP_status_copy_pre ) { + void (*preHookFunc) (struct status_data **a, const struct status_data **b); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_status_copy_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_status_copy_pre[hIndex].func; + preHookFunc(&a, &b); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.status.copy(a, b); + } + if( HPMHooks.count.HP_status_copy_post ) { + void (*postHookFunc) (struct status_data *a, const struct status_data *b); + for(hIndex = 0; hIndex < HPMHooks.count.HP_status_copy_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_status_copy_post[hIndex].func; + postHookFunc(a, b); + } + } + return; +} +unsigned short HP_status_base_matk_min(const struct status_data *st) { + int hIndex = 0; + unsigned short retVal___ = 0; + if( HPMHooks.count.HP_status_base_matk_min_pre ) { + unsigned short (*preHookFunc) (const struct status_data **st); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_status_base_matk_min_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_status_base_matk_min_pre[hIndex].func; + retVal___ = preHookFunc(&st); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.status.base_matk_min(st); + } + if( HPMHooks.count.HP_status_base_matk_min_post ) { + unsigned short (*postHookFunc) (unsigned short retVal___, const struct status_data *st); + for(hIndex = 0; hIndex < HPMHooks.count.HP_status_base_matk_min_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_status_base_matk_min_post[hIndex].func; + retVal___ = postHookFunc(retVal___, st); + } + } + return retVal___; +} +unsigned short HP_status_base_matk_max(const struct status_data *st) { + int hIndex = 0; + unsigned short retVal___ = 0; + if( HPMHooks.count.HP_status_base_matk_max_pre ) { + unsigned short (*preHookFunc) (const struct status_data **st); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_status_base_matk_max_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_status_base_matk_max_pre[hIndex].func; + retVal___ = preHookFunc(&st); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.status.base_matk_max(st); + } + if( HPMHooks.count.HP_status_base_matk_max_post ) { + unsigned short (*postHookFunc) (unsigned short retVal___, const struct status_data *st); + for(hIndex = 0; hIndex < HPMHooks.count.HP_status_base_matk_max_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_status_base_matk_max_post[hIndex].func; + retVal___ = postHookFunc(retVal___, st); + } + } + return retVal___; +} /* storage_interface */ void HP_storage_reconnect(void) { int hIndex = 0; @@ -77211,6 +78974,299 @@ void HP_sysinfo_final(void) { } return; } +/* thread_interface */ +void HP_thread_init(void) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_init_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_init_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_init_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.init(); + } + if( HPMHooks.count.HP_thread_init_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_init_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_init_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_thread_final(void) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_final_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_final_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_final_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.final(); + } + if( HPMHooks.count.HP_thread_final_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_final_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +struct thread_handle* HP_thread_create(threadFunc entry_point, void *param) { + int hIndex = 0; + struct thread_handle* retVal___ = NULL; + if( HPMHooks.count.HP_thread_create_pre ) { + struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_create_pre[hIndex].func; + retVal___ = preHookFunc(&entry_point, ¶m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.create(entry_point, param); + } + if( HPMHooks.count.HP_thread_create_post ) { + struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_create_post[hIndex].func; + retVal___ = postHookFunc(retVal___, entry_point, param); + } + } + return retVal___; +} +struct thread_handle* HP_thread_create_opt(threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio) { + int hIndex = 0; + struct thread_handle* retVal___ = NULL; + if( HPMHooks.count.HP_thread_create_opt_pre ) { + struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param, size_t *stack_size, enum thread_priority *prio); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_create_opt_pre[hIndex].func; + retVal___ = preHookFunc(&entry_point, ¶m, &stack_size, &prio); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.create_opt(entry_point, param, stack_size, prio); + } + if( HPMHooks.count.HP_thread_create_opt_post ) { + struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_create_opt_post[hIndex].func; + retVal___ = postHookFunc(retVal___, entry_point, param, stack_size, prio); + } + } + return retVal___; +} +void HP_thread_destroy(struct thread_handle *handle) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_destroy_pre ) { + void (*preHookFunc) (struct thread_handle **handle); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_destroy_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_destroy_pre[hIndex].func; + preHookFunc(&handle); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.destroy(handle); + } + if( HPMHooks.count.HP_thread_destroy_post ) { + void (*postHookFunc) (struct thread_handle *handle); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_destroy_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_destroy_post[hIndex].func; + postHookFunc(handle); + } + } + return; +} +struct thread_handle* HP_thread_self(void) { + int hIndex = 0; + struct thread_handle* retVal___ = NULL; + if( HPMHooks.count.HP_thread_self_pre ) { + struct thread_handle* (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_self_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.self(); + } + if( HPMHooks.count.HP_thread_self_post ) { + struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_self_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +int HP_thread_get_tid(void) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_thread_get_tid_pre ) { + int (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_get_tid_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_get_tid_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.get_tid(); + } + if( HPMHooks.count.HP_thread_get_tid_post ) { + int (*postHookFunc) (int retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_get_tid_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_get_tid_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +bool HP_thread_wait(struct thread_handle *handle, void **out_exit_code) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_thread_wait_pre ) { + bool (*preHookFunc) (struct thread_handle **handle, void ***out_exit_code); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_wait_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_wait_pre[hIndex].func; + retVal___ = preHookFunc(&handle, &out_exit_code); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.wait(handle, out_exit_code); + } + if( HPMHooks.count.HP_thread_wait_post ) { + bool (*postHookFunc) (bool retVal___, struct thread_handle *handle, void **out_exit_code); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_wait_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_wait_post[hIndex].func; + retVal___ = postHookFunc(retVal___, handle, out_exit_code); + } + } + return retVal___; +} +void HP_thread_prio_set(struct thread_handle *handle, enum thread_priority prio) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_prio_set_pre ) { + void (*preHookFunc) (struct thread_handle **handle, enum thread_priority *prio); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_set_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_prio_set_pre[hIndex].func; + preHookFunc(&handle, &prio); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.prio_set(handle, prio); + } + if( HPMHooks.count.HP_thread_prio_set_post ) { + void (*postHookFunc) (struct thread_handle *handle, enum thread_priority prio); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_set_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_prio_set_post[hIndex].func; + postHookFunc(handle, prio); + } + } + return; +} +enum thread_priority HP_thread_prio_get(struct thread_handle *handle) { + int hIndex = 0; + enum thread_priority retVal___ = THREADPRIO_NORMAL; + if( HPMHooks.count.HP_thread_prio_get_pre ) { + enum thread_priority (*preHookFunc) (struct thread_handle **handle); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_get_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_prio_get_pre[hIndex].func; + retVal___ = preHookFunc(&handle); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.prio_get(handle); + } + if( HPMHooks.count.HP_thread_prio_get_post ) { + enum thread_priority (*postHookFunc) (enum thread_priority retVal___, struct thread_handle *handle); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_get_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_prio_get_post[hIndex].func; + retVal___ = postHookFunc(retVal___, handle); + } + } + return retVal___; +} +void HP_thread_yield(void) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_yield_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_yield_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_yield_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.yield(); + } + if( HPMHooks.count.HP_thread_yield_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_yield_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_yield_post[hIndex].func; + postHookFunc(); + } + } + return; +} /* timer_interface */ int64 HP_timer_gettick(void) { int hIndex = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_map.sources.inc b/src/plugins/HPMHooking/HPMHooking_map.sources.inc index 1af35ab21..54861ed6f 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.sources.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.sources.inc @@ -23,6 +23,8 @@ * as it will get overwritten. */ +/* GENERATED FILE DO NOT EDIT */ + memcpy(&HPMHooks.source.HCache, HCache, sizeof(struct HCache_interface)); memcpy(&HPMHooks.source.atcommand, atcommand, sizeof(struct atcommand_interface)); memcpy(&HPMHooks.source.battle, battle, sizeof(struct battle_interface)); @@ -36,8 +38,10 @@ memcpy(&HPMHooks.source.cmdline, cmdline, sizeof(struct cmdline_interface)); memcpy(&HPMHooks.source.console, console, sizeof(struct console_interface)); memcpy(&HPMHooks.source.core, core, sizeof(struct core_interface)); memcpy(&HPMHooks.source.DB, DB, sizeof(struct db_interface)); +memcpy(&HPMHooks.source.des, des, sizeof(struct des_interface)); memcpy(&HPMHooks.source.duel, duel, sizeof(struct duel_interface)); memcpy(&HPMHooks.source.elemental, elemental, sizeof(struct elemental_interface)); +memcpy(&HPMHooks.source.grfio, grfio, sizeof(struct grfio_interface)); memcpy(&HPMHooks.source.guild, guild, sizeof(struct guild_interface)); memcpy(&HPMHooks.source.gstorage, gstorage, sizeof(struct guild_storage_interface)); memcpy(&HPMHooks.source.homun, homun, sizeof(struct homunculus_interface)); @@ -53,8 +57,10 @@ memcpy(&HPMHooks.source.map, map, sizeof(struct map_interface)); memcpy(&HPMHooks.source.mapindex, mapindex, sizeof(struct mapindex_interface)); memcpy(&HPMHooks.source.mapit, mapit, sizeof(struct mapit_interface)); memcpy(&HPMHooks.source.mapreg, mapreg, sizeof(struct mapreg_interface)); +memcpy(&HPMHooks.source.md5, md5, sizeof(struct md5_interface)); memcpy(&HPMHooks.source.mercenary, mercenary, sizeof(struct mercenary_interface)); memcpy(&HPMHooks.source.mob, mob, sizeof(struct mob_interface)); +memcpy(&HPMHooks.source.mutex, mutex, sizeof(struct mutex_interface)); memcpy(&HPMHooks.source.npc_chat, npc_chat, sizeof(struct npc_chat_interface)); memcpy(&HPMHooks.source.npc, npc, sizeof(struct npc_interface)); memcpy(&HPMHooks.source.nullpo, nullpo, sizeof(struct nullpo_interface)); @@ -65,6 +71,7 @@ memcpy(&HPMHooks.source.pc, pc, sizeof(struct pc_interface)); memcpy(&HPMHooks.source.libpcre, libpcre, sizeof(struct pcre_interface)); memcpy(&HPMHooks.source.pet, pet, sizeof(struct pet_interface)); memcpy(&HPMHooks.source.quest, quest, sizeof(struct quest_interface)); +memcpy(&HPMHooks.source.rnd, rnd, sizeof(struct rnd_interface)); memcpy(&HPMHooks.source.script, script, sizeof(struct script_interface)); memcpy(&HPMHooks.source.searchstore, searchstore, sizeof(struct searchstore_interface)); memcpy(&HPMHooks.source.showmsg, showmsg, sizeof(struct showmsg_interface)); @@ -77,6 +84,7 @@ memcpy(&HPMHooks.source.StrBuf, StrBuf, sizeof(struct stringbuf_interface)); memcpy(&HPMHooks.source.strlib, strlib, sizeof(struct strlib_interface)); memcpy(&HPMHooks.source.sv, sv, sizeof(struct sv_interface)); memcpy(&HPMHooks.source.sysinfo, sysinfo, sizeof(struct sysinfo_interface)); +memcpy(&HPMHooks.source.thread, thread, sizeof(struct thread_interface)); memcpy(&HPMHooks.source.timer, timer, sizeof(struct timer_interface)); memcpy(&HPMHooks.source.trade, trade, sizeof(struct trade_interface)); memcpy(&HPMHooks.source.unit, unit, sizeof(struct unit_interface)); diff --git a/src/plugins/constdb2doc.c b/src/plugins/constdb2doc.c index cb0b82278..d211c46e2 100644 --- a/src/plugins/constdb2doc.c +++ b/src/plugins/constdb2doc.c @@ -177,7 +177,8 @@ void do_constdb2doc(void) constdb2doc_itemdb(); - fprintf(out_fp, "> End of list\n"); + fprintf(out_fp, "> End of list\n\n"); + fprintf(out_fp, "<!--GENERATED FILE DO NOT EDIT-->\n"); fclose(out_fp); } diff --git a/src/plugins/db2sql.c b/src/plugins/db2sql.c index 510a56e2c..af5ab99af 100644 --- a/src/plugins/db2sql.c +++ b/src/plugins/db2sql.c @@ -78,6 +78,7 @@ int (*mob_read_db_sub) (struct config_setting_t *it, int n, const char *source); */ void hstr(const char *str) { + nullpo_retv(str); if (strlen(str) > tosql.buf[3].len) { tosql.buf[3].len = tosql.buf[3].len + strlen(str) + 1000; RECREATE(tosql.buf[3].p,char,tosql.buf[3].len); @@ -117,7 +118,9 @@ void db2sql_fileheader(void) "-- NOTE: This file was auto-generated and should never be manually edited,\n" "-- as it will get overwritten. If you need to modify this file,\n" "-- please consider modifying the corresponding .conf file inside\n" - "-- the db folder, and then re-run the db2sql plugin.\n" + "-- the db folder, and then re-run the db2sql plugin.\n\n" + + "-- GENERATED FILE DO NOT EDIT --\n" "\n", year); } @@ -288,7 +291,7 @@ int itemdb2sql_sub(struct config_setting_t *entry, int n, const char *source) } else { ui64 = UINT64_MAX; } - StrBuf->Printf(&buf, "'0x%"PRIX64"',", ui64); + StrBuf->Printf(&buf, "'%"PRIu64"',", ui64); // equip_upper if (libconfig->setting_lookup_int(entry, "Upper", &i32) && i32 >= 0) @@ -376,8 +379,7 @@ int itemdb2sql_sub(struct config_setting_t *entry, int n, const char *source) } // script - if (it->script) { - libconfig->setting_lookup_string(entry, "Script", &bonus); + if (it->script && libconfig->setting_lookup_string(entry, "Script", &bonus)) { hstr(bonus); str = tosql.buf[3].p; if (strlen(str) > tosql.buf[0].len) { @@ -385,12 +387,13 @@ int itemdb2sql_sub(struct config_setting_t *entry, int n, const char *source) RECREATE(tosql.buf[0].p,char,tosql.buf[0].len); } SQL->EscapeString(NULL, tosql.buf[0].p, str); + StrBuf->Printf(&buf, "'%s',", tosql.buf[0].p); + } else { + StrBuf->AppendStr(&buf, "'',"); } - StrBuf->Printf(&buf, "'%s',", it->script?tosql.buf[0].p:""); // equip_script - if (it->equip_script) { - libconfig->setting_lookup_string(entry, "OnEquipScript", &bonus); + if (it->equip_script && libconfig->setting_lookup_string(entry, "OnEquipScript", &bonus)) { hstr(bonus); str = tosql.buf[3].p; if (strlen(str) > tosql.buf[1].len) { @@ -398,12 +401,13 @@ int itemdb2sql_sub(struct config_setting_t *entry, int n, const char *source) RECREATE(tosql.buf[1].p,char,tosql.buf[1].len); } SQL->EscapeString(NULL, tosql.buf[1].p, str); + StrBuf->Printf(&buf, "'%s',", tosql.buf[1].p); + } else { + StrBuf->AppendStr(&buf, "'',"); } - StrBuf->Printf(&buf, "'%s',", it->equip_script?tosql.buf[1].p:""); // unequip_script - if (it->unequip_script) { - libconfig->setting_lookup_string(entry, "OnUnequipScript", &bonus); + if (it->unequip_script && libconfig->setting_lookup_string(entry, "OnUnequipScript", &bonus)) { hstr(bonus); str = tosql.buf[3].p; if (strlen(str) > tosql.buf[2].len) { @@ -411,8 +415,10 @@ int itemdb2sql_sub(struct config_setting_t *entry, int n, const char *source) RECREATE(tosql.buf[2].p,char,tosql.buf[2].len); } SQL->EscapeString(NULL, tosql.buf[2].p, str); + StrBuf->Printf(&buf, "'%s'", tosql.buf[2].p); + } else { + StrBuf->AppendStr(&buf, "''"); } - StrBuf->Printf(&buf, "'%s'", it->unequip_script?tosql.buf[2].p:""); fprintf(tosql.fp, "REPLACE INTO `%s` VALUES (%s);\n", tosql.db_name, StrBuf->Value(&buf)); @@ -619,7 +625,7 @@ int mobdb2sql_sub(struct config_setting_t *mobt, int n, const char *source) StrBuf->Printf(&buf, "%d,", md->status.def_ele + 20 * md->status.ele_lv); // Mode - StrBuf->Printf(&buf, "0x%X,", md->status.mode); + StrBuf->Printf(&buf, "%u,", md->status.mode); // Speed StrBuf->Printf(&buf, "%u,", md->status.speed); diff --git a/src/plugins/generate-translations.c b/src/plugins/generate-translations.c new file mode 100644 index 000000000..759e788a2 --- /dev/null +++ b/src/plugins/generate-translations.c @@ -0,0 +1,277 @@ +/** + * This file is part of Hercules. + * http://herc.ws - http://github.com/HerculesWS/Hercules + * + * Copyright (C) 2016 Hercules Dev Team + * + * Hercules is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include "config/core.h" + +#include "common/hercules.h" +#include "common/cbasetypes.h" +#include "common/memmgr.h" +#include "common/showmsg.h" +#include "common/strlib.h" +#include "common/sysinfo.h" +#include "map/atcommand.h" +#include "map/map.h" +#include "map/script.h" + +#include "plugins/HPMHooking.h" +#include "common/HPMDataCheck.h" + +#include <stdio.h> +#include <stdlib.h> + +HPExport struct hplugin_info pinfo = { + "generate-translations", // Plugin name + SERVER_TYPE_MAP, // Which server types this plugin works with? + "0.1", // Plugin version + HPM_VERSION, // HPM Version (don't change, macro is automatically updated) +}; + +struct DBMap *translatable_strings; // string map parsed (used when exporting strings only) +/* Set during startup when attempting to export the lang, unset after server initialization is over */ +FILE *lang_export_fp; +char *lang_export_file;/* for lang_export_fp */ +struct script_string_buf lang_export_line_buf; +struct script_string_buf lang_export_escaped_buf; +int lang_export_stringcount; + +/// Whether the translations template generator will automatically run. +bool generating_translations = false; + +/** + * --generate-translations + * + * Creates "./generated_translations.pot" + * @see cmdline->exec + */ +CMDLINEARG(generatetranslations) +{ + lang_export_file = aStrdup("./generated_translations.pot"); + + if ((lang_export_fp = fopen(lang_export_file, "wb")) == NULL) { + ShowError("export-dialog: failed to open '%s' for writing\n", lang_export_file); + } else { + time_t t = time(NULL); + struct tm *lt = localtime(&t); + int year = lt->tm_year+1900; + char timestring[128] = ""; + strftime(timestring, sizeof(timestring), "%Y-%m-%d %H:%M:%S%z", lt); + fprintf(lang_export_fp, + "# This file is part of Hercules.\n" + "# http://herc.ws - http://github.com/HerculesWS/Hercules\n" + "#\n" + "# Copyright (C) 2013-%d Hercules Dev Team\n" + "#\n" + "# Hercules is free software: you can redistribute it and/or modify\n" + "# it under the terms of the GNU General Public License as published by\n" + "# the Free Software Foundation, either version 3 of the License, or\n" + "# (at your option) any later version.\n" + "#\n" + "# This program is distributed in the hope that it will be useful,\n" + "# but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + "# GNU General Public License for more details.\n" + "#\n" + "# You should have received a copy of the GNU General Public License\n" + "# along with this program. If not, see <http://www.gnu.org/licenses/>.\n\n" + + "#,fuzzy\n" + "msgid \"\"\n" + "msgstr \"\"\n" + "\"Project-Id-Version: %s\\n\"\n" + "\"Report-Msgid-Bugs-To: dev@herc.ws\\n\"\n" + "\"POT-Creation-Date: %s\\n\"\n" + "\"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n\"\n" + "\"Last-Translator: FULL NAME <EMAIL@ADDRESS>\\n\"\n" + "\"Language-Team: LANGUAGE <LL@li.org>\\n\"\n" + "\"Language: \\n\"\n" + "\"MIME-Version: 1.0\\n\"\n" + "\"Content-Type: text/plain; charset=ISO-8859-1\\n\"\n" + "\"Content-Transfer-Encoding: 8bit\\n\"\n\n", + year, sysinfo->vcsrevision_scripts(), timestring); + } + generating_translations = true; + return true; +} + +void script_add_translatable_string_posthook(const struct script_string_buf *string, const char *start_point) +{ + bool duplicate = true; + bool is_translatable_string = false; + bool is_translatable_fmtstring = false; + + if (!generating_translations || lang_export_fp == NULL) + return; + + /* When exporting we don't know what is a translation and what isn't */ + if (VECTOR_LENGTH(*string) > 1) { + // The length of *string will always be at least 1 because of the '\0' + if (translatable_strings == NULL) { + translatable_strings = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_ALLOW_NULL_DATA, 0); + } + + if (!strdb_exists(translatable_strings, VECTOR_DATA(*string))) { + strdb_put(translatable_strings, VECTOR_DATA(*string), NULL); + duplicate = false; + } + } + + if (!duplicate) { + if (script->syntax.last_func == script->buildin_mes_offset + || script->syntax.last_func == script->buildin_select_offset + || script->syntax.lang_macro_active + ) { + is_translatable_string = true; + } else if (script->syntax.last_func == script->buildin_mesf_offset + || script->syntax.lang_macro_fmtstring_active + ) { + is_translatable_fmtstring = true; + } + } + + if (is_translatable_string || is_translatable_fmtstring) { + const char *line_start = start_point; + const char *line_end = start_point; + int line_length; + bool has_percent_sign = false; + + if (!is_translatable_fmtstring && strchr(VECTOR_DATA(*string), '%') != NULL) { + has_percent_sign = true; + } + + while (line_start > script->parser_current_src && *line_start != '\n') + line_start--; + + while (*line_end != '\n' && *line_end != '\0') + line_end++; + + line_length = (int)(line_end - line_start); + if (line_length > 0) { + VECTOR_ENSURE(lang_export_line_buf, line_length + 1, 512); + VECTOR_PUSHARRAY(lang_export_line_buf, line_start, line_length); + VECTOR_PUSH(lang_export_line_buf, '\0'); + + normalize_name(VECTOR_DATA(lang_export_line_buf), "\r\n\t "); // [!] Note: VECTOR_LENGTH() will lie. + } + + VECTOR_ENSURE(lang_export_escaped_buf, 4*VECTOR_LENGTH(*string)+1, 1); + VECTOR_LENGTH(lang_export_escaped_buf) = (int)sv->escape_c(VECTOR_DATA(lang_export_escaped_buf), + VECTOR_DATA(*string), + VECTOR_LENGTH(*string)-1, /* exclude null terminator */ + "\""); + VECTOR_PUSH(lang_export_escaped_buf, '\0'); + + fprintf(lang_export_fp, "\n#: %s\n" + "# %s\n" + "%s" + "msgctxt \"%s\"\n" + "msgid \"%s\"\n" + "msgstr \"\"\n", + script->parser_current_file ? script->parser_current_file : "Unknown File", + VECTOR_DATA(lang_export_line_buf), + is_translatable_fmtstring ? "#, c-format\n" : (has_percent_sign ? "#, no-c-format\n" : ""), + script->parser_current_npc_name ? script->parser_current_npc_name : "Unknown NPC", + VECTOR_DATA(lang_export_escaped_buf) + ); + lang_export_stringcount++; + VECTOR_TRUNCATE(lang_export_line_buf); + VECTOR_TRUNCATE(lang_export_escaped_buf); + } +} + +struct script_code *parse_script_prehook(const char **src, const char **file, int *line, int *options, int **retval) +{ + if (translatable_strings != NULL) { + db_destroy(translatable_strings); + translatable_strings = NULL; + } + return NULL; +} + +void script_parser_clean_leftovers_posthook(void) +{ + if (translatable_strings != NULL) { + db_destroy(translatable_strings); + translatable_strings = NULL; + } + + VECTOR_CLEAR(lang_export_line_buf); + VECTOR_CLEAR(lang_export_escaped_buf); +} + +bool msg_config_read_posthook(bool retVal, const char *cfg_name, bool allow_override) +{ + static int called = 1; + + if (!generating_translations || lang_export_fp == NULL) + return retVal; + + if (!retVal) + return retVal; + + if (++called == 1) { // Original + int i; + for (i = 0; i < MAX_MSG; i++) { + if (atcommand->msg_table[0][i] == NULL) + continue; + fprintf(lang_export_fp, "msgctxt \"messages.conf\"\n" + "msgid \"%s\"\n" + "msgstr \"\"\n", + atcommand->msg_table[0][i] + ); + lang_export_stringcount++; + } + } + + return retVal; +} + +HPExport void server_preinit(void) +{ + addArg("--generate-translations", false, generatetranslations, + "Creates './generated_translations.pot' file with all translateable strings from scripts, server terminates afterwards."); + VECTOR_INIT(lang_export_line_buf); + VECTOR_INIT(lang_export_escaped_buf); + addHookPost(script, add_translatable_string, script_add_translatable_string_posthook); + addHookPre(script, parse, parse_script_prehook); + addHookPost(script, parser_clean_leftovers, script_parser_clean_leftovers_posthook); + addHookPost(atcommand, msg_read, msg_config_read_posthook); + lang_export_stringcount = 0; +} + +HPExport void plugin_init(void) +{ +} + +HPExport void server_online(void) +{ + if (generating_translations && lang_export_fp != NULL) { + ShowInfo("Translations template exported to '%s' with %d strings.\n", lang_export_file, lang_export_stringcount); + fclose(lang_export_fp); + lang_export_fp = NULL; + } + core->runflag = CORE_ST_STOP; +} + +HPExport void plugin_final(void) +{ + if (lang_export_file != NULL) { + aFree(lang_export_file); + lang_export_file = NULL; + } +} |