summaryrefslogtreecommitdiff
path: root/src/plugins/HPMHooking
diff options
context:
space:
mode:
authorAsheraf <acheraf1998@gmail.com>2019-07-28 18:45:37 +0100
committerAsheraf <acheraf1998@gmail.com>2019-07-28 18:46:32 +0100
commitc67015a13bd6ed0e3be7fcbb0db525fa482c9bda (patch)
treea90eeb9340a16274c9dfd2a345a97e51e23c897f /src/plugins/HPMHooking
parente657ef0ee76b5f4f15ee041f6863aee58a24cc35 (diff)
downloadhercules-c67015a13bd6ed0e3be7fcbb0db525fa482c9bda.tar.gz
hercules-c67015a13bd6ed0e3be7fcbb0db525fa482c9bda.tar.bz2
hercules-c67015a13bd6ed0e3be7fcbb0db525fa482c9bda.tar.xz
hercules-c67015a13bd6ed0e3be7fcbb0db525fa482c9bda.zip
HPM Hooks Update
Diffstat (limited to 'src/plugins/HPMHooking')
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc6
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc12
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc3
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc51
4 files changed, 53 insertions, 19 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index b59d80b9c..4f4d628a5 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -3050,8 +3050,10 @@ typedef struct map_session_data* (*HPMHOOK_pre_guild_sd_check) (int *guild_id, i
typedef struct map_session_data* (*HPMHOOK_post_guild_sd_check) (struct map_session_data* retVal___, int guild_id, int account_id, int char_id);
typedef bool (*HPMHOOK_pre_guild_read_guildskill_tree_db) (char **split[], int *columns, int *current);
typedef bool (*HPMHOOK_post_guild_read_guildskill_tree_db) (bool retVal___, char *split[], int columns, int current);
-typedef bool (*HPMHOOK_pre_guild_read_castledb) (char **str[], int *columns, int *current);
-typedef bool (*HPMHOOK_post_guild_read_castledb) (bool retVal___, char *str[], int columns, int current);
+typedef bool (*HPMHOOK_pre_guild_read_castledb_libconfig) (void);
+typedef bool (*HPMHOOK_post_guild_read_castledb_libconfig) (bool retVal___);
+typedef bool (*HPMHOOK_pre_guild_read_castledb_libconfig_sub) (struct config_setting_t **it, int *idx, const char **source);
+typedef bool (*HPMHOOK_post_guild_read_castledb_libconfig_sub) (bool retVal___, struct config_setting_t *it, int idx, const char *source);
typedef int (*HPMHOOK_pre_guild_payexp_timer_sub) (union DBKey *key, struct DBData **data, va_list ap);
typedef int (*HPMHOOK_post_guild_payexp_timer_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
typedef int (*HPMHOOK_pre_guild_send_xy_timer_sub) (union DBKey *key, struct DBData **data, va_list ap);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index 454a5229c..14e1cc8ea 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -2614,8 +2614,10 @@ struct {
struct HPMHookPoint *HP_guild_sd_check_post;
struct HPMHookPoint *HP_guild_read_guildskill_tree_db_pre;
struct HPMHookPoint *HP_guild_read_guildskill_tree_db_post;
- struct HPMHookPoint *HP_guild_read_castledb_pre;
- struct HPMHookPoint *HP_guild_read_castledb_post;
+ struct HPMHookPoint *HP_guild_read_castledb_libconfig_pre;
+ struct HPMHookPoint *HP_guild_read_castledb_libconfig_post;
+ struct HPMHookPoint *HP_guild_read_castledb_libconfig_sub_pre;
+ struct HPMHookPoint *HP_guild_read_castledb_libconfig_sub_post;
struct HPMHookPoint *HP_guild_payexp_timer_sub_pre;
struct HPMHookPoint *HP_guild_payexp_timer_sub_post;
struct HPMHookPoint *HP_guild_send_xy_timer_sub_pre;
@@ -9401,8 +9403,10 @@ struct {
int HP_guild_sd_check_post;
int HP_guild_read_guildskill_tree_db_pre;
int HP_guild_read_guildskill_tree_db_post;
- int HP_guild_read_castledb_pre;
- int HP_guild_read_castledb_post;
+ int HP_guild_read_castledb_libconfig_pre;
+ int HP_guild_read_castledb_libconfig_post;
+ int HP_guild_read_castledb_libconfig_sub_pre;
+ int HP_guild_read_castledb_libconfig_sub_post;
int HP_guild_payexp_timer_sub_pre;
int HP_guild_payexp_timer_sub_post;
int HP_guild_send_xy_timer_sub_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index da2f81541..a5848995c 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -1340,7 +1340,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(guild->payexp_timer, HP_guild_payexp_timer) },
{ HP_POP(guild->sd_check, HP_guild_sd_check) },
{ HP_POP(guild->read_guildskill_tree_db, HP_guild_read_guildskill_tree_db) },
- { HP_POP(guild->read_castledb, HP_guild_read_castledb) },
+ { HP_POP(guild->read_castledb_libconfig, HP_guild_read_castledb_libconfig) },
+ { HP_POP(guild->read_castledb_libconfig_sub, HP_guild_read_castledb_libconfig_sub) },
{ HP_POP(guild->payexp_timer_sub, HP_guild_payexp_timer_sub) },
{ HP_POP(guild->send_xy_timer_sub, HP_guild_send_xy_timer_sub) },
{ HP_POP(guild->send_xy_timer, HP_guild_send_xy_timer) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index b31959ff4..25844b1cc 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -34199,15 +34199,15 @@ bool HP_guild_read_guildskill_tree_db(char *split[], int columns, int current) {
}
return retVal___;
}
-bool HP_guild_read_castledb(char *str[], int columns, int current) {
+bool HP_guild_read_castledb_libconfig(void) {
int hIndex = 0;
bool retVal___ = false;
- if (HPMHooks.count.HP_guild_read_castledb_pre > 0) {
- bool (*preHookFunc) (char **str[], int *columns, int *current);
+ if (HPMHooks.count.HP_guild_read_castledb_libconfig_pre > 0) {
+ bool (*preHookFunc) (void);
*HPMforce_return = false;
- for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_castledb_pre; hIndex++) {
- preHookFunc = HPMHooks.list.HP_guild_read_castledb_pre[hIndex].func;
- retVal___ = preHookFunc(&str, &columns, &current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_castledb_libconfig_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_guild_read_castledb_libconfig_pre[hIndex].func;
+ retVal___ = preHookFunc();
}
if (*HPMforce_return) {
*HPMforce_return = false;
@@ -34215,13 +34215,40 @@ bool HP_guild_read_castledb(char *str[], int columns, int current) {
}
}
{
- retVal___ = HPMHooks.source.guild.read_castledb(str, columns, current);
+ retVal___ = HPMHooks.source.guild.read_castledb_libconfig();
}
- if (HPMHooks.count.HP_guild_read_castledb_post > 0) {
- bool (*postHookFunc) (bool retVal___, char *str[], int columns, int current);
- for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_castledb_post; hIndex++) {
- postHookFunc = HPMHooks.list.HP_guild_read_castledb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, str, columns, current);
+ if (HPMHooks.count.HP_guild_read_castledb_libconfig_post > 0) {
+ bool (*postHookFunc) (bool retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_castledb_libconfig_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_guild_read_castledb_libconfig_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
+bool HP_guild_read_castledb_libconfig_sub(struct config_setting_t *it, int idx, const char *source) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_guild_read_castledb_libconfig_sub_pre > 0) {
+ bool (*preHookFunc) (struct config_setting_t **it, int *idx, const char **source);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_castledb_libconfig_sub_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_guild_read_castledb_libconfig_sub_pre[hIndex].func;
+ retVal___ = preHookFunc(&it, &idx, &source);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.guild.read_castledb_libconfig_sub(it, idx, source);
+ }
+ if (HPMHooks.count.HP_guild_read_castledb_libconfig_sub_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct config_setting_t *it, int idx, const char *source);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_castledb_libconfig_sub_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_guild_read_castledb_libconfig_sub_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, it, idx, source);
}
}
return retVal___;