summaryrefslogtreecommitdiff
path: root/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-10-20 17:43:44 +0200
committerGitHub <noreply@github.com>2019-10-20 17:43:44 +0200
commit275edef51c858e9e55934ec3af92ec19db74f3d3 (patch)
tree81c4367dfb4d51fec9c71c2a407f502a514b6a67 /src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
parentddd0e461fb8e451912a6aee90869023e2c2d8272 (diff)
parentbe955e59bcd950d6430189a8a23a608927665c02 (diff)
downloadhercules-275edef51c858e9e55934ec3af92ec19db74f3d3.tar.gz
hercules-275edef51c858e9e55934ec3af92ec19db74f3d3.tar.bz2
hercules-275edef51c858e9e55934ec3af92ec19db74f3d3.tar.xz
hercules-275edef51c858e9e55934ec3af92ec19db74f3d3.zip
Merge pull request #2547 from guilherme-gm/201910-dehardcode-db
Dehardcode DB files path
Diffstat (limited to 'src/plugins/HPMHooking/HPMHooking_map.Hooks.inc')
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc106
1 files changed, 106 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 8eefa292a..c331d66a9 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -43260,6 +43260,58 @@ bool HP_itemdb_read_libconfig_lapineddukddak_sub_sources(struct config_setting_t
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;
@@ -49689,6 +49741,60 @@ void HP_map_zone_clear_single(struct map_zone_data *zone) {
return;
}
/* 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;