diff options
Diffstat (limited to 'src/plugins/HPMHooking')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 198 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc | 23 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc | 8 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_char.Hooks.inc | 150 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_char.sources.inc | 3 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc | 162 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc | 45 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_login.Hooks.inc | 1047 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_login.sources.inc | 6 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc | 163 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 43 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 1091 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.sources.inc | 3 |
13 files changed, 2836 insertions, 106 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index b0c2d5fbc..bd17dc7fe 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2017 Hercules Dev Team + * Copyright (C) 2013-2018 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 @@ -33,6 +33,46 @@ typedef bool (*HPMHOOK_post_HCache_check) (bool retVal___, const char *file); typedef FILE* (*HPMHOOK_pre_HCache_open) (const char **file, const char **opt); typedef FILE* (*HPMHOOK_post_HCache_open) (FILE* retVal___, const char *file, const char *opt); #endif // COMMON_UTILS_H +#ifdef LOGIN_ACCOUNT_H /* account */ +typedef struct Sql* (*HPMHOOK_pre_account_db_sql_up) (AccountDB **self); +typedef struct Sql* (*HPMHOOK_post_account_db_sql_up) (struct Sql* retVal___, AccountDB *self); +typedef void (*HPMHOOK_pre_account_mmo_send_accreg2) (AccountDB **self, int *fd, int *account_id, int *char_id); +typedef void (*HPMHOOK_post_account_mmo_send_accreg2) (AccountDB *self, int fd, int account_id, int char_id); +typedef void (*HPMHOOK_pre_account_mmo_save_accreg2) (AccountDB **self, int *fd, int *account_id, int *char_id); +typedef void (*HPMHOOK_post_account_mmo_save_accreg2) (AccountDB *self, int fd, int account_id, int char_id); +typedef bool (*HPMHOOK_pre_account_mmo_auth_fromsql) (AccountDB_SQL **db, struct mmo_account **acc, int *account_id); +typedef bool (*HPMHOOK_post_account_mmo_auth_fromsql) (bool retVal___, AccountDB_SQL *db, struct mmo_account *acc, int account_id); +typedef bool (*HPMHOOK_pre_account_mmo_auth_tosql) (AccountDB_SQL **db, const struct mmo_account **acc, bool *is_new); +typedef bool (*HPMHOOK_post_account_mmo_auth_tosql) (bool retVal___, AccountDB_SQL *db, const struct mmo_account *acc, bool is_new); +typedef AccountDB* (*HPMHOOK_pre_account_db_sql) (void); +typedef AccountDB* (*HPMHOOK_post_account_db_sql) (AccountDB* retVal___); +typedef bool (*HPMHOOK_pre_account_db_sql_init) (AccountDB **self); +typedef bool (*HPMHOOK_post_account_db_sql_init) (bool retVal___, AccountDB *self); +typedef void (*HPMHOOK_pre_account_db_sql_destroy) (AccountDB **self); +typedef void (*HPMHOOK_post_account_db_sql_destroy) (AccountDB *self); +typedef bool (*HPMHOOK_pre_account_db_sql_get_property) (AccountDB **self, const char **key, char **buf, size_t *buflen); +typedef bool (*HPMHOOK_post_account_db_sql_get_property) (bool retVal___, AccountDB *self, const char *key, char *buf, size_t buflen); +typedef bool (*HPMHOOK_pre_account_db_sql_set_property) (AccountDB **self, struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_account_db_sql_set_property) (bool retVal___, AccountDB *self, struct config_t *config, bool imported); +typedef bool (*HPMHOOK_pre_account_db_sql_create) (AccountDB **self, struct mmo_account **acc); +typedef bool (*HPMHOOK_post_account_db_sql_create) (bool retVal___, AccountDB *self, struct mmo_account *acc); +typedef bool (*HPMHOOK_pre_account_db_sql_remove) (AccountDB **self, const int *account_id); +typedef bool (*HPMHOOK_post_account_db_sql_remove) (bool retVal___, AccountDB *self, const int account_id); +typedef bool (*HPMHOOK_pre_account_db_sql_save) (AccountDB **self, const struct mmo_account **acc); +typedef bool (*HPMHOOK_post_account_db_sql_save) (bool retVal___, AccountDB *self, const struct mmo_account *acc); +typedef bool (*HPMHOOK_pre_account_db_sql_load_num) (AccountDB **self, struct mmo_account **acc, const int *account_id); +typedef bool (*HPMHOOK_post_account_db_sql_load_num) (bool retVal___, AccountDB *self, struct mmo_account *acc, const int account_id); +typedef bool (*HPMHOOK_pre_account_db_sql_load_str) (AccountDB **self, struct mmo_account **acc, const char **userid); +typedef bool (*HPMHOOK_post_account_db_sql_load_str) (bool retVal___, AccountDB *self, struct mmo_account *acc, const char *userid); +typedef AccountDBIterator* (*HPMHOOK_pre_account_db_sql_iterator) (AccountDB **self); +typedef AccountDBIterator* (*HPMHOOK_post_account_db_sql_iterator) (AccountDBIterator* retVal___, AccountDB *self); +typedef void (*HPMHOOK_pre_account_db_sql_iter_destroy) (AccountDBIterator **self); +typedef void (*HPMHOOK_post_account_db_sql_iter_destroy) (AccountDBIterator *self); +typedef bool (*HPMHOOK_pre_account_db_sql_iter_next) (AccountDBIterator **self, struct mmo_account **acc); +typedef bool (*HPMHOOK_post_account_db_sql_iter_next) (bool retVal___, AccountDBIterator *self, struct mmo_account *acc); +typedef bool (*HPMHOOK_pre_account_db_read_inter) (AccountDB_SQL **db, const char **filename, bool *imported); +typedef bool (*HPMHOOK_post_account_db_read_inter) (bool retVal___, AccountDB_SQL *db, const char *filename, bool imported); +#endif // LOGIN_ACCOUNT_H #ifdef MAP_ATCOMMAND_H /* atcommand */ typedef void (*HPMHOOK_pre_atcommand_init) (bool *minimal); typedef void (*HPMHOOK_post_atcommand_init) (bool minimal); @@ -867,6 +907,62 @@ typedef void (*HPMHOOK_post_chrif_save_scdata_single) (int account_id, int char_ typedef void (*HPMHOOK_pre_chrif_del_scdata_single) (int *account_id, int *char_id, short *type); typedef void (*HPMHOOK_post_chrif_del_scdata_single) (int account_id, int char_id, short type); #endif // MAP_CHRIF_H +#ifdef MAP_CLAN_H /* clan */ +typedef void (*HPMHOOK_pre_clan_init) (bool *minimal); +typedef void (*HPMHOOK_post_clan_init) (bool minimal); +typedef void (*HPMHOOK_pre_clan_final) (void); +typedef void (*HPMHOOK_post_clan_final) (void); +typedef bool (*HPMHOOK_pre_clan_config_read) (bool *reload); +typedef bool (*HPMHOOK_post_clan_config_read) (bool retVal___, bool reload); +typedef void (*HPMHOOK_pre_clan_config_read_additional_settings) (struct config_setting_t **settings, const char **source); +typedef void (*HPMHOOK_post_clan_config_read_additional_settings) (struct config_setting_t *settings, const char *source); +typedef void (*HPMHOOK_pre_clan_read_db) (struct config_setting_t **settings, const char **source, bool *reload); +typedef void (*HPMHOOK_post_clan_read_db) (struct config_setting_t *settings, const char *source, bool reload); +typedef int (*HPMHOOK_pre_clan_read_db_sub) (struct config_setting_t **settings, const char **source, bool *reload); +typedef int (*HPMHOOK_post_clan_read_db_sub) (int retVal___, struct config_setting_t *settings, const char *source, bool reload); +typedef void (*HPMHOOK_pre_clan_read_db_additional_fields) (struct clan **entry, struct config_setting_t **t, int *n, const char **source); +typedef void (*HPMHOOK_post_clan_read_db_additional_fields) (struct clan *entry, struct config_setting_t *t, int n, const char *source); +typedef void (*HPMHOOK_pre_clan_read_buffs) (struct clan **c, struct config_setting_t **buff, const char **source); +typedef void (*HPMHOOK_post_clan_read_buffs) (struct clan *c, struct config_setting_t *buff, const char *source); +typedef struct clan* (*HPMHOOK_pre_clan_search) (int *clan_id); +typedef struct clan* (*HPMHOOK_post_clan_search) (struct clan* retVal___, int clan_id); +typedef struct clan* (*HPMHOOK_pre_clan_searchname) (const char **name); +typedef struct clan* (*HPMHOOK_post_clan_searchname) (struct clan* retVal___, const char *name); +typedef struct map_session_data* (*HPMHOOK_pre_clan_getonlinesd) (struct clan **c); +typedef struct map_session_data* (*HPMHOOK_post_clan_getonlinesd) (struct map_session_data* retVal___, struct clan *c); +typedef int (*HPMHOOK_pre_clan_getindex) (const struct clan **c, int *char_id); +typedef int (*HPMHOOK_post_clan_getindex) (int retVal___, const struct clan *c, int char_id); +typedef bool (*HPMHOOK_pre_clan_join) (struct map_session_data **sd, int *clan_id); +typedef bool (*HPMHOOK_post_clan_join) (bool retVal___, struct map_session_data *sd, int clan_id); +typedef void (*HPMHOOK_pre_clan_member_online) (struct map_session_data **sd, bool *first); +typedef void (*HPMHOOK_post_clan_member_online) (struct map_session_data *sd, bool first); +typedef bool (*HPMHOOK_pre_clan_leave) (struct map_session_data **sd, bool *first); +typedef bool (*HPMHOOK_post_clan_leave) (bool retVal___, struct map_session_data *sd, bool first); +typedef bool (*HPMHOOK_pre_clan_send_message) (struct map_session_data **sd, const char **mes); +typedef bool (*HPMHOOK_post_clan_send_message) (bool retVal___, struct map_session_data *sd, const char *mes); +typedef void (*HPMHOOK_pre_clan_recv_message) (struct clan **c, const char **mes, int *len); +typedef void (*HPMHOOK_post_clan_recv_message) (struct clan *c, const char *mes, int len); +typedef void (*HPMHOOK_pre_clan_member_offline) (struct map_session_data **sd); +typedef void (*HPMHOOK_post_clan_member_offline) (struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clan_set_constants) (void); +typedef void (*HPMHOOK_post_clan_set_constants) (void); +typedef int (*HPMHOOK_pre_clan_get_id) (const struct block_list **bl); +typedef int (*HPMHOOK_post_clan_get_id) (int retVal___, const struct block_list *bl); +typedef void (*HPMHOOK_pre_clan_buff_start) (struct map_session_data **sd, struct clan **c); +typedef void (*HPMHOOK_post_clan_buff_start) (struct map_session_data *sd, struct clan *c); +typedef void (*HPMHOOK_pre_clan_buff_end) (struct map_session_data **sd, struct clan **c); +typedef void (*HPMHOOK_post_clan_buff_end) (struct map_session_data *sd, struct clan *c); +typedef void (*HPMHOOK_pre_clan_reload) (void); +typedef void (*HPMHOOK_post_clan_reload) (void); +typedef int (*HPMHOOK_pre_clan_rejoin) (struct map_session_data **sd, va_list ap); +typedef int (*HPMHOOK_post_clan_rejoin) (int retVal___, struct map_session_data *sd, va_list ap); +typedef int (*HPMHOOK_pre_clan_inactivity_kick) (int *tid, int64 *tick, int *id, intptr_t *data); +typedef int (*HPMHOOK_post_clan_inactivity_kick) (int retVal___, int tid, int64 tick, int id, intptr_t data); +typedef int (*HPMHOOK_pre_clan_request_kickoffline) (int *tid, int64 *tick, int *id, intptr_t *data); +typedef int (*HPMHOOK_post_clan_request_kickoffline) (int retVal___, int tid, int64 tick, int id, intptr_t data); +typedef int (*HPMHOOK_pre_clan_request_membercount) (int *tid, int64 *tick, int *id, intptr_t *data); +typedef int (*HPMHOOK_post_clan_request_membercount) (int retVal___, int tid, int64 tick, int id, intptr_t data); +#endif // MAP_CLAN_H #ifdef MAP_CLIF_H /* clif */ typedef int (*HPMHOOK_pre_clif_init) (bool *minimal); typedef int (*HPMHOOK_post_clif_init) (int retVal___, bool minimal); @@ -1188,6 +1284,8 @@ typedef void (*HPMHOOK_pre_clif_progressbar) (struct map_session_data **sd, unsi typedef void (*HPMHOOK_post_clif_progressbar) (struct map_session_data *sd, unsigned int color, unsigned int second); typedef void (*HPMHOOK_pre_clif_progressbar_abort) (struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_progressbar_abort) (struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_progressbar_unit) (struct block_list **bl, uint32 *color, uint32 *time); +typedef void (*HPMHOOK_post_clif_progressbar_unit) (struct block_list *bl, uint32 color, uint32 time); typedef void (*HPMHOOK_pre_clif_showdigit) (struct map_session_data **sd, unsigned char *type, int *value); typedef void (*HPMHOOK_post_clif_showdigit) (struct map_session_data *sd, unsigned char type, int value); typedef int (*HPMHOOK_pre_clif_elementalconverter_list) (struct map_session_data **sd); @@ -2260,8 +2358,8 @@ typedef void (*HPMHOOK_pre_clif_rodex_send_maillist) (int *fd, struct map_sessio typedef void (*HPMHOOK_post_clif_rodex_send_maillist) (int fd, struct map_session_data *sd, int8 open_type, int64 page_start); typedef void (*HPMHOOK_pre_clif_rodex_send_refresh) (int *fd, struct map_session_data **sd, int8 *open_type, int *count); typedef void (*HPMHOOK_post_clif_rodex_send_refresh) (int fd, struct map_session_data *sd, int8 open_type, int count); -typedef void (*HPMHOOK_pre_clif_rodex_send_mails_all) (int *fd, struct map_session_data **sd); -typedef void (*HPMHOOK_post_clif_rodex_send_mails_all) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_rodex_send_mails_all) (int *fd, struct map_session_data **sd, int64 *mail_id); +typedef void (*HPMHOOK_post_clif_rodex_send_mails_all) (int fd, struct map_session_data *sd, int64 mail_id); typedef void (*HPMHOOK_pre_clif_pRodexReadMail) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_pRodexReadMail) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_rodex_read_mail) (struct map_session_data **sd, int8 *opentype, struct rodex_message **msg); @@ -2296,6 +2394,16 @@ typedef void (*HPMHOOK_pre_clif_rodex_icon) (int *fd, bool *show); typedef void (*HPMHOOK_post_clif_rodex_icon) (int fd, bool show); typedef void (*HPMHOOK_pre_clif_skill_scale) (struct block_list **bl, int *src_id, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int *casttime); typedef void (*HPMHOOK_post_clif_skill_scale) (struct block_list *bl, int src_id, int x, int y, uint16 skill_id, uint16 skill_lv, int casttime); +typedef void (*HPMHOOK_pre_clif_clan_basicinfo) (struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_clan_basicinfo) (struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_clan_onlinecount) (struct clan **c); +typedef void (*HPMHOOK_post_clif_clan_onlinecount) (struct clan *c); +typedef void (*HPMHOOK_pre_clif_clan_leave) (struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_clan_leave) (struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_clan_message) (struct clan **c, const char **mes, int *len); +typedef void (*HPMHOOK_post_clif_clan_message) (struct clan *c, const char *mes, int len); +typedef void (*HPMHOOK_pre_clif_pClanMessage) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_pClanMessage) (int fd, struct map_session_data *sd); #endif // MAP_CLIF_H #ifdef COMMON_CORE_H /* cmdline */ typedef void (*HPMHOOK_pre_cmdline_init) (void); @@ -2843,6 +2951,14 @@ typedef int (*HPMHOOK_post_inter_auction_sql_init) (int retVal___); typedef void (*HPMHOOK_pre_inter_auction_sql_final) (void); typedef void (*HPMHOOK_post_inter_auction_sql_final) (void); #endif // CHAR_INT_AUCTION_H +#ifdef CHAR_INT_CLAN_H /* inter_clan */ +typedef int (*HPMHOOK_pre_inter_clan_kick_inactive_members) (int *clan_id, int *kick_interval); +typedef int (*HPMHOOK_post_inter_clan_kick_inactive_members) (int retVal___, int clan_id, int kick_interval); +typedef int (*HPMHOOK_pre_inter_clan_count_members) (int *clan_id, int *kick_interval); +typedef int (*HPMHOOK_post_inter_clan_count_members) (int retVal___, int clan_id, int kick_interval); +typedef int (*HPMHOOK_pre_inter_clan_parse_frommap) (int *fd); +typedef int (*HPMHOOK_post_inter_clan_parse_frommap) (int retVal___, int fd); +#endif // CHAR_INT_CLAN_H #ifdef CHAR_INT_ELEMENTAL_H /* inter_elemental */ typedef void (*HPMHOOK_pre_inter_elemental_sql_init) (void); typedef void (*HPMHOOK_post_inter_elemental_sql_init) (void); @@ -3206,6 +3322,10 @@ typedef int (*HPMHOOK_pre_intif_rodex_sendmail) (struct rodex_message **msg); typedef int (*HPMHOOK_post_intif_rodex_sendmail) (int retVal___, struct rodex_message *msg); typedef int (*HPMHOOK_pre_intif_rodex_checkname) (struct map_session_data **sd, const char **name); typedef int (*HPMHOOK_post_intif_rodex_checkname) (int retVal___, struct map_session_data *sd, const char *name); +typedef int (*HPMHOOK_pre_intif_clan_kickoffline) (int *clan_id, int *kick_interval); +typedef int (*HPMHOOK_post_intif_clan_kickoffline) (int retVal___, int clan_id, int kick_interval); +typedef int (*HPMHOOK_pre_intif_clan_membercount) (int *clan_id, int *kick_interval); +typedef int (*HPMHOOK_post_intif_clan_membercount) (int retVal___, int clan_id, int kick_interval); typedef void (*HPMHOOK_pre_intif_request_accinfo) (int *u_fd, int *aid, int *group_lv, char **query); typedef void (*HPMHOOK_post_intif_request_accinfo) (int u_fd, int aid, int group_lv, char *query); typedef int (*HPMHOOK_pre_intif_CheckForCharServer) (void); @@ -3346,7 +3466,29 @@ typedef void (*HPMHOOK_pre_intif_pRodexSendMail) (int *fd); typedef void (*HPMHOOK_post_intif_pRodexSendMail) (int fd); typedef void (*HPMHOOK_pre_intif_pRodexCheckName) (int *fd); typedef void (*HPMHOOK_post_intif_pRodexCheckName) (int fd); +typedef void (*HPMHOOK_pre_intif_pRecvClanMemberAction) (int *fd); +typedef void (*HPMHOOK_post_intif_pRecvClanMemberAction) (int fd); #endif // MAP_INTIF_H +#ifdef LOGIN_IPBAN_H /* ipban */ +typedef void (*HPMHOOK_pre_ipban_init) (void); +typedef void (*HPMHOOK_post_ipban_init) (void); +typedef void (*HPMHOOK_pre_ipban_final) (void); +typedef void (*HPMHOOK_post_ipban_final) (void); +typedef int (*HPMHOOK_pre_ipban_cleanup) (int *tid, int64 *tick, int *id, intptr_t *data); +typedef int (*HPMHOOK_post_ipban_cleanup) (int retVal___, int tid, int64 tick, int id, intptr_t data); +typedef bool (*HPMHOOK_pre_ipban_config_read_inter) (const char **filename, bool *imported); +typedef bool (*HPMHOOK_post_ipban_config_read_inter) (bool retVal___, const char *filename, bool imported); +typedef bool (*HPMHOOK_pre_ipban_config_read_connection) (const char **filename, struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_ipban_config_read_connection) (bool retVal___, const char *filename, struct config_t *config, bool imported); +typedef bool (*HPMHOOK_pre_ipban_config_read_dynamic) (const char **filename, struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_ipban_config_read_dynamic) (bool retVal___, const char *filename, struct config_t *config, bool imported); +typedef bool (*HPMHOOK_pre_ipban_config_read) (const char **filename, struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_ipban_config_read) (bool retVal___, const char *filename, struct config_t *config, bool imported); +typedef bool (*HPMHOOK_pre_ipban_check) (uint32 *ip); +typedef bool (*HPMHOOK_post_ipban_check) (bool retVal___, uint32 ip); +typedef void (*HPMHOOK_pre_ipban_log) (uint32 *ip); +typedef void (*HPMHOOK_post_ipban_log) (uint32 ip); +#endif // LOGIN_IPBAN_H #ifdef MAP_IRC_BOT_H /* ircbot */ typedef void (*HPMHOOK_pre_ircbot_init) (bool *minimal); typedef void (*HPMHOOK_post_ircbot_init) (bool minimal); @@ -3517,6 +3659,16 @@ typedef bool (*HPMHOOK_post_itemdb_lookup_const) (bool retVal___, const struct c typedef bool (*HPMHOOK_pre_itemdb_lookup_const_mask) (const struct config_setting_t **it, const char **name, int **value); typedef bool (*HPMHOOK_post_itemdb_lookup_const_mask) (bool retVal___, const struct config_setting_t *it, const char *name, int *value); #endif // MAP_ITEMDB_H +#ifdef LOGIN_LOGIN_H /* lchrif */ +typedef void (*HPMHOOK_pre_lchrif_server_init) (int *id); +typedef void (*HPMHOOK_post_lchrif_server_init) (int id); +typedef void (*HPMHOOK_pre_lchrif_server_destroy) (int *id); +typedef void (*HPMHOOK_post_lchrif_server_destroy) (int id); +typedef void (*HPMHOOK_pre_lchrif_server_reset) (int *id); +typedef void (*HPMHOOK_post_lchrif_server_reset) (int id); +typedef void (*HPMHOOK_pre_lchrif_on_disconnect) (int *id); +typedef void (*HPMHOOK_post_lchrif_on_disconnect) (int id); +#endif // LOGIN_LOGIN_H #ifdef LOGIN_LCLIF_H /* lclif */ typedef void (*HPMHOOK_pre_lclif_init) (void); typedef void (*HPMHOOK_post_lclif_init) (void); @@ -3909,6 +4061,22 @@ typedef void (*HPMHOOK_post_loginif_send_users_count) (int users); typedef void (*HPMHOOK_pre_loginif_connect_to_server) (void); typedef void (*HPMHOOK_post_loginif_connect_to_server) (void); #endif // CHAR_LOGINIF_H +#ifdef LOGIN_LOGINLOG_H /* loginlog */ +typedef unsigned long (*HPMHOOK_pre_loginlog_failedattempts) (uint32 *ip, unsigned int *minutes); +typedef unsigned long (*HPMHOOK_post_loginlog_failedattempts) (unsigned long retVal___, uint32 ip, unsigned int minutes); +typedef void (*HPMHOOK_pre_loginlog_log) (uint32 *ip, const char **username, int *rcode, const char **message); +typedef void (*HPMHOOK_post_loginlog_log) (uint32 ip, const char *username, int rcode, const char *message); +typedef bool (*HPMHOOK_pre_loginlog_init) (void); +typedef bool (*HPMHOOK_post_loginlog_init) (bool retVal___); +typedef bool (*HPMHOOK_pre_loginlog_final) (void); +typedef bool (*HPMHOOK_post_loginlog_final) (bool retVal___); +typedef bool (*HPMHOOK_pre_loginlog_config_read_names) (const char **filename, struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_loginlog_config_read_names) (bool retVal___, const char *filename, struct config_t *config, bool imported); +typedef bool (*HPMHOOK_pre_loginlog_config_read_log) (const char **filename, struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_loginlog_config_read_log) (bool retVal___, const char *filename, struct config_t *config, bool imported); +typedef bool (*HPMHOOK_pre_loginlog_config_read) (const char **filename, bool *imported); +typedef bool (*HPMHOOK_post_loginlog_config_read) (bool retVal___, const char *filename, bool imported); +#endif // LOGIN_LOGINLOG_H #ifdef MAP_MAIL_H /* mail */ typedef void (*HPMHOOK_pre_mail_clear) (struct map_session_data **sd); typedef void (*HPMHOOK_post_mail_clear) (struct map_session_data *sd); @@ -3984,8 +4152,8 @@ typedef int (*HPMHOOK_pre_map_removemobs_timer) (int *tid, int64 *tick, int *id, typedef int (*HPMHOOK_post_map_removemobs_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data); typedef void (*HPMHOOK_pre_map_clearflooritem) (struct block_list **bl); typedef void (*HPMHOOK_post_map_clearflooritem) (struct block_list *bl); -typedef int (*HPMHOOK_pre_map_addflooritem) (const struct block_list **bl, struct item **item_data, int *amount, int16 *m, int16 *x, int16 *y, int *first_charid, int *second_charid, int *third_charid, int *flags); -typedef int (*HPMHOOK_post_map_addflooritem) (int retVal___, const struct block_list *bl, struct item *item_data, int amount, int16 m, int16 x, int16 y, int first_charid, int second_charid, int third_charid, int flags); +typedef int (*HPMHOOK_pre_map_addflooritem) (const struct block_list **bl, struct item **item_data, int *amount, int16 *m, int16 *x, int16 *y, int *first_charid, int *second_charid, int *third_charid, int *flags, bool *showdropeffect); +typedef int (*HPMHOOK_post_map_addflooritem) (int retVal___, const struct block_list *bl, struct item *item_data, int amount, int16 m, int16 x, int16 y, int first_charid, int second_charid, int third_charid, int flags, bool showdropeffect); typedef void (*HPMHOOK_pre_map_addnickdb) (int *charid, const char **nick); typedef void (*HPMHOOK_post_map_addnickdb) (int charid, const char *nick); typedef void (*HPMHOOK_pre_map_delnickdb) (int *charid, const char **nick); @@ -4136,10 +4304,10 @@ typedef struct DBData (*HPMHOOK_pre_map_create_map_data_other_server) (union DBK typedef struct DBData (*HPMHOOK_post_map_create_map_data_other_server) (struct DBData retVal___, union DBKey key, va_list args); typedef int (*HPMHOOK_pre_map_eraseallipport_sub) (union DBKey *key, struct DBData **data, va_list va); typedef int (*HPMHOOK_post_map_eraseallipport_sub) (int retVal___, union DBKey key, struct DBData *data, va_list va); -typedef char* (*HPMHOOK_pre_map_init_mapcache) (FILE **fp); -typedef char* (*HPMHOOK_post_map_init_mapcache) (char* retVal___, FILE *fp); -typedef int (*HPMHOOK_pre_map_readfromcache) (struct map_data **m, char **buffer); -typedef int (*HPMHOOK_post_map_readfromcache) (int retVal___, struct map_data *m, char *buffer); +typedef bool (*HPMHOOK_pre_map_readfromcache) (struct map_data **m); +typedef bool (*HPMHOOK_post_map_readfromcache) (bool retVal___, struct map_data *m); +typedef bool (*HPMHOOK_pre_map_readfromcache_v1) (FILE **fp, struct map_data **m, unsigned int *file_size); +typedef bool (*HPMHOOK_post_map_readfromcache_v1) (bool retVal___, FILE *fp, struct map_data *m, unsigned int file_size); typedef int (*HPMHOOK_pre_map_addmap) (const char **mapname); typedef int (*HPMHOOK_post_map_addmap) (int retVal___, const char *mapname); typedef void (*HPMHOOK_pre_map_delmapid) (int *id); @@ -4494,8 +4662,8 @@ typedef int (*HPMHOOK_pre_mapif_parse_quest_load) (int *fd); typedef int (*HPMHOOK_post_mapif_parse_quest_load) (int retVal___, int fd); typedef int (*HPMHOOK_pre_mapif_parse_rodex_requestinbox) (int *fd); typedef int (*HPMHOOK_post_mapif_parse_rodex_requestinbox) (int retVal___, int fd); -typedef void (*HPMHOOK_pre_mapif_rodex_sendinbox) (int *fd, int *char_id, int8 *opentype, int8 *flag, int *count, struct rodex_maillist **mails); -typedef void (*HPMHOOK_post_mapif_rodex_sendinbox) (int fd, int char_id, int8 opentype, int8 flag, int count, struct rodex_maillist *mails); +typedef void (*HPMHOOK_pre_mapif_rodex_sendinbox) (int *fd, int *char_id, int8 *opentype, int8 *flag, int *count, int64 *mail_id, struct rodex_maillist **mails); +typedef void (*HPMHOOK_post_mapif_rodex_sendinbox) (int fd, int char_id, int8 opentype, int8 flag, int count, int64 mail_id, struct rodex_maillist *mails); typedef int (*HPMHOOK_pre_mapif_parse_rodex_checkhasnew) (int *fd); typedef int (*HPMHOOK_post_mapif_parse_rodex_checkhasnew) (int retVal___, int fd); typedef void (*HPMHOOK_pre_mapif_rodex_sendhasnew) (int *fd, int *char_id, bool *has_new); @@ -4564,6 +4732,10 @@ typedef void (*HPMHOOK_pre_mapif_namechange_ack) (int *fd, int *account_id, int typedef void (*HPMHOOK_post_mapif_namechange_ack) (int fd, int account_id, int char_id, int type, int flag, const char *name); typedef int (*HPMHOOK_pre_mapif_parse_NameChangeRequest) (int *fd); typedef int (*HPMHOOK_post_mapif_parse_NameChangeRequest) (int retVal___, int fd); +typedef int (*HPMHOOK_pre_mapif_parse_ClanMemberKick) (int *fd, int *clan_id, int *kick_interval); +typedef int (*HPMHOOK_post_mapif_parse_ClanMemberKick) (int retVal___, int fd, int clan_id, int kick_interval); +typedef int (*HPMHOOK_pre_mapif_parse_ClanMemberCount) (int *fd, int *clan_id, int *kick_interval); +typedef int (*HPMHOOK_post_mapif_parse_ClanMemberCount) (int retVal___, int fd, int clan_id, int kick_interval); #endif // CHAR_MAPIF_H #ifdef COMMON_MAPINDEX_H /* mapindex */ typedef int (*HPMHOOK_pre_mapindex_init) (void); @@ -6262,6 +6434,8 @@ typedef int (*HPMHOOK_pre_script_cleanfloor_sub) (struct block_list **bl, va_lis typedef int (*HPMHOOK_post_script_cleanfloor_sub) (int retVal___, struct block_list *bl, va_list ap); typedef int (*HPMHOOK_pre_script_run_func) (struct script_state **st); typedef int (*HPMHOOK_post_script_run_func) (int retVal___, struct script_state *st); +typedef bool (*HPMHOOK_pre_script_sprintf) (struct script_state **st, int *start, struct StringBuf **out); +typedef bool (*HPMHOOK_post_script_sprintf) (bool retVal___, struct script_state *st, int start, struct StringBuf *out); typedef const char* (*HPMHOOK_pre_script_getfuncname) (struct script_state **st); typedef const char* (*HPMHOOK_post_script_getfuncname) (const char* retVal___, struct script_state *st); typedef unsigned int (*HPMHOOK_pre_script_calc_hash_ci) (const char **p); @@ -6736,8 +6910,6 @@ typedef bool (*HPMHOOK_pre_skill_parse_row_spellbookdb) (char **split[], int *co typedef bool (*HPMHOOK_post_skill_parse_row_spellbookdb) (bool retVal___, char *split[], int columns, int current); typedef bool (*HPMHOOK_pre_skill_parse_row_magicmushroomdb) (char **split[], int *column, int *current); typedef bool (*HPMHOOK_post_skill_parse_row_magicmushroomdb) (bool retVal___, char *split[], int column, int current); -typedef bool (*HPMHOOK_pre_skill_parse_row_reproducedb) (char **split[], int *column, int *current); -typedef bool (*HPMHOOK_post_skill_parse_row_reproducedb) (bool retVal___, char *split[], int column, int current); typedef bool (*HPMHOOK_pre_skill_parse_row_improvisedb) (char **split[], int *columns, int *current); typedef bool (*HPMHOOK_post_skill_parse_row_improvisedb) (bool retVal___, char *split[], int columns, int current); typedef bool (*HPMHOOK_pre_skill_parse_row_changematerialdb) (char **split[], int *columns, int *current); diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc index 3eeb7fd91..d0b4ac5ce 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2017 Hercules Dev Team + * Copyright (C) 2013-2018 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 @@ -466,6 +466,12 @@ struct { struct HPMHookPoint *HP_inter_auction_sql_init_post; struct HPMHookPoint *HP_inter_auction_sql_final_pre; struct HPMHookPoint *HP_inter_auction_sql_final_post; + struct HPMHookPoint *HP_inter_clan_kick_inactive_members_pre; + struct HPMHookPoint *HP_inter_clan_kick_inactive_members_post; + struct HPMHookPoint *HP_inter_clan_count_members_pre; + struct HPMHookPoint *HP_inter_clan_count_members_post; + struct HPMHookPoint *HP_inter_clan_parse_frommap_pre; + struct HPMHookPoint *HP_inter_clan_parse_frommap_post; struct HPMHookPoint *HP_inter_elemental_sql_init_pre; struct HPMHookPoint *HP_inter_elemental_sql_init_post; struct HPMHookPoint *HP_inter_elemental_sql_final_pre; @@ -1184,6 +1190,10 @@ struct { struct HPMHookPoint *HP_mapif_namechange_ack_post; struct HPMHookPoint *HP_mapif_parse_NameChangeRequest_pre; struct HPMHookPoint *HP_mapif_parse_NameChangeRequest_post; + struct HPMHookPoint *HP_mapif_parse_ClanMemberKick_pre; + struct HPMHookPoint *HP_mapif_parse_ClanMemberKick_post; + struct HPMHookPoint *HP_mapif_parse_ClanMemberCount_pre; + struct HPMHookPoint *HP_mapif_parse_ClanMemberCount_post; struct HPMHookPoint *HP_mapindex_init_pre; struct HPMHookPoint *HP_mapindex_init_post; struct HPMHookPoint *HP_mapindex_final_pre; @@ -1985,6 +1995,12 @@ struct { int HP_inter_auction_sql_init_post; int HP_inter_auction_sql_final_pre; int HP_inter_auction_sql_final_post; + int HP_inter_clan_kick_inactive_members_pre; + int HP_inter_clan_kick_inactive_members_post; + int HP_inter_clan_count_members_pre; + int HP_inter_clan_count_members_post; + int HP_inter_clan_parse_frommap_pre; + int HP_inter_clan_parse_frommap_post; int HP_inter_elemental_sql_init_pre; int HP_inter_elemental_sql_init_post; int HP_inter_elemental_sql_final_pre; @@ -2703,6 +2719,10 @@ struct { int HP_mapif_namechange_ack_post; int HP_mapif_parse_NameChangeRequest_pre; int HP_mapif_parse_NameChangeRequest_post; + int HP_mapif_parse_ClanMemberKick_pre; + int HP_mapif_parse_ClanMemberKick_post; + int HP_mapif_parse_ClanMemberCount_pre; + int HP_mapif_parse_ClanMemberCount_post; int HP_mapindex_init_pre; int HP_mapindex_init_post; int HP_mapindex_final_pre; @@ -3073,6 +3093,7 @@ struct { struct des_interface des; struct geoip_interface geoip; struct inter_auction_interface inter_auction; + struct inter_clan_interface inter_clan; struct inter_elemental_interface inter_elemental; struct inter_guild_interface inter_guild; struct inter_homunculus_interface inter_homunculus; diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc index bbd484fe1..36a115e1b 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2017 Hercules Dev Team + * Copyright (C) 2013-2018 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 @@ -255,6 +255,10 @@ struct HookingPointData HookingPoints[] = { { HP_POP(inter_auction->parse_frommap, HP_inter_auction_parse_frommap) }, { HP_POP(inter_auction->sql_init, HP_inter_auction_sql_init) }, { HP_POP(inter_auction->sql_final, HP_inter_auction_sql_final) }, +/* inter_clan_interface */ + { HP_POP(inter_clan->kick_inactive_members, HP_inter_clan_kick_inactive_members) }, + { HP_POP(inter_clan->count_members, HP_inter_clan_count_members) }, + { HP_POP(inter_clan->parse_frommap, HP_inter_clan_parse_frommap) }, /* inter_elemental_interface */ { HP_POP(inter_elemental->sql_init, HP_inter_elemental_sql_init) }, { HP_POP(inter_elemental->sql_final, HP_inter_elemental_sql_final) }, @@ -628,6 +632,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mapif->parse_RegistryRequest, HP_mapif_parse_RegistryRequest) }, { HP_POP(mapif->namechange_ack, HP_mapif_namechange_ack) }, { HP_POP(mapif->parse_NameChangeRequest, HP_mapif_parse_NameChangeRequest) }, + { HP_POP(mapif->parse_ClanMemberKick, HP_mapif_parse_ClanMemberKick) }, + { HP_POP(mapif->parse_ClanMemberCount, HP_mapif_parse_ClanMemberCount) }, /* mapindex_interface */ { HP_POP(mapindex->init, HP_mapindex_init) }, { HP_POP(mapindex->final, HP_mapindex_final) }, diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc index a372f83b3..6ea10f78f 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2017 Hercules Dev Team + * Copyright (C) 2013-2018 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 @@ -5879,6 +5879,88 @@ void HP_inter_auction_sql_final(void) { } return; } +/* inter_clan_interface */ +int HP_inter_clan_kick_inactive_members(int clan_id, int kick_interval) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_inter_clan_kick_inactive_members_pre > 0) { + int (*preHookFunc) (int *clan_id, int *kick_interval); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_clan_kick_inactive_members_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_inter_clan_kick_inactive_members_pre[hIndex].func; + retVal___ = preHookFunc(&clan_id, &kick_interval); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.inter_clan.kick_inactive_members(clan_id, kick_interval); + } + if (HPMHooks.count.HP_inter_clan_kick_inactive_members_post > 0) { + int (*postHookFunc) (int retVal___, int clan_id, int kick_interval); + for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_clan_kick_inactive_members_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_inter_clan_kick_inactive_members_post[hIndex].func; + retVal___ = postHookFunc(retVal___, clan_id, kick_interval); + } + } + return retVal___; +} +int HP_inter_clan_count_members(int clan_id, int kick_interval) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_inter_clan_count_members_pre > 0) { + int (*preHookFunc) (int *clan_id, int *kick_interval); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_clan_count_members_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_inter_clan_count_members_pre[hIndex].func; + retVal___ = preHookFunc(&clan_id, &kick_interval); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.inter_clan.count_members(clan_id, kick_interval); + } + if (HPMHooks.count.HP_inter_clan_count_members_post > 0) { + int (*postHookFunc) (int retVal___, int clan_id, int kick_interval); + for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_clan_count_members_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_inter_clan_count_members_post[hIndex].func; + retVal___ = postHookFunc(retVal___, clan_id, kick_interval); + } + } + return retVal___; +} +int HP_inter_clan_parse_frommap(int fd) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_inter_clan_parse_frommap_pre > 0) { + int (*preHookFunc) (int *fd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_clan_parse_frommap_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_inter_clan_parse_frommap_pre[hIndex].func; + retVal___ = preHookFunc(&fd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.inter_clan.parse_frommap(fd); + } + if (HPMHooks.count.HP_inter_clan_parse_frommap_post > 0) { + int (*postHookFunc) (int retVal___, int fd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_clan_parse_frommap_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_inter_clan_parse_frommap_post[hIndex].func; + retVal___ = postHookFunc(retVal___, fd); + } + } + return retVal___; +} /* inter_elemental_interface */ void HP_inter_elemental_sql_init(void) { int hIndex = 0; @@ -14565,14 +14647,14 @@ int HP_mapif_parse_rodex_requestinbox(int fd) { } return retVal___; } -void HP_mapif_rodex_sendinbox(int fd, int char_id, int8 opentype, int8 flag, int count, struct rodex_maillist *mails) { +void HP_mapif_rodex_sendinbox(int fd, int char_id, int8 opentype, int8 flag, int count, int64 mail_id, struct rodex_maillist *mails) { int hIndex = 0; if (HPMHooks.count.HP_mapif_rodex_sendinbox_pre > 0) { - void (*preHookFunc) (int *fd, int *char_id, int8 *opentype, int8 *flag, int *count, struct rodex_maillist **mails); + void (*preHookFunc) (int *fd, int *char_id, int8 *opentype, int8 *flag, int *count, int64 *mail_id, struct rodex_maillist **mails); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_rodex_sendinbox_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mapif_rodex_sendinbox_pre[hIndex].func; - preHookFunc(&fd, &char_id, &opentype, &flag, &count, &mails); + preHookFunc(&fd, &char_id, &opentype, &flag, &count, &mail_id, &mails); } if (*HPMforce_return) { *HPMforce_return = false; @@ -14580,13 +14662,13 @@ void HP_mapif_rodex_sendinbox(int fd, int char_id, int8 opentype, int8 flag, int } } { - HPMHooks.source.mapif.rodex_sendinbox(fd, char_id, opentype, flag, count, mails); + HPMHooks.source.mapif.rodex_sendinbox(fd, char_id, opentype, flag, count, mail_id, mails); } if (HPMHooks.count.HP_mapif_rodex_sendinbox_post > 0) { - void (*postHookFunc) (int fd, int char_id, int8 opentype, int8 flag, int count, struct rodex_maillist *mails); + void (*postHookFunc) (int fd, int char_id, int8 opentype, int8 flag, int count, int64 mail_id, struct rodex_maillist *mails); for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_rodex_sendinbox_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mapif_rodex_sendinbox_post[hIndex].func; - postHookFunc(fd, char_id, opentype, flag, count, mails); + postHookFunc(fd, char_id, opentype, flag, count, mail_id, mails); } } return; @@ -15500,6 +15582,60 @@ int HP_mapif_parse_NameChangeRequest(int fd) { } return retVal___; } +int HP_mapif_parse_ClanMemberKick(int fd, int clan_id, int kick_interval) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_mapif_parse_ClanMemberKick_pre > 0) { + int (*preHookFunc) (int *fd, int *clan_id, int *kick_interval); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_ClanMemberKick_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mapif_parse_ClanMemberKick_pre[hIndex].func; + retVal___ = preHookFunc(&fd, &clan_id, &kick_interval); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mapif.parse_ClanMemberKick(fd, clan_id, kick_interval); + } + if (HPMHooks.count.HP_mapif_parse_ClanMemberKick_post > 0) { + int (*postHookFunc) (int retVal___, int fd, int clan_id, int kick_interval); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_ClanMemberKick_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mapif_parse_ClanMemberKick_post[hIndex].func; + retVal___ = postHookFunc(retVal___, fd, clan_id, kick_interval); + } + } + return retVal___; +} +int HP_mapif_parse_ClanMemberCount(int fd, int clan_id, int kick_interval) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_mapif_parse_ClanMemberCount_pre > 0) { + int (*preHookFunc) (int *fd, int *clan_id, int *kick_interval); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_ClanMemberCount_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mapif_parse_ClanMemberCount_pre[hIndex].func; + retVal___ = preHookFunc(&fd, &clan_id, &kick_interval); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mapif.parse_ClanMemberCount(fd, clan_id, kick_interval); + } + if (HPMHooks.count.HP_mapif_parse_ClanMemberCount_post > 0) { + int (*postHookFunc) (int retVal___, int fd, int clan_id, int kick_interval); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_ClanMemberCount_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mapif_parse_ClanMemberCount_post[hIndex].func; + retVal___ = postHookFunc(retVal___, fd, clan_id, kick_interval); + } + } + return retVal___; +} /* mapindex_interface */ int HP_mapindex_init(void) { int hIndex = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_char.sources.inc b/src/plugins/HPMHooking/HPMHooking_char.sources.inc index b5e9afc08..9ba9e129e 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.sources.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.sources.inc @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2017 Hercules Dev Team + * Copyright (C) 2013-2018 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 @@ -34,6 +34,7 @@ HPMHooks.source.DB = *DB; HPMHooks.source.des = *des; HPMHooks.source.geoip = *geoip; HPMHooks.source.inter_auction = *inter_auction; +HPMHooks.source.inter_clan = *inter_clan; HPMHooks.source.inter_elemental = *inter_elemental; HPMHooks.source.inter_guild = *inter_guild; HPMHooks.source.inter_homunculus = *inter_homunculus; diff --git a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc index 0cbce8b7d..5300ca3a6 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2017 Hercules Dev Team + * Copyright (C) 2013-2018 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 @@ -32,6 +32,44 @@ struct { struct HPMHookPoint *HP_HCache_check_post; struct HPMHookPoint *HP_HCache_open_pre; struct HPMHookPoint *HP_HCache_open_post; + struct HPMHookPoint *HP_account_db_sql_up_pre; + struct HPMHookPoint *HP_account_db_sql_up_post; + struct HPMHookPoint *HP_account_mmo_send_accreg2_pre; + struct HPMHookPoint *HP_account_mmo_send_accreg2_post; + struct HPMHookPoint *HP_account_mmo_save_accreg2_pre; + struct HPMHookPoint *HP_account_mmo_save_accreg2_post; + struct HPMHookPoint *HP_account_mmo_auth_fromsql_pre; + struct HPMHookPoint *HP_account_mmo_auth_fromsql_post; + struct HPMHookPoint *HP_account_mmo_auth_tosql_pre; + struct HPMHookPoint *HP_account_mmo_auth_tosql_post; + struct HPMHookPoint *HP_account_db_sql_pre; + struct HPMHookPoint *HP_account_db_sql_post; + struct HPMHookPoint *HP_account_db_sql_init_pre; + struct HPMHookPoint *HP_account_db_sql_init_post; + struct HPMHookPoint *HP_account_db_sql_destroy_pre; + struct HPMHookPoint *HP_account_db_sql_destroy_post; + struct HPMHookPoint *HP_account_db_sql_get_property_pre; + struct HPMHookPoint *HP_account_db_sql_get_property_post; + struct HPMHookPoint *HP_account_db_sql_set_property_pre; + struct HPMHookPoint *HP_account_db_sql_set_property_post; + struct HPMHookPoint *HP_account_db_sql_create_pre; + struct HPMHookPoint *HP_account_db_sql_create_post; + struct HPMHookPoint *HP_account_db_sql_remove_pre; + struct HPMHookPoint *HP_account_db_sql_remove_post; + struct HPMHookPoint *HP_account_db_sql_save_pre; + struct HPMHookPoint *HP_account_db_sql_save_post; + struct HPMHookPoint *HP_account_db_sql_load_num_pre; + struct HPMHookPoint *HP_account_db_sql_load_num_post; + struct HPMHookPoint *HP_account_db_sql_load_str_pre; + struct HPMHookPoint *HP_account_db_sql_load_str_post; + struct HPMHookPoint *HP_account_db_sql_iterator_pre; + struct HPMHookPoint *HP_account_db_sql_iterator_post; + struct HPMHookPoint *HP_account_db_sql_iter_destroy_pre; + struct HPMHookPoint *HP_account_db_sql_iter_destroy_post; + struct HPMHookPoint *HP_account_db_sql_iter_next_pre; + struct HPMHookPoint *HP_account_db_sql_iter_next_post; + struct HPMHookPoint *HP_account_db_read_inter_pre; + struct HPMHookPoint *HP_account_db_read_inter_post; struct HPMHookPoint *HP_cmdline_init_pre; struct HPMHookPoint *HP_cmdline_init_post; struct HPMHookPoint *HP_cmdline_final_pre; @@ -96,6 +134,32 @@ struct { struct HPMHookPoint *HP_des_decrypt_block_post; struct HPMHookPoint *HP_des_decrypt_pre; struct HPMHookPoint *HP_des_decrypt_post; + struct HPMHookPoint *HP_ipban_init_pre; + struct HPMHookPoint *HP_ipban_init_post; + struct HPMHookPoint *HP_ipban_final_pre; + struct HPMHookPoint *HP_ipban_final_post; + struct HPMHookPoint *HP_ipban_cleanup_pre; + struct HPMHookPoint *HP_ipban_cleanup_post; + struct HPMHookPoint *HP_ipban_config_read_inter_pre; + struct HPMHookPoint *HP_ipban_config_read_inter_post; + struct HPMHookPoint *HP_ipban_config_read_connection_pre; + struct HPMHookPoint *HP_ipban_config_read_connection_post; + struct HPMHookPoint *HP_ipban_config_read_dynamic_pre; + struct HPMHookPoint *HP_ipban_config_read_dynamic_post; + struct HPMHookPoint *HP_ipban_config_read_pre; + struct HPMHookPoint *HP_ipban_config_read_post; + struct HPMHookPoint *HP_ipban_check_pre; + struct HPMHookPoint *HP_ipban_check_post; + struct HPMHookPoint *HP_ipban_log_pre; + struct HPMHookPoint *HP_ipban_log_post; + struct HPMHookPoint *HP_lchrif_server_init_pre; + struct HPMHookPoint *HP_lchrif_server_init_post; + struct HPMHookPoint *HP_lchrif_server_destroy_pre; + struct HPMHookPoint *HP_lchrif_server_destroy_post; + struct HPMHookPoint *HP_lchrif_server_reset_pre; + struct HPMHookPoint *HP_lchrif_server_reset_post; + struct HPMHookPoint *HP_lchrif_on_disconnect_pre; + struct HPMHookPoint *HP_lchrif_on_disconnect_post; struct HPMHookPoint *HP_lclif_init_pre; struct HPMHookPoint *HP_lclif_init_post; struct HPMHookPoint *HP_lclif_final_pre; @@ -406,6 +470,20 @@ struct { struct HPMHookPoint *HP_login_config_set_md5hash_post; struct HPMHookPoint *HP_login_convert_users_to_colors_pre; struct HPMHookPoint *HP_login_convert_users_to_colors_post; + struct HPMHookPoint *HP_loginlog_failedattempts_pre; + struct HPMHookPoint *HP_loginlog_failedattempts_post; + struct HPMHookPoint *HP_loginlog_log_pre; + struct HPMHookPoint *HP_loginlog_log_post; + struct HPMHookPoint *HP_loginlog_init_pre; + struct HPMHookPoint *HP_loginlog_init_post; + struct HPMHookPoint *HP_loginlog_final_pre; + struct HPMHookPoint *HP_loginlog_final_post; + struct HPMHookPoint *HP_loginlog_config_read_names_pre; + struct HPMHookPoint *HP_loginlog_config_read_names_post; + struct HPMHookPoint *HP_loginlog_config_read_log_pre; + struct HPMHookPoint *HP_loginlog_config_read_log_post; + struct HPMHookPoint *HP_loginlog_config_read_pre; + struct HPMHookPoint *HP_loginlog_config_read_post; struct HPMHookPoint *HP_md5_string_pre; struct HPMHookPoint *HP_md5_string_post; struct HPMHookPoint *HP_md5_binary_pre; @@ -735,6 +813,44 @@ struct { int HP_HCache_check_post; int HP_HCache_open_pre; int HP_HCache_open_post; + int HP_account_db_sql_up_pre; + int HP_account_db_sql_up_post; + int HP_account_mmo_send_accreg2_pre; + int HP_account_mmo_send_accreg2_post; + int HP_account_mmo_save_accreg2_pre; + int HP_account_mmo_save_accreg2_post; + int HP_account_mmo_auth_fromsql_pre; + int HP_account_mmo_auth_fromsql_post; + int HP_account_mmo_auth_tosql_pre; + int HP_account_mmo_auth_tosql_post; + int HP_account_db_sql_pre; + int HP_account_db_sql_post; + int HP_account_db_sql_init_pre; + int HP_account_db_sql_init_post; + int HP_account_db_sql_destroy_pre; + int HP_account_db_sql_destroy_post; + int HP_account_db_sql_get_property_pre; + int HP_account_db_sql_get_property_post; + int HP_account_db_sql_set_property_pre; + int HP_account_db_sql_set_property_post; + int HP_account_db_sql_create_pre; + int HP_account_db_sql_create_post; + int HP_account_db_sql_remove_pre; + int HP_account_db_sql_remove_post; + int HP_account_db_sql_save_pre; + int HP_account_db_sql_save_post; + int HP_account_db_sql_load_num_pre; + int HP_account_db_sql_load_num_post; + int HP_account_db_sql_load_str_pre; + int HP_account_db_sql_load_str_post; + int HP_account_db_sql_iterator_pre; + int HP_account_db_sql_iterator_post; + int HP_account_db_sql_iter_destroy_pre; + int HP_account_db_sql_iter_destroy_post; + int HP_account_db_sql_iter_next_pre; + int HP_account_db_sql_iter_next_post; + int HP_account_db_read_inter_pre; + int HP_account_db_read_inter_post; int HP_cmdline_init_pre; int HP_cmdline_init_post; int HP_cmdline_final_pre; @@ -799,6 +915,32 @@ struct { int HP_des_decrypt_block_post; int HP_des_decrypt_pre; int HP_des_decrypt_post; + int HP_ipban_init_pre; + int HP_ipban_init_post; + int HP_ipban_final_pre; + int HP_ipban_final_post; + int HP_ipban_cleanup_pre; + int HP_ipban_cleanup_post; + int HP_ipban_config_read_inter_pre; + int HP_ipban_config_read_inter_post; + int HP_ipban_config_read_connection_pre; + int HP_ipban_config_read_connection_post; + int HP_ipban_config_read_dynamic_pre; + int HP_ipban_config_read_dynamic_post; + int HP_ipban_config_read_pre; + int HP_ipban_config_read_post; + int HP_ipban_check_pre; + int HP_ipban_check_post; + int HP_ipban_log_pre; + int HP_ipban_log_post; + int HP_lchrif_server_init_pre; + int HP_lchrif_server_init_post; + int HP_lchrif_server_destroy_pre; + int HP_lchrif_server_destroy_post; + int HP_lchrif_server_reset_pre; + int HP_lchrif_server_reset_post; + int HP_lchrif_on_disconnect_pre; + int HP_lchrif_on_disconnect_post; int HP_lclif_init_pre; int HP_lclif_init_post; int HP_lclif_final_pre; @@ -1109,6 +1251,20 @@ struct { int HP_login_config_set_md5hash_post; int HP_login_convert_users_to_colors_pre; int HP_login_convert_users_to_colors_post; + int HP_loginlog_failedattempts_pre; + int HP_loginlog_failedattempts_post; + int HP_loginlog_log_pre; + int HP_loginlog_log_post; + int HP_loginlog_init_pre; + int HP_loginlog_init_post; + int HP_loginlog_final_pre; + int HP_loginlog_final_post; + int HP_loginlog_config_read_names_pre; + int HP_loginlog_config_read_names_post; + int HP_loginlog_config_read_log_pre; + int HP_loginlog_config_read_log_post; + int HP_loginlog_config_read_pre; + int HP_loginlog_config_read_post; int HP_md5_string_pre; int HP_md5_string_post; int HP_md5_binary_pre; @@ -1433,15 +1589,19 @@ struct { struct { struct HCache_interface HCache; + struct account_interface account; struct cmdline_interface cmdline; struct console_interface console; struct core_interface core; struct db_interface DB; struct des_interface des; + struct ipban_interface ipban; + struct lchrif_interface lchrif; struct lclif_interface lclif; struct lclif_interface_private PRIV__lclif; struct libconfig_interface libconfig; struct login_interface login; + struct loginlog_interface loginlog; struct md5_interface md5; struct mutex_interface mutex; struct nullpo_interface nullpo; diff --git a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc index a6a907806..6eb2e8121 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2017 Hercules Dev Team + * Copyright (C) 2013-2018 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 @@ -30,6 +30,26 @@ struct HookingPointData HookingPoints[] = { { HP_POP(HCache->init, HP_HCache_init) }, { HP_POP(HCache->check, HP_HCache_check) }, { HP_POP(HCache->open, HP_HCache_open) }, +/* account_interface */ + { HP_POP(account->db_sql_up, HP_account_db_sql_up) }, + { HP_POP(account->mmo_send_accreg2, HP_account_mmo_send_accreg2) }, + { HP_POP(account->mmo_save_accreg2, HP_account_mmo_save_accreg2) }, + { HP_POP(account->mmo_auth_fromsql, HP_account_mmo_auth_fromsql) }, + { HP_POP(account->mmo_auth_tosql, HP_account_mmo_auth_tosql) }, + { HP_POP(account->db_sql, HP_account_db_sql) }, + { HP_POP(account->db_sql_init, HP_account_db_sql_init) }, + { HP_POP(account->db_sql_destroy, HP_account_db_sql_destroy) }, + { HP_POP(account->db_sql_get_property, HP_account_db_sql_get_property) }, + { HP_POP(account->db_sql_set_property, HP_account_db_sql_set_property) }, + { HP_POP(account->db_sql_create, HP_account_db_sql_create) }, + { HP_POP(account->db_sql_remove, HP_account_db_sql_remove) }, + { HP_POP(account->db_sql_save, HP_account_db_sql_save) }, + { HP_POP(account->db_sql_load_num, HP_account_db_sql_load_num) }, + { HP_POP(account->db_sql_load_str, HP_account_db_sql_load_str) }, + { HP_POP(account->db_sql_iterator, HP_account_db_sql_iterator) }, + { HP_POP(account->db_sql_iter_destroy, HP_account_db_sql_iter_destroy) }, + { HP_POP(account->db_sql_iter_next, HP_account_db_sql_iter_next) }, + { HP_POP(account->db_read_inter, HP_account_db_read_inter) }, /* cmdline_interface */ { HP_POP(cmdline->init, HP_cmdline_init) }, { HP_POP(cmdline->final, HP_cmdline_final) }, @@ -67,6 +87,21 @@ struct HookingPointData HookingPoints[] = { /* des_interface */ { HP_POP(des->decrypt_block, HP_des_decrypt_block) }, { HP_POP(des->decrypt, HP_des_decrypt) }, +/* ipban_interface */ + { HP_POP(ipban->init, HP_ipban_init) }, + { HP_POP(ipban->final, HP_ipban_final) }, + { HP_POP(ipban->cleanup, HP_ipban_cleanup) }, + { HP_POP(ipban->config_read_inter, HP_ipban_config_read_inter) }, + { HP_POP(ipban->config_read_connection, HP_ipban_config_read_connection) }, + { HP_POP(ipban->config_read_dynamic, HP_ipban_config_read_dynamic) }, + { HP_POP(ipban->config_read, HP_ipban_config_read) }, + { HP_POP(ipban->check, HP_ipban_check) }, + { HP_POP(ipban->log, HP_ipban_log) }, +/* lchrif_interface */ + { HP_POP(lchrif->server_init, HP_lchrif_server_init) }, + { HP_POP(lchrif->server_destroy, HP_lchrif_server_destroy) }, + { HP_POP(lchrif->server_reset, HP_lchrif_server_reset) }, + { HP_POP(lchrif->on_disconnect, HP_lchrif_on_disconnect) }, /* lclif_interface */ { HP_POP(lclif->init, HP_lclif_init) }, { HP_POP(lclif->final, HP_lclif_final) }, @@ -226,6 +261,14 @@ struct HookingPointData HookingPoints[] = { { HP_POP(login->clear_client_hash_nodes, HP_login_clear_client_hash_nodes) }, { HP_POP(login->config_set_md5hash, HP_login_config_set_md5hash) }, { HP_POP(login->convert_users_to_colors, HP_login_convert_users_to_colors) }, +/* loginlog_interface */ + { HP_POP(loginlog->failedattempts, HP_loginlog_failedattempts) }, + { HP_POP(loginlog->log, HP_loginlog_log) }, + { HP_POP(loginlog->init, HP_loginlog_init) }, + { HP_POP(loginlog->final, HP_loginlog_final) }, + { HP_POP(loginlog->config_read_names, HP_loginlog_config_read_names) }, + { HP_POP(loginlog->config_read_log, HP_loginlog_config_read_log) }, + { HP_POP(loginlog->config_read, HP_loginlog_config_read) }, /* md5_interface */ { HP_POP(md5->string, HP_md5_string) }, { HP_POP(md5->binary, HP_md5_binary) }, diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc index 6071c472b..e432da70d 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2017 Hercules Dev Team + * Copyright (C) 2013-2018 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 @@ -106,6 +106,516 @@ FILE* HP_HCache_open(const char *file, const char *opt) { } return retVal___; } +/* account_interface */ +struct Sql* HP_account_db_sql_up(AccountDB *self) { + int hIndex = 0; + struct Sql* retVal___ = NULL; + if (HPMHooks.count.HP_account_db_sql_up_pre > 0) { + struct Sql* (*preHookFunc) (AccountDB **self); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_up_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_up_pre[hIndex].func; + retVal___ = preHookFunc(&self); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.account.db_sql_up(self); + } + if (HPMHooks.count.HP_account_db_sql_up_post > 0) { + struct Sql* (*postHookFunc) (struct Sql* retVal___, AccountDB *self); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_up_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_up_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self); + } + } + return retVal___; +} +void HP_account_mmo_send_accreg2(AccountDB *self, int fd, int account_id, int char_id) { + int hIndex = 0; + if (HPMHooks.count.HP_account_mmo_send_accreg2_pre > 0) { + void (*preHookFunc) (AccountDB **self, int *fd, int *account_id, int *char_id); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_mmo_send_accreg2_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_mmo_send_accreg2_pre[hIndex].func; + preHookFunc(&self, &fd, &account_id, &char_id); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.account.mmo_send_accreg2(self, fd, account_id, char_id); + } + if (HPMHooks.count.HP_account_mmo_send_accreg2_post > 0) { + void (*postHookFunc) (AccountDB *self, int fd, int account_id, int char_id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_mmo_send_accreg2_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_mmo_send_accreg2_post[hIndex].func; + postHookFunc(self, fd, account_id, char_id); + } + } + return; +} +void HP_account_mmo_save_accreg2(AccountDB *self, int fd, int account_id, int char_id) { + int hIndex = 0; + if (HPMHooks.count.HP_account_mmo_save_accreg2_pre > 0) { + void (*preHookFunc) (AccountDB **self, int *fd, int *account_id, int *char_id); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_mmo_save_accreg2_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_mmo_save_accreg2_pre[hIndex].func; + preHookFunc(&self, &fd, &account_id, &char_id); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.account.mmo_save_accreg2(self, fd, account_id, char_id); + } + if (HPMHooks.count.HP_account_mmo_save_accreg2_post > 0) { + void (*postHookFunc) (AccountDB *self, int fd, int account_id, int char_id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_mmo_save_accreg2_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_mmo_save_accreg2_post[hIndex].func; + postHookFunc(self, fd, account_id, char_id); + } + } + return; +} +bool HP_account_mmo_auth_fromsql(AccountDB_SQL *db, struct mmo_account *acc, int account_id) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_account_mmo_auth_fromsql_pre > 0) { + bool (*preHookFunc) (AccountDB_SQL **db, struct mmo_account **acc, int *account_id); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_mmo_auth_fromsql_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_mmo_auth_fromsql_pre[hIndex].func; + retVal___ = preHookFunc(&db, &acc, &account_id); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.account.mmo_auth_fromsql(db, acc, account_id); + } + if (HPMHooks.count.HP_account_mmo_auth_fromsql_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB_SQL *db, struct mmo_account *acc, int account_id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_mmo_auth_fromsql_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_mmo_auth_fromsql_post[hIndex].func; + retVal___ = postHookFunc(retVal___, db, acc, account_id); + } + } + return retVal___; +} +bool HP_account_mmo_auth_tosql(AccountDB_SQL *db, const struct mmo_account *acc, bool is_new) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_account_mmo_auth_tosql_pre > 0) { + bool (*preHookFunc) (AccountDB_SQL **db, const struct mmo_account **acc, bool *is_new); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_mmo_auth_tosql_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_mmo_auth_tosql_pre[hIndex].func; + retVal___ = preHookFunc(&db, &acc, &is_new); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.account.mmo_auth_tosql(db, acc, is_new); + } + if (HPMHooks.count.HP_account_mmo_auth_tosql_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB_SQL *db, const struct mmo_account *acc, bool is_new); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_mmo_auth_tosql_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_mmo_auth_tosql_post[hIndex].func; + retVal___ = postHookFunc(retVal___, db, acc, is_new); + } + } + return retVal___; +} +AccountDB* HP_account_db_sql(void) { + int hIndex = 0; + AccountDB* retVal___ = NULL; + if (HPMHooks.count.HP_account_db_sql_pre > 0) { + AccountDB* (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.account.db_sql(); + } + if (HPMHooks.count.HP_account_db_sql_post > 0) { + AccountDB* (*postHookFunc) (AccountDB* retVal___); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +bool HP_account_db_sql_init(AccountDB *self) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_account_db_sql_init_pre > 0) { + bool (*preHookFunc) (AccountDB **self); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_init_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_init_pre[hIndex].func; + retVal___ = preHookFunc(&self); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.account.db_sql_init(self); + } + if (HPMHooks.count.HP_account_db_sql_init_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB *self); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_init_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_init_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self); + } + } + return retVal___; +} +void HP_account_db_sql_destroy(AccountDB *self) { + int hIndex = 0; + if (HPMHooks.count.HP_account_db_sql_destroy_pre > 0) { + void (*preHookFunc) (AccountDB **self); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_destroy_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_destroy_pre[hIndex].func; + preHookFunc(&self); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.account.db_sql_destroy(self); + } + if (HPMHooks.count.HP_account_db_sql_destroy_post > 0) { + void (*postHookFunc) (AccountDB *self); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_destroy_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_destroy_post[hIndex].func; + postHookFunc(self); + } + } + return; +} +bool HP_account_db_sql_get_property(AccountDB *self, const char *key, char *buf, size_t buflen) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_account_db_sql_get_property_pre > 0) { + bool (*preHookFunc) (AccountDB **self, const char **key, char **buf, size_t *buflen); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_get_property_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_get_property_pre[hIndex].func; + retVal___ = preHookFunc(&self, &key, &buf, &buflen); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.account.db_sql_get_property(self, key, buf, buflen); + } + if (HPMHooks.count.HP_account_db_sql_get_property_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB *self, const char *key, char *buf, size_t buflen); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_get_property_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_get_property_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self, key, buf, buflen); + } + } + return retVal___; +} +bool HP_account_db_sql_set_property(AccountDB *self, struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_account_db_sql_set_property_pre > 0) { + bool (*preHookFunc) (AccountDB **self, struct config_t **config, bool *imported); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_set_property_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_set_property_pre[hIndex].func; + retVal___ = preHookFunc(&self, &config, &imported); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.account.db_sql_set_property(self, config, imported); + } + if (HPMHooks.count.HP_account_db_sql_set_property_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB *self, struct config_t *config, bool imported); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_set_property_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_set_property_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self, config, imported); + } + } + return retVal___; +} +bool HP_account_db_sql_create(AccountDB *self, struct mmo_account *acc) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_account_db_sql_create_pre > 0) { + bool (*preHookFunc) (AccountDB **self, struct mmo_account **acc); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_create_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_create_pre[hIndex].func; + retVal___ = preHookFunc(&self, &acc); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.account.db_sql_create(self, acc); + } + if (HPMHooks.count.HP_account_db_sql_create_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB *self, struct mmo_account *acc); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_create_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_create_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self, acc); + } + } + return retVal___; +} +bool HP_account_db_sql_remove(AccountDB *self, const int account_id) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_account_db_sql_remove_pre > 0) { + bool (*preHookFunc) (AccountDB **self, const int *account_id); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_remove_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_remove_pre[hIndex].func; + retVal___ = preHookFunc(&self, &account_id); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.account.db_sql_remove(self, account_id); + } + if (HPMHooks.count.HP_account_db_sql_remove_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB *self, const int account_id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_remove_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_remove_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self, account_id); + } + } + return retVal___; +} +bool HP_account_db_sql_save(AccountDB *self, const struct mmo_account *acc) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_account_db_sql_save_pre > 0) { + bool (*preHookFunc) (AccountDB **self, const struct mmo_account **acc); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_save_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_save_pre[hIndex].func; + retVal___ = preHookFunc(&self, &acc); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.account.db_sql_save(self, acc); + } + if (HPMHooks.count.HP_account_db_sql_save_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB *self, const struct mmo_account *acc); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_save_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_save_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self, acc); + } + } + return retVal___; +} +bool HP_account_db_sql_load_num(AccountDB *self, struct mmo_account *acc, const int account_id) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_account_db_sql_load_num_pre > 0) { + bool (*preHookFunc) (AccountDB **self, struct mmo_account **acc, const int *account_id); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_load_num_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_load_num_pre[hIndex].func; + retVal___ = preHookFunc(&self, &acc, &account_id); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.account.db_sql_load_num(self, acc, account_id); + } + if (HPMHooks.count.HP_account_db_sql_load_num_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB *self, struct mmo_account *acc, const int account_id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_load_num_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_load_num_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self, acc, account_id); + } + } + return retVal___; +} +bool HP_account_db_sql_load_str(AccountDB *self, struct mmo_account *acc, const char *userid) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_account_db_sql_load_str_pre > 0) { + bool (*preHookFunc) (AccountDB **self, struct mmo_account **acc, const char **userid); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_load_str_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_load_str_pre[hIndex].func; + retVal___ = preHookFunc(&self, &acc, &userid); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.account.db_sql_load_str(self, acc, userid); + } + if (HPMHooks.count.HP_account_db_sql_load_str_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB *self, struct mmo_account *acc, const char *userid); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_load_str_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_load_str_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self, acc, userid); + } + } + return retVal___; +} +AccountDBIterator* HP_account_db_sql_iterator(AccountDB *self) { + int hIndex = 0; + AccountDBIterator* retVal___ = NULL; + if (HPMHooks.count.HP_account_db_sql_iterator_pre > 0) { + AccountDBIterator* (*preHookFunc) (AccountDB **self); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_iterator_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_iterator_pre[hIndex].func; + retVal___ = preHookFunc(&self); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.account.db_sql_iterator(self); + } + if (HPMHooks.count.HP_account_db_sql_iterator_post > 0) { + AccountDBIterator* (*postHookFunc) (AccountDBIterator* retVal___, AccountDB *self); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_iterator_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_iterator_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self); + } + } + return retVal___; +} +void HP_account_db_sql_iter_destroy(AccountDBIterator *self) { + int hIndex = 0; + if (HPMHooks.count.HP_account_db_sql_iter_destroy_pre > 0) { + void (*preHookFunc) (AccountDBIterator **self); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_iter_destroy_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_iter_destroy_pre[hIndex].func; + preHookFunc(&self); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.account.db_sql_iter_destroy(self); + } + if (HPMHooks.count.HP_account_db_sql_iter_destroy_post > 0) { + void (*postHookFunc) (AccountDBIterator *self); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_iter_destroy_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_iter_destroy_post[hIndex].func; + postHookFunc(self); + } + } + return; +} +bool HP_account_db_sql_iter_next(AccountDBIterator *self, struct mmo_account *acc) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_account_db_sql_iter_next_pre > 0) { + bool (*preHookFunc) (AccountDBIterator **self, struct mmo_account **acc); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_iter_next_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_iter_next_pre[hIndex].func; + retVal___ = preHookFunc(&self, &acc); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.account.db_sql_iter_next(self, acc); + } + if (HPMHooks.count.HP_account_db_sql_iter_next_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDBIterator *self, struct mmo_account *acc); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_iter_next_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_iter_next_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self, acc); + } + } + return retVal___; +} +bool HP_account_db_read_inter(AccountDB_SQL *db, const char *filename, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_account_db_read_inter_pre > 0) { + bool (*preHookFunc) (AccountDB_SQL **db, const char **filename, bool *imported); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_read_inter_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_read_inter_pre[hIndex].func; + retVal___ = preHookFunc(&db, &filename, &imported); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.account.db_read_inter(db, filename, imported); + } + if (HPMHooks.count.HP_account_db_read_inter_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB_SQL *db, const char *filename, bool imported); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_read_inter_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_read_inter_post[hIndex].func; + retVal___ = postHookFunc(retVal___, db, filename, imported); + } + } + return retVal___; +} /* cmdline_interface */ void HP_cmdline_init(void) { int hIndex = 0; @@ -964,6 +1474,352 @@ void HP_des_decrypt(unsigned char *data, size_t size) { } return; } +/* ipban_interface */ +void HP_ipban_init(void) { + int hIndex = 0; + if (HPMHooks.count.HP_ipban_init_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_init_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_ipban_init_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.ipban.init(); + } + if (HPMHooks.count.HP_ipban_init_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_init_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_ipban_init_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_ipban_final(void) { + int hIndex = 0; + if (HPMHooks.count.HP_ipban_final_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_final_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_ipban_final_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.ipban.final(); + } + if (HPMHooks.count.HP_ipban_final_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_final_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_ipban_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +int HP_ipban_cleanup(int tid, int64 tick, int id, intptr_t data) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_ipban_cleanup_pre > 0) { + int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_cleanup_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_ipban_cleanup_pre[hIndex].func; + retVal___ = preHookFunc(&tid, &tick, &id, &data); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.ipban.cleanup(tid, tick, id, data); + } + if (HPMHooks.count.HP_ipban_cleanup_post > 0) { + int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_cleanup_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_ipban_cleanup_post[hIndex].func; + retVal___ = postHookFunc(retVal___, tid, tick, id, data); + } + } + return retVal___; +} +bool HP_ipban_config_read_inter(const char *filename, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_ipban_config_read_inter_pre > 0) { + bool (*preHookFunc) (const char **filename, bool *imported); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_config_read_inter_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_ipban_config_read_inter_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &imported); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.ipban.config_read_inter(filename, imported); + } + if (HPMHooks.count.HP_ipban_config_read_inter_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *filename, bool imported); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_config_read_inter_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_ipban_config_read_inter_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, imported); + } + } + return retVal___; +} +bool HP_ipban_config_read_connection(const char *filename, struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_ipban_config_read_connection_pre > 0) { + bool (*preHookFunc) (const char **filename, struct config_t **config, bool *imported); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_config_read_connection_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_ipban_config_read_connection_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.ipban.config_read_connection(filename, config, imported); + } + if (HPMHooks.count.HP_ipban_config_read_connection_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *filename, struct config_t *config, bool imported); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_config_read_connection_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_ipban_config_read_connection_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +bool HP_ipban_config_read_dynamic(const char *filename, struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_ipban_config_read_dynamic_pre > 0) { + bool (*preHookFunc) (const char **filename, struct config_t **config, bool *imported); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_config_read_dynamic_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_ipban_config_read_dynamic_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.ipban.config_read_dynamic(filename, config, imported); + } + if (HPMHooks.count.HP_ipban_config_read_dynamic_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *filename, struct config_t *config, bool imported); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_config_read_dynamic_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_ipban_config_read_dynamic_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +bool HP_ipban_config_read(const char *filename, struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_ipban_config_read_pre > 0) { + bool (*preHookFunc) (const char **filename, struct config_t **config, bool *imported); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_config_read_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_ipban_config_read_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.ipban.config_read(filename, config, imported); + } + if (HPMHooks.count.HP_ipban_config_read_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *filename, struct config_t *config, bool imported); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_config_read_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_ipban_config_read_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +bool HP_ipban_check(uint32 ip) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_ipban_check_pre > 0) { + bool (*preHookFunc) (uint32 *ip); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_check_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_ipban_check_pre[hIndex].func; + retVal___ = preHookFunc(&ip); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.ipban.check(ip); + } + if (HPMHooks.count.HP_ipban_check_post > 0) { + bool (*postHookFunc) (bool retVal___, uint32 ip); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_check_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_ipban_check_post[hIndex].func; + retVal___ = postHookFunc(retVal___, ip); + } + } + return retVal___; +} +void HP_ipban_log(uint32 ip) { + int hIndex = 0; + if (HPMHooks.count.HP_ipban_log_pre > 0) { + void (*preHookFunc) (uint32 *ip); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_log_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_ipban_log_pre[hIndex].func; + preHookFunc(&ip); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.ipban.log(ip); + } + if (HPMHooks.count.HP_ipban_log_post > 0) { + void (*postHookFunc) (uint32 ip); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_log_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_ipban_log_post[hIndex].func; + postHookFunc(ip); + } + } + return; +} +/* lchrif_interface */ +void HP_lchrif_server_init(int id) { + int hIndex = 0; + if (HPMHooks.count.HP_lchrif_server_init_pre > 0) { + void (*preHookFunc) (int *id); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_lchrif_server_init_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_lchrif_server_init_pre[hIndex].func; + preHookFunc(&id); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.lchrif.server_init(id); + } + if (HPMHooks.count.HP_lchrif_server_init_post > 0) { + void (*postHookFunc) (int id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_lchrif_server_init_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_lchrif_server_init_post[hIndex].func; + postHookFunc(id); + } + } + return; +} +void HP_lchrif_server_destroy(int id) { + int hIndex = 0; + if (HPMHooks.count.HP_lchrif_server_destroy_pre > 0) { + void (*preHookFunc) (int *id); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_lchrif_server_destroy_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_lchrif_server_destroy_pre[hIndex].func; + preHookFunc(&id); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.lchrif.server_destroy(id); + } + if (HPMHooks.count.HP_lchrif_server_destroy_post > 0) { + void (*postHookFunc) (int id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_lchrif_server_destroy_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_lchrif_server_destroy_post[hIndex].func; + postHookFunc(id); + } + } + return; +} +void HP_lchrif_server_reset(int id) { + int hIndex = 0; + if (HPMHooks.count.HP_lchrif_server_reset_pre > 0) { + void (*preHookFunc) (int *id); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_lchrif_server_reset_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_lchrif_server_reset_pre[hIndex].func; + preHookFunc(&id); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.lchrif.server_reset(id); + } + if (HPMHooks.count.HP_lchrif_server_reset_post > 0) { + void (*postHookFunc) (int id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_lchrif_server_reset_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_lchrif_server_reset_post[hIndex].func; + postHookFunc(id); + } + } + return; +} +void HP_lchrif_on_disconnect(int id) { + int hIndex = 0; + if (HPMHooks.count.HP_lchrif_on_disconnect_pre > 0) { + void (*preHookFunc) (int *id); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_lchrif_on_disconnect_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_lchrif_on_disconnect_pre[hIndex].func; + preHookFunc(&id); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.lchrif.on_disconnect(id); + } + if (HPMHooks.count.HP_lchrif_on_disconnect_post > 0) { + void (*postHookFunc) (int id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_lchrif_on_disconnect_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_lchrif_on_disconnect_post[hIndex].func; + postHookFunc(id); + } + } + return; +} /* lclif_interface */ void HP_lclif_init(void) { int hIndex = 0; @@ -5117,6 +5973,195 @@ uint16 HP_login_convert_users_to_colors(uint16 users) { } return retVal___; } +/* loginlog_interface */ +unsigned long HP_loginlog_failedattempts(uint32 ip, unsigned int minutes) { + int hIndex = 0; + unsigned long retVal___ = 0; + if (HPMHooks.count.HP_loginlog_failedattempts_pre > 0) { + unsigned long (*preHookFunc) (uint32 *ip, unsigned int *minutes); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_failedattempts_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_loginlog_failedattempts_pre[hIndex].func; + retVal___ = preHookFunc(&ip, &minutes); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.loginlog.failedattempts(ip, minutes); + } + if (HPMHooks.count.HP_loginlog_failedattempts_post > 0) { + unsigned long (*postHookFunc) (unsigned long retVal___, uint32 ip, unsigned int minutes); + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_failedattempts_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_loginlog_failedattempts_post[hIndex].func; + retVal___ = postHookFunc(retVal___, ip, minutes); + } + } + return retVal___; +} +void HP_loginlog_log(uint32 ip, const char *username, int rcode, const char *message) { + int hIndex = 0; + if (HPMHooks.count.HP_loginlog_log_pre > 0) { + void (*preHookFunc) (uint32 *ip, const char **username, int *rcode, const char **message); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_log_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_loginlog_log_pre[hIndex].func; + preHookFunc(&ip, &username, &rcode, &message); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.loginlog.log(ip, username, rcode, message); + } + if (HPMHooks.count.HP_loginlog_log_post > 0) { + void (*postHookFunc) (uint32 ip, const char *username, int rcode, const char *message); + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_log_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_loginlog_log_post[hIndex].func; + postHookFunc(ip, username, rcode, message); + } + } + return; +} +bool HP_loginlog_init(void) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_loginlog_init_pre > 0) { + bool (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_init_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_loginlog_init_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.loginlog.init(); + } + if (HPMHooks.count.HP_loginlog_init_post > 0) { + bool (*postHookFunc) (bool retVal___); + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_init_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_loginlog_init_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +bool HP_loginlog_final(void) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_loginlog_final_pre > 0) { + bool (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_final_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_loginlog_final_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.loginlog.final(); + } + if (HPMHooks.count.HP_loginlog_final_post > 0) { + bool (*postHookFunc) (bool retVal___); + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_final_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_loginlog_final_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +bool HP_loginlog_config_read_names(const char *filename, struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_loginlog_config_read_names_pre > 0) { + bool (*preHookFunc) (const char **filename, struct config_t **config, bool *imported); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_config_read_names_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_loginlog_config_read_names_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.loginlog.config_read_names(filename, config, imported); + } + if (HPMHooks.count.HP_loginlog_config_read_names_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *filename, struct config_t *config, bool imported); + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_config_read_names_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_loginlog_config_read_names_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +bool HP_loginlog_config_read_log(const char *filename, struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_loginlog_config_read_log_pre > 0) { + bool (*preHookFunc) (const char **filename, struct config_t **config, bool *imported); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_config_read_log_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_loginlog_config_read_log_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.loginlog.config_read_log(filename, config, imported); + } + if (HPMHooks.count.HP_loginlog_config_read_log_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *filename, struct config_t *config, bool imported); + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_config_read_log_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_loginlog_config_read_log_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +bool HP_loginlog_config_read(const char *filename, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_loginlog_config_read_pre > 0) { + bool (*preHookFunc) (const char **filename, bool *imported); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_config_read_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_loginlog_config_read_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &imported); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.loginlog.config_read(filename, imported); + } + if (HPMHooks.count.HP_loginlog_config_read_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *filename, bool imported); + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_config_read_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_loginlog_config_read_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, imported); + } + } + return retVal___; +} /* md5_interface */ void HP_md5_string(const char *string, char *output) { int hIndex = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_login.sources.inc b/src/plugins/HPMHooking/HPMHooking_login.sources.inc index 8c3b935ac..78c506043 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.sources.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.sources.inc @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2017 Hercules Dev Team + * Copyright (C) 2013-2018 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 @@ -26,15 +26,19 @@ /* GENERATED FILE DO NOT EDIT */ HPMHooks.source.HCache = *HCache; +HPMHooks.source.account = *account; HPMHooks.source.cmdline = *cmdline; HPMHooks.source.console = *console; HPMHooks.source.core = *core; HPMHooks.source.DB = *DB; HPMHooks.source.des = *des; +HPMHooks.source.ipban = *ipban; +HPMHooks.source.lchrif = *lchrif; HPMHooks.source.lclif = *lclif; HPMHooks.source.PRIV__lclif = *lclif->p; HPMHooks.source.libconfig = *libconfig; HPMHooks.source.login = *login; +HPMHooks.source.loginlog = *loginlog; HPMHooks.source.md5 = *md5; HPMHooks.source.mutex = *mutex; HPMHooks.source.nullpo = *nullpo; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index cc097aeae..9d531e370 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2017 Hercules Dev Team + * Copyright (C) 2013-2018 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 @@ -504,6 +504,60 @@ struct { struct HPMHookPoint *HP_chrif_save_scdata_single_post; struct HPMHookPoint *HP_chrif_del_scdata_single_pre; struct HPMHookPoint *HP_chrif_del_scdata_single_post; + struct HPMHookPoint *HP_clan_init_pre; + struct HPMHookPoint *HP_clan_init_post; + struct HPMHookPoint *HP_clan_final_pre; + struct HPMHookPoint *HP_clan_final_post; + struct HPMHookPoint *HP_clan_config_read_pre; + struct HPMHookPoint *HP_clan_config_read_post; + struct HPMHookPoint *HP_clan_config_read_additional_settings_pre; + struct HPMHookPoint *HP_clan_config_read_additional_settings_post; + struct HPMHookPoint *HP_clan_read_db_pre; + struct HPMHookPoint *HP_clan_read_db_post; + struct HPMHookPoint *HP_clan_read_db_sub_pre; + struct HPMHookPoint *HP_clan_read_db_sub_post; + struct HPMHookPoint *HP_clan_read_db_additional_fields_pre; + struct HPMHookPoint *HP_clan_read_db_additional_fields_post; + struct HPMHookPoint *HP_clan_read_buffs_pre; + struct HPMHookPoint *HP_clan_read_buffs_post; + struct HPMHookPoint *HP_clan_search_pre; + struct HPMHookPoint *HP_clan_search_post; + struct HPMHookPoint *HP_clan_searchname_pre; + struct HPMHookPoint *HP_clan_searchname_post; + struct HPMHookPoint *HP_clan_getonlinesd_pre; + struct HPMHookPoint *HP_clan_getonlinesd_post; + struct HPMHookPoint *HP_clan_getindex_pre; + struct HPMHookPoint *HP_clan_getindex_post; + struct HPMHookPoint *HP_clan_join_pre; + struct HPMHookPoint *HP_clan_join_post; + struct HPMHookPoint *HP_clan_member_online_pre; + struct HPMHookPoint *HP_clan_member_online_post; + struct HPMHookPoint *HP_clan_leave_pre; + struct HPMHookPoint *HP_clan_leave_post; + struct HPMHookPoint *HP_clan_send_message_pre; + struct HPMHookPoint *HP_clan_send_message_post; + struct HPMHookPoint *HP_clan_recv_message_pre; + struct HPMHookPoint *HP_clan_recv_message_post; + struct HPMHookPoint *HP_clan_member_offline_pre; + struct HPMHookPoint *HP_clan_member_offline_post; + struct HPMHookPoint *HP_clan_set_constants_pre; + struct HPMHookPoint *HP_clan_set_constants_post; + struct HPMHookPoint *HP_clan_get_id_pre; + struct HPMHookPoint *HP_clan_get_id_post; + struct HPMHookPoint *HP_clan_buff_start_pre; + struct HPMHookPoint *HP_clan_buff_start_post; + struct HPMHookPoint *HP_clan_buff_end_pre; + struct HPMHookPoint *HP_clan_buff_end_post; + struct HPMHookPoint *HP_clan_reload_pre; + struct HPMHookPoint *HP_clan_reload_post; + struct HPMHookPoint *HP_clan_rejoin_pre; + struct HPMHookPoint *HP_clan_rejoin_post; + struct HPMHookPoint *HP_clan_inactivity_kick_pre; + struct HPMHookPoint *HP_clan_inactivity_kick_post; + struct HPMHookPoint *HP_clan_request_kickoffline_pre; + struct HPMHookPoint *HP_clan_request_kickoffline_post; + struct HPMHookPoint *HP_clan_request_membercount_pre; + struct HPMHookPoint *HP_clan_request_membercount_post; struct HPMHookPoint *HP_clif_init_pre; struct HPMHookPoint *HP_clif_init_post; struct HPMHookPoint *HP_clif_final_pre; @@ -824,6 +878,8 @@ struct { struct HPMHookPoint *HP_clif_progressbar_post; struct HPMHookPoint *HP_clif_progressbar_abort_pre; struct HPMHookPoint *HP_clif_progressbar_abort_post; + struct HPMHookPoint *HP_clif_progressbar_unit_pre; + struct HPMHookPoint *HP_clif_progressbar_unit_post; struct HPMHookPoint *HP_clif_showdigit_pre; struct HPMHookPoint *HP_clif_showdigit_post; struct HPMHookPoint *HP_clif_elementalconverter_list_pre; @@ -1932,6 +1988,16 @@ struct { struct HPMHookPoint *HP_clif_rodex_icon_post; struct HPMHookPoint *HP_clif_skill_scale_pre; struct HPMHookPoint *HP_clif_skill_scale_post; + struct HPMHookPoint *HP_clif_clan_basicinfo_pre; + struct HPMHookPoint *HP_clif_clan_basicinfo_post; + struct HPMHookPoint *HP_clif_clan_onlinecount_pre; + struct HPMHookPoint *HP_clif_clan_onlinecount_post; + struct HPMHookPoint *HP_clif_clan_leave_pre; + struct HPMHookPoint *HP_clif_clan_leave_post; + struct HPMHookPoint *HP_clif_clan_message_pre; + struct HPMHookPoint *HP_clif_clan_message_post; + struct HPMHookPoint *HP_clif_pClanMessage_pre; + struct HPMHookPoint *HP_clif_pClanMessage_post; struct HPMHookPoint *HP_cmdline_init_pre; struct HPMHookPoint *HP_cmdline_init_post; struct HPMHookPoint *HP_cmdline_final_pre; @@ -2574,6 +2640,10 @@ struct { struct HPMHookPoint *HP_intif_rodex_sendmail_post; struct HPMHookPoint *HP_intif_rodex_checkname_pre; struct HPMHookPoint *HP_intif_rodex_checkname_post; + struct HPMHookPoint *HP_intif_clan_kickoffline_pre; + struct HPMHookPoint *HP_intif_clan_kickoffline_post; + struct HPMHookPoint *HP_intif_clan_membercount_pre; + struct HPMHookPoint *HP_intif_clan_membercount_post; struct HPMHookPoint *HP_intif_request_accinfo_pre; struct HPMHookPoint *HP_intif_request_accinfo_post; struct HPMHookPoint *HP_intif_CheckForCharServer_pre; @@ -2714,6 +2784,8 @@ struct { struct HPMHookPoint *HP_intif_pRodexSendMail_post; struct HPMHookPoint *HP_intif_pRodexCheckName_pre; struct HPMHookPoint *HP_intif_pRodexCheckName_post; + struct HPMHookPoint *HP_intif_pRecvClanMemberAction_pre; + struct HPMHookPoint *HP_intif_pRecvClanMemberAction_post; struct HPMHookPoint *HP_ircbot_init_pre; struct HPMHookPoint *HP_ircbot_init_post; struct HPMHookPoint *HP_ircbot_final_pre; @@ -3284,10 +3356,10 @@ struct { struct HPMHookPoint *HP_map_create_map_data_other_server_post; struct HPMHookPoint *HP_map_eraseallipport_sub_pre; struct HPMHookPoint *HP_map_eraseallipport_sub_post; - struct HPMHookPoint *HP_map_init_mapcache_pre; - struct HPMHookPoint *HP_map_init_mapcache_post; struct HPMHookPoint *HP_map_readfromcache_pre; struct HPMHookPoint *HP_map_readfromcache_post; + struct HPMHookPoint *HP_map_readfromcache_v1_pre; + struct HPMHookPoint *HP_map_readfromcache_v1_post; struct HPMHookPoint *HP_map_addmap_pre; struct HPMHookPoint *HP_map_addmap_post; struct HPMHookPoint *HP_map_delmapid_pre; @@ -4982,6 +5054,8 @@ struct { struct HPMHookPoint *HP_script_cleanfloor_sub_post; struct HPMHookPoint *HP_script_run_func_pre; struct HPMHookPoint *HP_script_run_func_post; + struct HPMHookPoint *HP_script_sprintf_pre; + struct HPMHookPoint *HP_script_sprintf_post; struct HPMHookPoint *HP_script_getfuncname_pre; struct HPMHookPoint *HP_script_getfuncname_post; struct HPMHookPoint *HP_script_calc_hash_ci_pre; @@ -5450,8 +5524,6 @@ struct { struct HPMHookPoint *HP_skill_parse_row_spellbookdb_post; struct HPMHookPoint *HP_skill_parse_row_magicmushroomdb_pre; struct HPMHookPoint *HP_skill_parse_row_magicmushroomdb_post; - struct HPMHookPoint *HP_skill_parse_row_reproducedb_pre; - struct HPMHookPoint *HP_skill_parse_row_reproducedb_post; struct HPMHookPoint *HP_skill_parse_row_improvisedb_pre; struct HPMHookPoint *HP_skill_parse_row_improvisedb_post; struct HPMHookPoint *HP_skill_parse_row_changematerialdb_pre; @@ -6713,6 +6785,60 @@ struct { int HP_chrif_save_scdata_single_post; int HP_chrif_del_scdata_single_pre; int HP_chrif_del_scdata_single_post; + int HP_clan_init_pre; + int HP_clan_init_post; + int HP_clan_final_pre; + int HP_clan_final_post; + int HP_clan_config_read_pre; + int HP_clan_config_read_post; + int HP_clan_config_read_additional_settings_pre; + int HP_clan_config_read_additional_settings_post; + int HP_clan_read_db_pre; + int HP_clan_read_db_post; + int HP_clan_read_db_sub_pre; + int HP_clan_read_db_sub_post; + int HP_clan_read_db_additional_fields_pre; + int HP_clan_read_db_additional_fields_post; + int HP_clan_read_buffs_pre; + int HP_clan_read_buffs_post; + int HP_clan_search_pre; + int HP_clan_search_post; + int HP_clan_searchname_pre; + int HP_clan_searchname_post; + int HP_clan_getonlinesd_pre; + int HP_clan_getonlinesd_post; + int HP_clan_getindex_pre; + int HP_clan_getindex_post; + int HP_clan_join_pre; + int HP_clan_join_post; + int HP_clan_member_online_pre; + int HP_clan_member_online_post; + int HP_clan_leave_pre; + int HP_clan_leave_post; + int HP_clan_send_message_pre; + int HP_clan_send_message_post; + int HP_clan_recv_message_pre; + int HP_clan_recv_message_post; + int HP_clan_member_offline_pre; + int HP_clan_member_offline_post; + int HP_clan_set_constants_pre; + int HP_clan_set_constants_post; + int HP_clan_get_id_pre; + int HP_clan_get_id_post; + int HP_clan_buff_start_pre; + int HP_clan_buff_start_post; + int HP_clan_buff_end_pre; + int HP_clan_buff_end_post; + int HP_clan_reload_pre; + int HP_clan_reload_post; + int HP_clan_rejoin_pre; + int HP_clan_rejoin_post; + int HP_clan_inactivity_kick_pre; + int HP_clan_inactivity_kick_post; + int HP_clan_request_kickoffline_pre; + int HP_clan_request_kickoffline_post; + int HP_clan_request_membercount_pre; + int HP_clan_request_membercount_post; int HP_clif_init_pre; int HP_clif_init_post; int HP_clif_final_pre; @@ -7033,6 +7159,8 @@ struct { int HP_clif_progressbar_post; int HP_clif_progressbar_abort_pre; int HP_clif_progressbar_abort_post; + int HP_clif_progressbar_unit_pre; + int HP_clif_progressbar_unit_post; int HP_clif_showdigit_pre; int HP_clif_showdigit_post; int HP_clif_elementalconverter_list_pre; @@ -8141,6 +8269,16 @@ struct { int HP_clif_rodex_icon_post; int HP_clif_skill_scale_pre; int HP_clif_skill_scale_post; + int HP_clif_clan_basicinfo_pre; + int HP_clif_clan_basicinfo_post; + int HP_clif_clan_onlinecount_pre; + int HP_clif_clan_onlinecount_post; + int HP_clif_clan_leave_pre; + int HP_clif_clan_leave_post; + int HP_clif_clan_message_pre; + int HP_clif_clan_message_post; + int HP_clif_pClanMessage_pre; + int HP_clif_pClanMessage_post; int HP_cmdline_init_pre; int HP_cmdline_init_post; int HP_cmdline_final_pre; @@ -8783,6 +8921,10 @@ struct { int HP_intif_rodex_sendmail_post; int HP_intif_rodex_checkname_pre; int HP_intif_rodex_checkname_post; + int HP_intif_clan_kickoffline_pre; + int HP_intif_clan_kickoffline_post; + int HP_intif_clan_membercount_pre; + int HP_intif_clan_membercount_post; int HP_intif_request_accinfo_pre; int HP_intif_request_accinfo_post; int HP_intif_CheckForCharServer_pre; @@ -8923,6 +9065,8 @@ struct { int HP_intif_pRodexSendMail_post; int HP_intif_pRodexCheckName_pre; int HP_intif_pRodexCheckName_post; + int HP_intif_pRecvClanMemberAction_pre; + int HP_intif_pRecvClanMemberAction_post; int HP_ircbot_init_pre; int HP_ircbot_init_post; int HP_ircbot_final_pre; @@ -9493,10 +9637,10 @@ struct { int HP_map_create_map_data_other_server_post; int HP_map_eraseallipport_sub_pre; int HP_map_eraseallipport_sub_post; - int HP_map_init_mapcache_pre; - int HP_map_init_mapcache_post; int HP_map_readfromcache_pre; int HP_map_readfromcache_post; + int HP_map_readfromcache_v1_pre; + int HP_map_readfromcache_v1_post; int HP_map_addmap_pre; int HP_map_addmap_post; int HP_map_delmapid_pre; @@ -11191,6 +11335,8 @@ struct { int HP_script_cleanfloor_sub_post; int HP_script_run_func_pre; int HP_script_run_func_post; + int HP_script_sprintf_pre; + int HP_script_sprintf_post; int HP_script_getfuncname_pre; int HP_script_getfuncname_post; int HP_script_calc_hash_ci_pre; @@ -11659,8 +11805,6 @@ struct { int HP_skill_parse_row_spellbookdb_post; int HP_skill_parse_row_magicmushroomdb_pre; int HP_skill_parse_row_magicmushroomdb_post; - int HP_skill_parse_row_reproducedb_pre; - int HP_skill_parse_row_reproducedb_post; int HP_skill_parse_row_improvisedb_pre; int HP_skill_parse_row_improvisedb_post; int HP_skill_parse_row_changematerialdb_pre; @@ -12452,6 +12596,7 @@ struct { struct channel_interface channel; struct chat_interface chat; struct chrif_interface chrif; + struct clan_interface clan; struct clif_interface clif; struct cmdline_interface cmdline; struct console_interface console; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 7caf25de6..5551668d2 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2017 Hercules Dev Team + * Copyright (C) 2013-2018 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 @@ -273,6 +273,34 @@ struct HookingPointData HookingPoints[] = { { HP_POP(chrif->parse, HP_chrif_parse) }, { HP_POP(chrif->save_scdata_single, HP_chrif_save_scdata_single) }, { HP_POP(chrif->del_scdata_single, HP_chrif_del_scdata_single) }, +/* clan_interface */ + { HP_POP(clan->init, HP_clan_init) }, + { HP_POP(clan->final, HP_clan_final) }, + { HP_POP(clan->config_read, HP_clan_config_read) }, + { HP_POP(clan->config_read_additional_settings, HP_clan_config_read_additional_settings) }, + { HP_POP(clan->read_db, HP_clan_read_db) }, + { HP_POP(clan->read_db_sub, HP_clan_read_db_sub) }, + { HP_POP(clan->read_db_additional_fields, HP_clan_read_db_additional_fields) }, + { HP_POP(clan->read_buffs, HP_clan_read_buffs) }, + { HP_POP(clan->search, HP_clan_search) }, + { HP_POP(clan->searchname, HP_clan_searchname) }, + { HP_POP(clan->getonlinesd, HP_clan_getonlinesd) }, + { HP_POP(clan->getindex, HP_clan_getindex) }, + { HP_POP(clan->join, HP_clan_join) }, + { HP_POP(clan->member_online, HP_clan_member_online) }, + { HP_POP(clan->leave, HP_clan_leave) }, + { HP_POP(clan->send_message, HP_clan_send_message) }, + { HP_POP(clan->recv_message, HP_clan_recv_message) }, + { HP_POP(clan->member_offline, HP_clan_member_offline) }, + { HP_POP(clan->set_constants, HP_clan_set_constants) }, + { HP_POP(clan->get_id, HP_clan_get_id) }, + { HP_POP(clan->buff_start, HP_clan_buff_start) }, + { HP_POP(clan->buff_end, HP_clan_buff_end) }, + { HP_POP(clan->reload, HP_clan_reload) }, + { HP_POP(clan->rejoin, HP_clan_rejoin) }, + { HP_POP(clan->inactivity_kick, HP_clan_inactivity_kick) }, + { HP_POP(clan->request_kickoffline, HP_clan_request_kickoffline) }, + { HP_POP(clan->request_membercount, HP_clan_request_membercount) }, /* clif_interface */ { HP_POP(clif->init, HP_clif_init) }, { HP_POP(clif->final, HP_clif_final) }, @@ -434,6 +462,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->font, HP_clif_font) }, { HP_POP(clif->progressbar, HP_clif_progressbar) }, { HP_POP(clif->progressbar_abort, HP_clif_progressbar_abort) }, + { HP_POP(clif->progressbar_unit, HP_clif_progressbar_unit) }, { HP_POP(clif->showdigit, HP_clif_showdigit) }, { HP_POP(clif->elementalconverter_list, HP_clif_elementalconverter_list) }, { HP_POP(clif->spellbook_list, HP_clif_spellbook_list) }, @@ -988,6 +1017,11 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->rodex_request_items, HP_clif_rodex_request_items) }, { HP_POP(clif->rodex_icon, HP_clif_rodex_icon) }, { HP_POP(clif->skill_scale, HP_clif_skill_scale) }, + { HP_POP(clif->clan_basicinfo, HP_clif_clan_basicinfo) }, + { HP_POP(clif->clan_onlinecount, HP_clif_clan_onlinecount) }, + { HP_POP(clif->clan_leave, HP_clif_clan_leave) }, + { HP_POP(clif->clan_message, HP_clif_clan_message) }, + { HP_POP(clif->pClanMessage, HP_clif_pClanMessage) }, /* cmdline_interface */ { HP_POP(cmdline->init, HP_cmdline_init) }, { HP_POP(cmdline->final, HP_cmdline_final) }, @@ -1322,6 +1356,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(intif->rodex_updatemail, HP_intif_rodex_updatemail) }, { HP_POP(intif->rodex_sendmail, HP_intif_rodex_sendmail) }, { HP_POP(intif->rodex_checkname, HP_intif_rodex_checkname) }, + { HP_POP(intif->clan_kickoffline, HP_intif_clan_kickoffline) }, + { HP_POP(intif->clan_membercount, HP_intif_clan_membercount) }, { HP_POP(intif->request_accinfo, HP_intif_request_accinfo) }, { HP_POP(intif->CheckForCharServer, HP_intif_CheckForCharServer) }, { HP_POP(intif->pWisMessage, HP_intif_pWisMessage) }, @@ -1392,6 +1428,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(intif->pRodexHasNew, HP_intif_pRodexHasNew) }, { HP_POP(intif->pRodexSendMail, HP_intif_pRodexSendMail) }, { HP_POP(intif->pRodexCheckName, HP_intif_pRodexCheckName) }, + { HP_POP(intif->pRecvClanMemberAction, HP_intif_pRecvClanMemberAction) }, /* irc_bot_interface */ { HP_POP(ircbot->init, HP_ircbot_init) }, { HP_POP(ircbot->final, HP_ircbot_final) }, @@ -1683,8 +1720,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(map->iwall_nextxy, HP_map_iwall_nextxy) }, { HP_POP(map->create_map_data_other_server, HP_map_create_map_data_other_server) }, { HP_POP(map->eraseallipport_sub, HP_map_eraseallipport_sub) }, - { HP_POP(map->init_mapcache, HP_map_init_mapcache) }, { HP_POP(map->readfromcache, HP_map_readfromcache) }, + { HP_POP(map->readfromcache_v1, HP_map_readfromcache_v1) }, { HP_POP(map->addmap, HP_map_addmap) }, { HP_POP(map->delmapid, HP_map_delmapid) }, { HP_POP(map->zone_db_clear, HP_map_zone_db_clear) }, @@ -2552,6 +2589,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(script->buildin_mobuseskill_sub, HP_script_buildin_mobuseskill_sub) }, { HP_POP(script->cleanfloor_sub, HP_script_cleanfloor_sub) }, { HP_POP(script->run_func, HP_script_run_func) }, + { HP_POP(script->sprintf, HP_script_sprintf) }, { HP_POP(script->getfuncname, HP_script_getfuncname) }, { HP_POP(script->calc_hash_ci, HP_script_calc_hash_ci) }, { HP_POP(script->array_src, HP_script_array_src) }, @@ -2789,7 +2827,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(skill->parse_row_abradb, HP_skill_parse_row_abradb) }, { HP_POP(skill->parse_row_spellbookdb, HP_skill_parse_row_spellbookdb) }, { HP_POP(skill->parse_row_magicmushroomdb, HP_skill_parse_row_magicmushroomdb) }, - { HP_POP(skill->parse_row_reproducedb, HP_skill_parse_row_reproducedb) }, { HP_POP(skill->parse_row_improvisedb, HP_skill_parse_row_improvisedb) }, { HP_POP(skill->parse_row_changematerialdb, HP_skill_parse_row_changematerialdb) }, { HP_POP(skill->usave_add, HP_skill_usave_add) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 4340f8dbd..2e20ab157 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2017 Hercules Dev Team + * Copyright (C) 2013-2018 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 @@ -6495,6 +6495,729 @@ void HP_chrif_del_scdata_single(int account_id, int char_id, short type) { } return; } +/* clan_interface */ +void HP_clan_init(bool minimal) { + int hIndex = 0; + if (HPMHooks.count.HP_clan_init_pre > 0) { + void (*preHookFunc) (bool *minimal); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_init_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_init_pre[hIndex].func; + preHookFunc(&minimal); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clan.init(minimal); + } + if (HPMHooks.count.HP_clan_init_post > 0) { + void (*postHookFunc) (bool minimal); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_init_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_init_post[hIndex].func; + postHookFunc(minimal); + } + } + return; +} +void HP_clan_final(void) { + int hIndex = 0; + if (HPMHooks.count.HP_clan_final_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_final_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_final_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clan.final(); + } + if (HPMHooks.count.HP_clan_final_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_final_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +bool HP_clan_config_read(bool reload) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_clan_config_read_pre > 0) { + bool (*preHookFunc) (bool *reload); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_config_read_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_config_read_pre[hIndex].func; + retVal___ = preHookFunc(&reload); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clan.config_read(reload); + } + if (HPMHooks.count.HP_clan_config_read_post > 0) { + bool (*postHookFunc) (bool retVal___, bool reload); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_config_read_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_config_read_post[hIndex].func; + retVal___ = postHookFunc(retVal___, reload); + } + } + return retVal___; +} +void HP_clan_config_read_additional_settings(struct config_setting_t *settings, const char *source) { + int hIndex = 0; + if (HPMHooks.count.HP_clan_config_read_additional_settings_pre > 0) { + void (*preHookFunc) (struct config_setting_t **settings, const char **source); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_config_read_additional_settings_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_config_read_additional_settings_pre[hIndex].func; + preHookFunc(&settings, &source); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clan.config_read_additional_settings(settings, source); + } + if (HPMHooks.count.HP_clan_config_read_additional_settings_post > 0) { + void (*postHookFunc) (struct config_setting_t *settings, const char *source); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_config_read_additional_settings_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_config_read_additional_settings_post[hIndex].func; + postHookFunc(settings, source); + } + } + return; +} +void HP_clan_read_db(struct config_setting_t *settings, const char *source, bool reload) { + int hIndex = 0; + if (HPMHooks.count.HP_clan_read_db_pre > 0) { + void (*preHookFunc) (struct config_setting_t **settings, const char **source, bool *reload); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_read_db_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_read_db_pre[hIndex].func; + preHookFunc(&settings, &source, &reload); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clan.read_db(settings, source, reload); + } + if (HPMHooks.count.HP_clan_read_db_post > 0) { + void (*postHookFunc) (struct config_setting_t *settings, const char *source, bool reload); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_read_db_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_read_db_post[hIndex].func; + postHookFunc(settings, source, reload); + } + } + return; +} +int HP_clan_read_db_sub(struct config_setting_t *settings, const char *source, bool reload) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_clan_read_db_sub_pre > 0) { + int (*preHookFunc) (struct config_setting_t **settings, const char **source, bool *reload); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_read_db_sub_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_read_db_sub_pre[hIndex].func; + retVal___ = preHookFunc(&settings, &source, &reload); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clan.read_db_sub(settings, source, reload); + } + if (HPMHooks.count.HP_clan_read_db_sub_post > 0) { + int (*postHookFunc) (int retVal___, struct config_setting_t *settings, const char *source, bool reload); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_read_db_sub_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_read_db_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, settings, source, reload); + } + } + return retVal___; +} +void HP_clan_read_db_additional_fields(struct clan *entry, struct config_setting_t *t, int n, const char *source) { + int hIndex = 0; + if (HPMHooks.count.HP_clan_read_db_additional_fields_pre > 0) { + void (*preHookFunc) (struct clan **entry, struct config_setting_t **t, int *n, const char **source); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_read_db_additional_fields_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_read_db_additional_fields_pre[hIndex].func; + preHookFunc(&entry, &t, &n, &source); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clan.read_db_additional_fields(entry, t, n, source); + } + if (HPMHooks.count.HP_clan_read_db_additional_fields_post > 0) { + void (*postHookFunc) (struct clan *entry, struct config_setting_t *t, int n, const char *source); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_read_db_additional_fields_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_read_db_additional_fields_post[hIndex].func; + postHookFunc(entry, t, n, source); + } + } + return; +} +void HP_clan_read_buffs(struct clan *c, struct config_setting_t *buff, const char *source) { + int hIndex = 0; + if (HPMHooks.count.HP_clan_read_buffs_pre > 0) { + void (*preHookFunc) (struct clan **c, struct config_setting_t **buff, const char **source); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_read_buffs_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_read_buffs_pre[hIndex].func; + preHookFunc(&c, &buff, &source); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clan.read_buffs(c, buff, source); + } + if (HPMHooks.count.HP_clan_read_buffs_post > 0) { + void (*postHookFunc) (struct clan *c, struct config_setting_t *buff, const char *source); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_read_buffs_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_read_buffs_post[hIndex].func; + postHookFunc(c, buff, source); + } + } + return; +} +struct clan* HP_clan_search(int clan_id) { + int hIndex = 0; + struct clan* retVal___ = NULL; + if (HPMHooks.count.HP_clan_search_pre > 0) { + struct clan* (*preHookFunc) (int *clan_id); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_search_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_search_pre[hIndex].func; + retVal___ = preHookFunc(&clan_id); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clan.search(clan_id); + } + if (HPMHooks.count.HP_clan_search_post > 0) { + struct clan* (*postHookFunc) (struct clan* retVal___, int clan_id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_search_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_search_post[hIndex].func; + retVal___ = postHookFunc(retVal___, clan_id); + } + } + return retVal___; +} +struct clan* HP_clan_searchname(const char *name) { + int hIndex = 0; + struct clan* retVal___ = NULL; + if (HPMHooks.count.HP_clan_searchname_pre > 0) { + struct clan* (*preHookFunc) (const char **name); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_searchname_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_searchname_pre[hIndex].func; + retVal___ = preHookFunc(&name); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clan.searchname(name); + } + if (HPMHooks.count.HP_clan_searchname_post > 0) { + struct clan* (*postHookFunc) (struct clan* retVal___, const char *name); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_searchname_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_searchname_post[hIndex].func; + retVal___ = postHookFunc(retVal___, name); + } + } + return retVal___; +} +struct map_session_data* HP_clan_getonlinesd(struct clan *c) { + int hIndex = 0; + struct map_session_data* retVal___ = NULL; + if (HPMHooks.count.HP_clan_getonlinesd_pre > 0) { + struct map_session_data* (*preHookFunc) (struct clan **c); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_getonlinesd_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_getonlinesd_pre[hIndex].func; + retVal___ = preHookFunc(&c); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clan.getonlinesd(c); + } + if (HPMHooks.count.HP_clan_getonlinesd_post > 0) { + struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct clan *c); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_getonlinesd_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_getonlinesd_post[hIndex].func; + retVal___ = postHookFunc(retVal___, c); + } + } + return retVal___; +} +int HP_clan_getindex(const struct clan *c, int char_id) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_clan_getindex_pre > 0) { + int (*preHookFunc) (const struct clan **c, int *char_id); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_getindex_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_getindex_pre[hIndex].func; + retVal___ = preHookFunc(&c, &char_id); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clan.getindex(c, char_id); + } + if (HPMHooks.count.HP_clan_getindex_post > 0) { + int (*postHookFunc) (int retVal___, const struct clan *c, int char_id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_getindex_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_getindex_post[hIndex].func; + retVal___ = postHookFunc(retVal___, c, char_id); + } + } + return retVal___; +} +bool HP_clan_join(struct map_session_data *sd, int clan_id) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_clan_join_pre > 0) { + bool (*preHookFunc) (struct map_session_data **sd, int *clan_id); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_join_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_join_pre[hIndex].func; + retVal___ = preHookFunc(&sd, &clan_id); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clan.join(sd, clan_id); + } + if (HPMHooks.count.HP_clan_join_post > 0) { + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int clan_id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_join_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_join_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, clan_id); + } + } + return retVal___; +} +void HP_clan_member_online(struct map_session_data *sd, bool first) { + int hIndex = 0; + if (HPMHooks.count.HP_clan_member_online_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, bool *first); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_member_online_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_member_online_pre[hIndex].func; + preHookFunc(&sd, &first); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clan.member_online(sd, first); + } + if (HPMHooks.count.HP_clan_member_online_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, bool first); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_member_online_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_member_online_post[hIndex].func; + postHookFunc(sd, first); + } + } + return; +} +bool HP_clan_leave(struct map_session_data *sd, bool first) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_clan_leave_pre > 0) { + bool (*preHookFunc) (struct map_session_data **sd, bool *first); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_leave_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_leave_pre[hIndex].func; + retVal___ = preHookFunc(&sd, &first); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clan.leave(sd, first); + } + if (HPMHooks.count.HP_clan_leave_post > 0) { + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, bool first); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_leave_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_leave_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, first); + } + } + return retVal___; +} +bool HP_clan_send_message(struct map_session_data *sd, const char *mes) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_clan_send_message_pre > 0) { + bool (*preHookFunc) (struct map_session_data **sd, const char **mes); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_send_message_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_send_message_pre[hIndex].func; + retVal___ = preHookFunc(&sd, &mes); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clan.send_message(sd, mes); + } + if (HPMHooks.count.HP_clan_send_message_post > 0) { + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const char *mes); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_send_message_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_send_message_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, mes); + } + } + return retVal___; +} +void HP_clan_recv_message(struct clan *c, const char *mes, int len) { + int hIndex = 0; + if (HPMHooks.count.HP_clan_recv_message_pre > 0) { + void (*preHookFunc) (struct clan **c, const char **mes, int *len); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_recv_message_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_recv_message_pre[hIndex].func; + preHookFunc(&c, &mes, &len); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clan.recv_message(c, mes, len); + } + if (HPMHooks.count.HP_clan_recv_message_post > 0) { + void (*postHookFunc) (struct clan *c, const char *mes, int len); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_recv_message_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_recv_message_post[hIndex].func; + postHookFunc(c, mes, len); + } + } + return; +} +void HP_clan_member_offline(struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clan_member_offline_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_member_offline_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_member_offline_pre[hIndex].func; + preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clan.member_offline(sd); + } + if (HPMHooks.count.HP_clan_member_offline_post > 0) { + void (*postHookFunc) (struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_member_offline_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_member_offline_post[hIndex].func; + postHookFunc(sd); + } + } + return; +} +void HP_clan_set_constants(void) { + int hIndex = 0; + if (HPMHooks.count.HP_clan_set_constants_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_set_constants_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_set_constants_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clan.set_constants(); + } + if (HPMHooks.count.HP_clan_set_constants_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_set_constants_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_set_constants_post[hIndex].func; + postHookFunc(); + } + } + return; +} +int HP_clan_get_id(const struct block_list *bl) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_clan_get_id_pre > 0) { + int (*preHookFunc) (const struct block_list **bl); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_get_id_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_get_id_pre[hIndex].func; + retVal___ = preHookFunc(&bl); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clan.get_id(bl); + } + if (HPMHooks.count.HP_clan_get_id_post > 0) { + int (*postHookFunc) (int retVal___, const struct block_list *bl); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_get_id_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_get_id_post[hIndex].func; + retVal___ = postHookFunc(retVal___, bl); + } + } + return retVal___; +} +void HP_clan_buff_start(struct map_session_data *sd, struct clan *c) { + int hIndex = 0; + if (HPMHooks.count.HP_clan_buff_start_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, struct clan **c); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_buff_start_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_buff_start_pre[hIndex].func; + preHookFunc(&sd, &c); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clan.buff_start(sd, c); + } + if (HPMHooks.count.HP_clan_buff_start_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, struct clan *c); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_buff_start_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_buff_start_post[hIndex].func; + postHookFunc(sd, c); + } + } + return; +} +void HP_clan_buff_end(struct map_session_data *sd, struct clan *c) { + int hIndex = 0; + if (HPMHooks.count.HP_clan_buff_end_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, struct clan **c); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_buff_end_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_buff_end_pre[hIndex].func; + preHookFunc(&sd, &c); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clan.buff_end(sd, c); + } + if (HPMHooks.count.HP_clan_buff_end_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, struct clan *c); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_buff_end_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_buff_end_post[hIndex].func; + postHookFunc(sd, c); + } + } + return; +} +void HP_clan_reload(void) { + int hIndex = 0; + if (HPMHooks.count.HP_clan_reload_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_reload_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_reload_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clan.reload(); + } + if (HPMHooks.count.HP_clan_reload_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_reload_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_reload_post[hIndex].func; + postHookFunc(); + } + } + return; +} +int HP_clan_rejoin(struct map_session_data *sd, va_list ap) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_clan_rejoin_pre > 0) { + int (*preHookFunc) (struct map_session_data **sd, va_list ap); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_rejoin_pre; hIndex++) { + va_list ap___copy; va_copy(ap___copy, ap); + preHookFunc = HPMHooks.list.HP_clan_rejoin_pre[hIndex].func; + retVal___ = preHookFunc(&sd, 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.clan.rejoin(sd, ap___copy); + va_end(ap___copy); + } + if (HPMHooks.count.HP_clan_rejoin_post > 0) { + int (*postHookFunc) (int retVal___, struct map_session_data *sd, va_list ap); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_rejoin_post; hIndex++) { + va_list ap___copy; va_copy(ap___copy, ap); + postHookFunc = HPMHooks.list.HP_clan_rejoin_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, ap___copy); + va_end(ap___copy); + } + } + return retVal___; +} +int HP_clan_inactivity_kick(int tid, int64 tick, int id, intptr_t data) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_clan_inactivity_kick_pre > 0) { + int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_inactivity_kick_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_inactivity_kick_pre[hIndex].func; + retVal___ = preHookFunc(&tid, &tick, &id, &data); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clan.inactivity_kick(tid, tick, id, data); + } + if (HPMHooks.count.HP_clan_inactivity_kick_post > 0) { + int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_inactivity_kick_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_inactivity_kick_post[hIndex].func; + retVal___ = postHookFunc(retVal___, tid, tick, id, data); + } + } + return retVal___; +} +int HP_clan_request_kickoffline(int tid, int64 tick, int id, intptr_t data) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_clan_request_kickoffline_pre > 0) { + int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_request_kickoffline_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_request_kickoffline_pre[hIndex].func; + retVal___ = preHookFunc(&tid, &tick, &id, &data); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clan.request_kickoffline(tid, tick, id, data); + } + if (HPMHooks.count.HP_clan_request_kickoffline_post > 0) { + int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_request_kickoffline_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_request_kickoffline_post[hIndex].func; + retVal___ = postHookFunc(retVal___, tid, tick, id, data); + } + } + return retVal___; +} +int HP_clan_request_membercount(int tid, int64 tick, int id, intptr_t data) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_clan_request_membercount_pre > 0) { + int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_request_membercount_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clan_request_membercount_pre[hIndex].func; + retVal___ = preHookFunc(&tid, &tick, &id, &data); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clan.request_membercount(tid, tick, id, data); + } + if (HPMHooks.count.HP_clan_request_membercount_post > 0) { + int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_request_membercount_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clan_request_membercount_post[hIndex].func; + retVal___ = postHookFunc(retVal___, tid, tick, id, data); + } + } + return retVal___; +} /* clif_interface */ int HP_clif_init(bool minimal) { int hIndex = 0; @@ -10706,6 +11429,32 @@ void HP_clif_progressbar_abort(struct map_session_data *sd) { } return; } +void HP_clif_progressbar_unit(struct block_list *bl, uint32 color, uint32 time) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_progressbar_unit_pre > 0) { + void (*preHookFunc) (struct block_list **bl, uint32 *color, uint32 *time); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_progressbar_unit_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_progressbar_unit_pre[hIndex].func; + preHookFunc(&bl, &color, &time); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.progressbar_unit(bl, color, time); + } + if (HPMHooks.count.HP_clif_progressbar_unit_post > 0) { + void (*postHookFunc) (struct block_list *bl, uint32 color, uint32 time); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_progressbar_unit_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_progressbar_unit_post[hIndex].func; + postHookFunc(bl, color, time); + } + } + return; +} void HP_clif_showdigit(struct map_session_data *sd, unsigned char type, int value) { int hIndex = 0; if (HPMHooks.count.HP_clif_showdigit_pre > 0) { @@ -24671,14 +25420,14 @@ void HP_clif_rodex_send_refresh(int fd, struct map_session_data *sd, int8 open_t } return; } -void HP_clif_rodex_send_mails_all(int fd, struct map_session_data *sd) { +void HP_clif_rodex_send_mails_all(int fd, struct map_session_data *sd, int64 mail_id) { int hIndex = 0; if (HPMHooks.count.HP_clif_rodex_send_mails_all_pre > 0) { - void (*preHookFunc) (int *fd, struct map_session_data **sd); + void (*preHookFunc) (int *fd, struct map_session_data **sd, int64 *mail_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_rodex_send_mails_all_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_rodex_send_mails_all_pre[hIndex].func; - preHookFunc(&fd, &sd); + preHookFunc(&fd, &sd, &mail_id); } if (*HPMforce_return) { *HPMforce_return = false; @@ -24686,13 +25435,13 @@ void HP_clif_rodex_send_mails_all(int fd, struct map_session_data *sd) { } } { - HPMHooks.source.clif.rodex_send_mails_all(fd, sd); + HPMHooks.source.clif.rodex_send_mails_all(fd, sd, mail_id); } if (HPMHooks.count.HP_clif_rodex_send_mails_all_post > 0) { - void (*postHookFunc) (int fd, struct map_session_data *sd); + void (*postHookFunc) (int fd, struct map_session_data *sd, int64 mail_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_rodex_send_mails_all_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_rodex_send_mails_all_post[hIndex].func; - postHookFunc(fd, sd); + postHookFunc(fd, sd, mail_id); } } return; @@ -25139,6 +25888,136 @@ void HP_clif_skill_scale(struct block_list *bl, int src_id, int x, int y, uint16 } return; } +void HP_clif_clan_basicinfo(struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_clan_basicinfo_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clan_basicinfo_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_clan_basicinfo_pre[hIndex].func; + preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.clan_basicinfo(sd); + } + if (HPMHooks.count.HP_clif_clan_basicinfo_post > 0) { + void (*postHookFunc) (struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clan_basicinfo_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_clan_basicinfo_post[hIndex].func; + postHookFunc(sd); + } + } + return; +} +void HP_clif_clan_onlinecount(struct clan *c) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_clan_onlinecount_pre > 0) { + void (*preHookFunc) (struct clan **c); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clan_onlinecount_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_clan_onlinecount_pre[hIndex].func; + preHookFunc(&c); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.clan_onlinecount(c); + } + if (HPMHooks.count.HP_clif_clan_onlinecount_post > 0) { + void (*postHookFunc) (struct clan *c); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clan_onlinecount_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_clan_onlinecount_post[hIndex].func; + postHookFunc(c); + } + } + return; +} +void HP_clif_clan_leave(struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_clan_leave_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clan_leave_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_clan_leave_pre[hIndex].func; + preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.clan_leave(sd); + } + if (HPMHooks.count.HP_clif_clan_leave_post > 0) { + void (*postHookFunc) (struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clan_leave_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_clan_leave_post[hIndex].func; + postHookFunc(sd); + } + } + return; +} +void HP_clif_clan_message(struct clan *c, const char *mes, int len) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_clan_message_pre > 0) { + void (*preHookFunc) (struct clan **c, const char **mes, int *len); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clan_message_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_clan_message_pre[hIndex].func; + preHookFunc(&c, &mes, &len); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.clan_message(c, mes, len); + } + if (HPMHooks.count.HP_clif_clan_message_post > 0) { + void (*postHookFunc) (struct clan *c, const char *mes, int len); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clan_message_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_clan_message_post[hIndex].func; + postHookFunc(c, mes, len); + } + } + return; +} +void HP_clif_pClanMessage(int fd, struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_pClanMessage_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pClanMessage_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pClanMessage_pre[hIndex].func; + preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.pClanMessage(fd, sd); + } + if (HPMHooks.count.HP_clif_pClanMessage_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pClanMessage_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pClanMessage_post[hIndex].func; + postHookFunc(fd, sd); + } + } + return; +} /* cmdline_interface */ void HP_cmdline_init(void) { int hIndex = 0; @@ -33828,6 +34707,60 @@ int HP_intif_rodex_checkname(struct map_session_data *sd, const char *name) { } return retVal___; } +int HP_intif_clan_kickoffline(int clan_id, int kick_interval) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_intif_clan_kickoffline_pre > 0) { + int (*preHookFunc) (int *clan_id, int *kick_interval); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_clan_kickoffline_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_intif_clan_kickoffline_pre[hIndex].func; + retVal___ = preHookFunc(&clan_id, &kick_interval); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.intif.clan_kickoffline(clan_id, kick_interval); + } + if (HPMHooks.count.HP_intif_clan_kickoffline_post > 0) { + int (*postHookFunc) (int retVal___, int clan_id, int kick_interval); + for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_clan_kickoffline_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_intif_clan_kickoffline_post[hIndex].func; + retVal___ = postHookFunc(retVal___, clan_id, kick_interval); + } + } + return retVal___; +} +int HP_intif_clan_membercount(int clan_id, int kick_interval) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_intif_clan_membercount_pre > 0) { + int (*preHookFunc) (int *clan_id, int *kick_interval); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_clan_membercount_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_intif_clan_membercount_pre[hIndex].func; + retVal___ = preHookFunc(&clan_id, &kick_interval); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.intif.clan_membercount(clan_id, kick_interval); + } + if (HPMHooks.count.HP_intif_clan_membercount_post > 0) { + int (*postHookFunc) (int retVal___, int clan_id, int kick_interval); + for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_clan_membercount_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_intif_clan_membercount_post[hIndex].func; + retVal___ = postHookFunc(retVal___, clan_id, kick_interval); + } + } + return retVal___; +} void HP_intif_request_accinfo(int u_fd, int aid, int group_lv, char *query) { int hIndex = 0; if (HPMHooks.count.HP_intif_request_accinfo_pre > 0) { @@ -35656,6 +36589,32 @@ void HP_intif_pRodexCheckName(int fd) { } return; } +void HP_intif_pRecvClanMemberAction(int fd) { + int hIndex = 0; + if (HPMHooks.count.HP_intif_pRecvClanMemberAction_pre > 0) { + void (*preHookFunc) (int *fd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pRecvClanMemberAction_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_intif_pRecvClanMemberAction_pre[hIndex].func; + preHookFunc(&fd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.intif.pRecvClanMemberAction(fd); + } + if (HPMHooks.count.HP_intif_pRecvClanMemberAction_post > 0) { + void (*postHookFunc) (int fd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pRecvClanMemberAction_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_intif_pRecvClanMemberAction_post[hIndex].func; + postHookFunc(fd); + } + } + return; +} /* irc_bot_interface */ void HP_ircbot_init(bool minimal) { int hIndex = 0; @@ -41256,15 +42215,15 @@ void HP_map_clearflooritem(struct block_list *bl) { } return; } -int HP_map_addflooritem(const struct block_list *bl, struct item *item_data, int amount, int16 m, int16 x, int16 y, int first_charid, int second_charid, int third_charid, int flags) { +int HP_map_addflooritem(const struct block_list *bl, struct item *item_data, int amount, int16 m, int16 x, int16 y, int first_charid, int second_charid, int third_charid, int flags, bool showdropeffect) { int hIndex = 0; int retVal___ = 0; if (HPMHooks.count.HP_map_addflooritem_pre > 0) { - int (*preHookFunc) (const struct block_list **bl, struct item **item_data, int *amount, int16 *m, int16 *x, int16 *y, int *first_charid, int *second_charid, int *third_charid, int *flags); + int (*preHookFunc) (const struct block_list **bl, struct item **item_data, int *amount, int16 *m, int16 *x, int16 *y, int *first_charid, int *second_charid, int *third_charid, int *flags, bool *showdropeffect); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_addflooritem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_addflooritem_pre[hIndex].func; - retVal___ = preHookFunc(&bl, &item_data, &amount, &m, &x, &y, &first_charid, &second_charid, &third_charid, &flags); + retVal___ = preHookFunc(&bl, &item_data, &amount, &m, &x, &y, &first_charid, &second_charid, &third_charid, &flags, &showdropeffect); } if (*HPMforce_return) { *HPMforce_return = false; @@ -41272,13 +42231,13 @@ int HP_map_addflooritem(const struct block_list *bl, struct item *item_data, int } } { - retVal___ = HPMHooks.source.map.addflooritem(bl, item_data, amount, m, x, y, first_charid, second_charid, third_charid, flags); + retVal___ = HPMHooks.source.map.addflooritem(bl, item_data, amount, m, x, y, first_charid, second_charid, third_charid, flags, showdropeffect); } if (HPMHooks.count.HP_map_addflooritem_post > 0) { - int (*postHookFunc) (int retVal___, const struct block_list *bl, struct item *item_data, int amount, int16 m, int16 x, int16 y, int first_charid, int second_charid, int third_charid, int flags); + int (*postHookFunc) (int retVal___, const struct block_list *bl, struct item *item_data, int amount, int16 m, int16 x, int16 y, int first_charid, int second_charid, int third_charid, int flags, bool showdropeffect); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_addflooritem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_addflooritem_post[hIndex].func; - retVal___ = postHookFunc(retVal___, bl, item_data, amount, m, x, y, first_charid, second_charid, third_charid, flags); + retVal___ = postHookFunc(retVal___, bl, item_data, amount, m, x, y, first_charid, second_charid, third_charid, flags, showdropeffect); } } return retVal___; @@ -43411,15 +44370,15 @@ int HP_map_eraseallipport_sub(union DBKey key, struct DBData *data, va_list va) } return retVal___; } -char* HP_map_init_mapcache(FILE *fp) { +bool HP_map_readfromcache(struct map_data *m) { int hIndex = 0; - char* retVal___ = NULL; - if (HPMHooks.count.HP_map_init_mapcache_pre > 0) { - char* (*preHookFunc) (FILE **fp); + bool retVal___ = false; + if (HPMHooks.count.HP_map_readfromcache_pre > 0) { + bool (*preHookFunc) (struct map_data **m); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_map_init_mapcache_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_map_init_mapcache_pre[hIndex].func; - retVal___ = preHookFunc(&fp); + for (hIndex = 0; hIndex < HPMHooks.count.HP_map_readfromcache_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_map_readfromcache_pre[hIndex].func; + retVal___ = preHookFunc(&m); } if (*HPMforce_return) { *HPMforce_return = false; @@ -43427,26 +44386,26 @@ char* HP_map_init_mapcache(FILE *fp) { } } { - retVal___ = HPMHooks.source.map.init_mapcache(fp); + retVal___ = HPMHooks.source.map.readfromcache(m); } - if (HPMHooks.count.HP_map_init_mapcache_post > 0) { - char* (*postHookFunc) (char* retVal___, FILE *fp); - for (hIndex = 0; hIndex < HPMHooks.count.HP_map_init_mapcache_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_map_init_mapcache_post[hIndex].func; - retVal___ = postHookFunc(retVal___, fp); + if (HPMHooks.count.HP_map_readfromcache_post > 0) { + bool (*postHookFunc) (bool retVal___, struct map_data *m); + for (hIndex = 0; hIndex < HPMHooks.count.HP_map_readfromcache_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_map_readfromcache_post[hIndex].func; + retVal___ = postHookFunc(retVal___, m); } } return retVal___; } -int HP_map_readfromcache(struct map_data *m, char *buffer) { +bool HP_map_readfromcache_v1(FILE *fp, struct map_data *m, unsigned int file_size) { int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_map_readfromcache_pre > 0) { - int (*preHookFunc) (struct map_data **m, char **buffer); + bool retVal___ = false; + if (HPMHooks.count.HP_map_readfromcache_v1_pre > 0) { + bool (*preHookFunc) (FILE **fp, struct map_data **m, unsigned int *file_size); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_map_readfromcache_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_map_readfromcache_pre[hIndex].func; - retVal___ = preHookFunc(&m, &buffer); + for (hIndex = 0; hIndex < HPMHooks.count.HP_map_readfromcache_v1_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_map_readfromcache_v1_pre[hIndex].func; + retVal___ = preHookFunc(&fp, &m, &file_size); } if (*HPMforce_return) { *HPMforce_return = false; @@ -43454,13 +44413,13 @@ int HP_map_readfromcache(struct map_data *m, char *buffer) { } } { - retVal___ = HPMHooks.source.map.readfromcache(m, buffer); + retVal___ = HPMHooks.source.map.readfromcache_v1(fp, m, file_size); } - if (HPMHooks.count.HP_map_readfromcache_post > 0) { - int (*postHookFunc) (int retVal___, struct map_data *m, char *buffer); - for (hIndex = 0; hIndex < HPMHooks.count.HP_map_readfromcache_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_map_readfromcache_post[hIndex].func; - retVal___ = postHookFunc(retVal___, m, buffer); + if (HPMHooks.count.HP_map_readfromcache_v1_post > 0) { + bool (*postHookFunc) (bool retVal___, FILE *fp, struct map_data *m, unsigned int file_size); + for (hIndex = 0; hIndex < HPMHooks.count.HP_map_readfromcache_v1_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_map_readfromcache_v1_post[hIndex].func; + retVal___ = postHookFunc(retVal___, fp, m, file_size); } } return retVal___; @@ -66521,6 +67480,33 @@ int HP_script_run_func(struct script_state *st) { } return retVal___; } +bool HP_script_sprintf(struct script_state *st, int start, struct StringBuf *out) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_script_sprintf_pre > 0) { + bool (*preHookFunc) (struct script_state **st, int *start, struct StringBuf **out); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_script_sprintf_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_script_sprintf_pre[hIndex].func; + retVal___ = preHookFunc(&st, &start, &out); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.script.sprintf(st, start, out); + } + if (HPMHooks.count.HP_script_sprintf_post > 0) { + bool (*postHookFunc) (bool retVal___, struct script_state *st, int start, struct StringBuf *out); + for (hIndex = 0; hIndex < HPMHooks.count.HP_script_sprintf_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_script_sprintf_post[hIndex].func; + retVal___ = postHookFunc(retVal___, st, start, out); + } + } + return retVal___; +} const char* HP_script_getfuncname(struct script_state *st) { int hIndex = 0; const char* retVal___ = NULL; @@ -72951,33 +73937,6 @@ bool HP_skill_parse_row_magicmushroomdb(char *split[], int column, int current) } return retVal___; } -bool HP_skill_parse_row_reproducedb(char *split[], int column, int current) { - int hIndex = 0; - bool retVal___ = false; - if (HPMHooks.count.HP_skill_parse_row_reproducedb_pre > 0) { - bool (*preHookFunc) (char **split[], int *column, int *current); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_reproducedb_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_skill_parse_row_reproducedb_pre[hIndex].func; - retVal___ = preHookFunc(&split, &column, ¤t); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.skill.parse_row_reproducedb(split, column, current); - } - if (HPMHooks.count.HP_skill_parse_row_reproducedb_post > 0) { - bool (*postHookFunc) (bool retVal___, char *split[], int column, int current); - for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_reproducedb_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_skill_parse_row_reproducedb_post[hIndex].func; - retVal___ = postHookFunc(retVal___, split, column, current); - } - } - return retVal___; -} bool HP_skill_parse_row_improvisedb(char *split[], int columns, int current) { int hIndex = 0; bool retVal___ = false; diff --git a/src/plugins/HPMHooking/HPMHooking_map.sources.inc b/src/plugins/HPMHooking/HPMHooking_map.sources.inc index ada63e53d..e6f305726 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.sources.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.sources.inc @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2017 Hercules Dev Team + * Copyright (C) 2013-2018 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 @@ -33,6 +33,7 @@ HPMHooks.source.buyingstore = *buyingstore; HPMHooks.source.channel = *channel; HPMHooks.source.chat = *chat; HPMHooks.source.chrif = *chrif; +HPMHooks.source.clan = *clan; HPMHooks.source.clif = *clif; HPMHooks.source.cmdline = *cmdline; HPMHooks.source.console = *console; |