Skip to content
Permalink
Browse files

Update HPM Hooks

  • Loading branch information...
guilherme-gm committed Oct 4, 2019
1 parent 875418a commit be955e59bcd950d6430189a8a23a608927665c02
@@ -4178,6 +4178,10 @@ typedef enum parsefunc_rcode (*HPMHOOK_pre_PRIV__lclif_parse_CA_CHARSERVERCONNEC
typedef enum parsefunc_rcode (*HPMHOOK_post_PRIV__lclif_parse_CA_CHARSERVERCONNECT) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
#endif // LOGIN_LCLIF_P_H
#ifdef COMMON_CONF_H /* libconfig */
typedef void (*HPMHOOK_pre_libconfig_set_db_path) (const char **db_path);
typedef void (*HPMHOOK_post_libconfig_set_db_path) (const char *db_path);
typedef void (*HPMHOOK_pre_libconfig_format_db_path) (const char **filename, char **path_buf, int *buffer_len);
typedef void (*HPMHOOK_post_libconfig_format_db_path) (const char *filename, char *path_buf, int buffer_len);
typedef int (*HPMHOOK_pre_libconfig_read) (struct config_t **config, FILE **stream);
typedef int (*HPMHOOK_post_libconfig_read) (int retVal___, struct config_t *config, FILE *stream);
typedef void (*HPMHOOK_pre_libconfig_write) (const struct config_t **config, FILE **stream);
@@ -5144,6 +5148,10 @@ typedef int (*HPMHOOK_pre_mapif_parse_ClanMemberCount) (int *fd, int *clan_id, i
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 bool (*HPMHOOK_pre_mapindex_config_read_dbpath) (const char **filename, const struct config_t **config);
typedef bool (*HPMHOOK_post_mapindex_config_read_dbpath) (bool retVal___, const char *filename, const struct config_t *config);
typedef bool (*HPMHOOK_pre_mapindex_config_read) (void);
typedef bool (*HPMHOOK_post_mapindex_config_read) (bool retVal___);
typedef int (*HPMHOOK_pre_mapindex_init) (void);
typedef int (*HPMHOOK_post_mapindex_init) (int retVal___);
typedef void (*HPMHOOK_pre_mapindex_final) (void);
@@ -778,6 +778,10 @@ struct {
struct HPMHookPoint *HP_inter_storage_parse_frommap_post;
struct HPMHookPoint *HP_inter_storage_retrieve_bound_items_pre;
struct HPMHookPoint *HP_inter_storage_retrieve_bound_items_post;
struct HPMHookPoint *HP_libconfig_set_db_path_pre;
struct HPMHookPoint *HP_libconfig_set_db_path_post;
struct HPMHookPoint *HP_libconfig_format_db_path_pre;
struct HPMHookPoint *HP_libconfig_format_db_path_post;
struct HPMHookPoint *HP_libconfig_read_pre;
struct HPMHookPoint *HP_libconfig_read_post;
struct HPMHookPoint *HP_libconfig_write_pre;
@@ -1252,6 +1256,10 @@ struct {
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_config_read_dbpath_pre;
struct HPMHookPoint *HP_mapindex_config_read_dbpath_post;
struct HPMHookPoint *HP_mapindex_config_read_pre;
struct HPMHookPoint *HP_mapindex_config_read_post;
struct HPMHookPoint *HP_mapindex_init_pre;
struct HPMHookPoint *HP_mapindex_init_post;
struct HPMHookPoint *HP_mapindex_final_pre;
@@ -2391,6 +2399,10 @@ struct {
int HP_inter_storage_parse_frommap_post;
int HP_inter_storage_retrieve_bound_items_pre;
int HP_inter_storage_retrieve_bound_items_post;
int HP_libconfig_set_db_path_pre;
int HP_libconfig_set_db_path_post;
int HP_libconfig_format_db_path_pre;
int HP_libconfig_format_db_path_post;
int HP_libconfig_read_pre;
int HP_libconfig_read_post;
int HP_libconfig_write_pre;
@@ -2865,6 +2877,10 @@ struct {
int HP_mapif_parse_ClanMemberKick_post;
int HP_mapif_parse_ClanMemberCount_pre;
int HP_mapif_parse_ClanMemberCount_post;
int HP_mapindex_config_read_dbpath_pre;
int HP_mapindex_config_read_dbpath_post;
int HP_mapindex_config_read_pre;
int HP_mapindex_config_read_post;
int HP_mapindex_init_pre;
int HP_mapindex_init_post;
int HP_mapindex_final_pre;
@@ -425,6 +425,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(inter_storage->parse_frommap, HP_inter_storage_parse_frommap) },
{ HP_POP(inter_storage->retrieve_bound_items, HP_inter_storage_retrieve_bound_items) },
/* libconfig_interface */
{ HP_POP(libconfig->set_db_path, HP_libconfig_set_db_path) },
{ HP_POP(libconfig->format_db_path, HP_libconfig_format_db_path) },
{ HP_POP(libconfig->read, HP_libconfig_read) },
{ HP_POP(libconfig->write, HP_libconfig_write) },
{ HP_POP(libconfig->set_options, HP_libconfig_set_options) },
@@ -665,6 +667,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mapif->parse_ClanMemberKick, HP_mapif_parse_ClanMemberKick) },
{ HP_POP(mapif->parse_ClanMemberCount, HP_mapif_parse_ClanMemberCount) },
/* mapindex_interface */
{ HP_POP(mapindex->config_read_dbpath, HP_mapindex_config_read_dbpath) },
{ HP_POP(mapindex->config_read, HP_mapindex_config_read) },
{ HP_POP(mapindex->init, HP_mapindex_init) },
{ HP_POP(mapindex->final, HP_mapindex_final) },
{ HP_POP(mapindex->addmap, HP_mapindex_addmap) },
@@ -10116,6 +10116,58 @@ bool HP_inter_storage_retrieve_bound_items(int char_id, int account_id, int guil
return retVal___;
}
/* libconfig_interface */
void HP_libconfig_set_db_path(const char *db_path) {
int hIndex = 0;
if (HPMHooks.count.HP_libconfig_set_db_path_pre > 0) {
void (*preHookFunc) (const char **db_path);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_db_path_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_set_db_path_pre[hIndex].func;
preHookFunc(&db_path);
}
if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
HPMHooks.source.libconfig.set_db_path(db_path);
}
if (HPMHooks.count.HP_libconfig_set_db_path_post > 0) {
void (*postHookFunc) (const char *db_path);
for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_db_path_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_set_db_path_post[hIndex].func;
postHookFunc(db_path);
}
}
return;
}
void HP_libconfig_format_db_path(const char *filename, char *path_buf, int buffer_len) {
int hIndex = 0;
if (HPMHooks.count.HP_libconfig_format_db_path_pre > 0) {
void (*preHookFunc) (const char **filename, char **path_buf, int *buffer_len);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_format_db_path_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_format_db_path_pre[hIndex].func;
preHookFunc(&filename, &path_buf, &buffer_len);
}
if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
HPMHooks.source.libconfig.format_db_path(filename, path_buf, buffer_len);
}
if (HPMHooks.count.HP_libconfig_format_db_path_post > 0) {
void (*postHookFunc) (const char *filename, char *path_buf, int buffer_len);
for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_format_db_path_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_format_db_path_post[hIndex].func;
postHookFunc(filename, path_buf, buffer_len);
}
}
return;
}
int HP_libconfig_read(struct config_t *config, FILE *stream) {
int hIndex = 0;
int retVal___ = 0;
return retVal___;
}
/* mapindex_interface */
bool HP_mapindex_config_read_dbpath(const char *filename, const struct config_t *config) {
int hIndex = 0;
bool retVal___ = false;
if (HPMHooks.count.HP_mapindex_config_read_dbpath_pre > 0) {
bool (*preHookFunc) (const char **filename, const struct config_t **config);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_config_read_dbpath_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapindex_config_read_dbpath_pre[hIndex].func;
retVal___ = preHookFunc(&filename, &config);
}
if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
retVal___ = HPMHooks.source.mapindex.config_read_dbpath(filename, config);
}
if (HPMHooks.count.HP_mapindex_config_read_dbpath_post > 0) {
bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config);
for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_config_read_dbpath_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapindex_config_read_dbpath_post[hIndex].func;
retVal___ = postHookFunc(retVal___, filename, config);
}
}
return retVal___;
}
bool HP_mapindex_config_read(void) {
int hIndex = 0;
bool retVal___ = false;
if (HPMHooks.count.HP_mapindex_config_read_pre > 0) {
bool (*preHookFunc) (void);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_config_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapindex_config_read_pre[hIndex].func;
retVal___ = preHookFunc();
}
if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
retVal___ = HPMHooks.source.mapindex.config_read();
}
if (HPMHooks.count.HP_mapindex_config_read_post > 0) {
bool (*postHookFunc) (bool retVal___);
for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_config_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapindex_config_read_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
}
return retVal___;
}
int HP_mapindex_init(void) {
int hIndex = 0;
int retVal___ = 0;
@@ -212,6 +212,10 @@ struct {
struct HPMHookPoint *HP_PRIV__lclif_parse_CA_REQ_HASH_post;
struct HPMHookPoint *HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT_pre;
struct HPMHookPoint *HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT_post;
struct HPMHookPoint *HP_libconfig_set_db_path_pre;
struct HPMHookPoint *HP_libconfig_set_db_path_post;
struct HPMHookPoint *HP_libconfig_format_db_path_pre;
struct HPMHookPoint *HP_libconfig_format_db_path_post;
struct HPMHookPoint *HP_libconfig_read_pre;
struct HPMHookPoint *HP_libconfig_read_post;
struct HPMHookPoint *HP_libconfig_write_pre;
@@ -1013,6 +1017,10 @@ struct {
int HP_PRIV__lclif_parse_CA_REQ_HASH_post;
int HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT_pre;
int HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT_post;
int HP_libconfig_set_db_path_pre;
int HP_libconfig_set_db_path_post;
int HP_libconfig_format_db_path_pre;
int HP_libconfig_format_db_path_post;
int HP_libconfig_read_pre;
int HP_libconfig_read_post;
int HP_libconfig_write_pre;
@@ -131,6 +131,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(lclif->p->parse_CA_REQ_HASH, HP_PRIV__lclif_parse_CA_REQ_HASH) },
{ HP_POP(lclif->p->parse_CA_CHARSERVERCONNECT, HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT) },
/* libconfig_interface */
{ HP_POP(libconfig->set_db_path, HP_libconfig_set_db_path) },
{ HP_POP(libconfig->format_db_path, HP_libconfig_format_db_path) },
{ HP_POP(libconfig->read, HP_libconfig_read) },
{ HP_POP(libconfig->write, HP_libconfig_write) },
{ HP_POP(libconfig->set_options, HP_libconfig_set_options) },
@@ -2518,6 +2518,58 @@ enum parsefunc_rcode HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT(int fd, struct lo
return retVal___;
}
/* libconfig_interface */
void HP_libconfig_set_db_path(const char *db_path) {
int hIndex = 0;
if (HPMHooks.count.HP_libconfig_set_db_path_pre > 0) {
void (*preHookFunc) (const char **db_path);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_db_path_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_set_db_path_pre[hIndex].func;
preHookFunc(&db_path);
}
if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
HPMHooks.source.libconfig.set_db_path(db_path);
}
if (HPMHooks.count.HP_libconfig_set_db_path_post > 0) {
void (*postHookFunc) (const char *db_path);
for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_db_path_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_set_db_path_post[hIndex].func;
postHookFunc(db_path);
}
}
return;
}
void HP_libconfig_format_db_path(const char *filename, char *path_buf, int buffer_len) {
int hIndex = 0;
if (HPMHooks.count.HP_libconfig_format_db_path_pre > 0) {
void (*preHookFunc) (const char **filename, char **path_buf, int *buffer_len);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_format_db_path_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_format_db_path_pre[hIndex].func;
preHookFunc(&filename, &path_buf, &buffer_len);
}
if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
HPMHooks.source.libconfig.format_db_path(filename, path_buf, buffer_len);
}
if (HPMHooks.count.HP_libconfig_format_db_path_post > 0) {
void (*postHookFunc) (const char *filename, char *path_buf, int buffer_len);
for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_format_db_path_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_format_db_path_post[hIndex].func;
postHookFunc(filename, path_buf, buffer_len);
}
}
return;
}
int HP_libconfig_read(struct config_t *config, FILE *stream) {
int hIndex = 0;
int retVal___ = 0;
@@ -3286,6 +3286,10 @@ struct {
struct HPMHookPoint *HP_itemdb_read_libconfig_lapineddukddak_sub_post;
struct HPMHookPoint *HP_itemdb_read_libconfig_lapineddukddak_sub_sources_pre;
struct HPMHookPoint *HP_itemdb_read_libconfig_lapineddukddak_sub_sources_post;
struct HPMHookPoint *HP_libconfig_set_db_path_pre;
struct HPMHookPoint *HP_libconfig_set_db_path_post;
struct HPMHookPoint *HP_libconfig_format_db_path_pre;
struct HPMHookPoint *HP_libconfig_format_db_path_post;
struct HPMHookPoint *HP_libconfig_read_pre;
struct HPMHookPoint *HP_libconfig_read_post;
struct HPMHookPoint *HP_libconfig_write_pre;
@@ -3756,6 +3760,10 @@ struct {
struct HPMHookPoint *HP_map_merge_zone_post;
struct HPMHookPoint *HP_map_zone_clear_single_pre;
struct HPMHookPoint *HP_map_zone_clear_single_post;
struct HPMHookPoint *HP_mapindex_config_read_dbpath_pre;
struct HPMHookPoint *HP_mapindex_config_read_dbpath_post;
struct HPMHookPoint *HP_mapindex_config_read_pre;
struct HPMHookPoint *HP_mapindex_config_read_post;
struct HPMHookPoint *HP_mapindex_init_pre;
struct HPMHookPoint *HP_mapindex_init_post;
struct HPMHookPoint *HP_mapindex_final_pre;
@@ -10099,6 +10107,10 @@ struct {
int HP_itemdb_read_libconfig_lapineddukddak_sub_post;
int HP_itemdb_read_libconfig_lapineddukddak_sub_sources_pre;
int HP_itemdb_read_libconfig_lapineddukddak_sub_sources_post;
int HP_libconfig_set_db_path_pre;
int HP_libconfig_set_db_path_post;
int HP_libconfig_format_db_path_pre;
int HP_libconfig_format_db_path_post;
int HP_libconfig_read_pre;
int HP_libconfig_read_post;
int HP_libconfig_write_pre;
@@ -10569,6 +10581,10 @@ struct {
int HP_map_merge_zone_post;
int HP_map_zone_clear_single_pre;
int HP_map_zone_clear_single_post;
int HP_mapindex_config_read_dbpath_pre;
int HP_mapindex_config_read_dbpath_post;
int HP_mapindex_config_read_pre;
int HP_mapindex_config_read_post;
int HP_mapindex_init_pre;
int HP_mapindex_init_post;
int HP_mapindex_final_pre;
@@ -1683,6 +1683,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(itemdb->read_libconfig_lapineddukddak_sub, HP_itemdb_read_libconfig_lapineddukddak_sub) },
{ HP_POP(itemdb->read_libconfig_lapineddukddak_sub_sources, HP_itemdb_read_libconfig_lapineddukddak_sub_sources) },
/* libconfig_interface */
{ HP_POP(libconfig->set_db_path, HP_libconfig_set_db_path) },
{ HP_POP(libconfig->format_db_path, HP_libconfig_format_db_path) },
{ HP_POP(libconfig->read, HP_libconfig_read) },
{ HP_POP(libconfig->write, HP_libconfig_write) },
{ HP_POP(libconfig->set_options, HP_libconfig_set_options) },
@@ -1922,6 +1924,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(map->merge_zone, HP_map_merge_zone) },
{ HP_POP(map->zone_clear_single, HP_map_zone_clear_single) },
/* mapindex_interface */
{ HP_POP(mapindex->config_read_dbpath, HP_mapindex_config_read_dbpath) },
{ HP_POP(mapindex->config_read, HP_mapindex_config_read) },
{ HP_POP(mapindex->init, HP_mapindex_init) },
{ HP_POP(mapindex->final, HP_mapindex_final) },
{ HP_POP(mapindex->addmap, HP_mapindex_addmap) },

0 comments on commit be955e5

Please sign in to comment.
You can’t perform that action at this time.