Skip to content

Commit

Permalink
Update HPM Hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonch35 committed Dec 1, 2024
1 parent 5e3a480 commit 4ed8a65
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/common/HPMDataCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "script_reg_str", sizeof(struct script_reg_str), SERVER_TYPE_ALL },
{ "status_change_data", sizeof(struct status_change_data), SERVER_TYPE_ALL },
{ "storage_data", sizeof(struct storage_data), SERVER_TYPE_ALL },
{ "storage_settings", sizeof(struct storage_settings), SERVER_TYPE_ALL },
#else
#define COMMON_MMO_H
#endif // COMMON_MMO_H
Expand Down Expand Up @@ -1240,6 +1239,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
#ifdef MAP_STORAGE_H
{ "guild_storage_interface", sizeof(struct guild_storage_interface), SERVER_TYPE_MAP },
{ "storage_interface", sizeof(struct storage_interface), SERVER_TYPE_MAP },
{ "storage_settings", sizeof(struct storage_settings), SERVER_TYPE_MAP },
#else
#define MAP_STORAGE_H
#endif // MAP_STORAGE_H
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/HPMHooking/HPMHooking.Defs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4380,8 +4380,8 @@ typedef int (*HPMHOOK_post_inter_rodex_getitems) (int retVal___, int64 mail_id,
#ifdef CHAR_INT_STORAGE_H /* inter_storage */
typedef int (*HPMHOOK_pre_inter_storage_tosql) (int *account_id, int *storage_id, const struct storage_data **p);
typedef int (*HPMHOOK_post_inter_storage_tosql) (int retVal___, int account_id, int storage_id, const struct storage_data *p);
typedef int (*HPMHOOK_pre_inter_storage_fromsql) (int *account_id, int *storage_id, struct storage_data **p, int *storage_size);
typedef int (*HPMHOOK_post_inter_storage_fromsql) (int retVal___, int account_id, int storage_id, struct storage_data *p, int storage_size);
typedef int (*HPMHOOK_pre_inter_storage_fromsql) (int *account_id, int *storage_id, struct storage_data **p);
typedef int (*HPMHOOK_post_inter_storage_fromsql) (int retVal___, int account_id, int storage_id, struct storage_data *p);
typedef bool (*HPMHOOK_pre_inter_storage_guild_storage_tosql) (int *guild_id, const struct guild_storage **gstor);
typedef bool (*HPMHOOK_post_inter_storage_guild_storage_tosql) (bool retVal___, int guild_id, const struct guild_storage *gstor);
typedef int (*HPMHOOK_pre_inter_storage_guild_storage_fromsql) (int *guild_id, struct guild_storage **gstor);
Expand Down Expand Up @@ -9376,8 +9376,8 @@ typedef const struct storage_settings * (*HPMHOOK_pre_storage_get_settings) (int
typedef const struct storage_settings * (*HPMHOOK_post_storage_get_settings) (const struct storage_settings * retVal___, int storage_id);
typedef int (*HPMHOOK_pre_storage_delitem) (struct map_session_data **sd, struct storage_data **stor, int *n, int *amount);
typedef int (*HPMHOOK_post_storage_delitem) (int retVal___, struct map_session_data *sd, struct storage_data *stor, int n, int amount);
typedef int (*HPMHOOK_pre_storage_open) (struct map_session_data **sd, struct storage_data **stor);
typedef int (*HPMHOOK_post_storage_open) (int retVal___, struct map_session_data *sd, struct storage_data *stor);
typedef int (*HPMHOOK_pre_storage_open) (struct map_session_data **sd, struct storage_data **stor, enum storage_access_modes *mode);
typedef int (*HPMHOOK_post_storage_open) (int retVal___, struct map_session_data *sd, struct storage_data *stor, enum storage_access_modes mode);
typedef int (*HPMHOOK_pre_storage_add) (struct map_session_data **sd, struct storage_data **stor, int *index, int *amount);
typedef int (*HPMHOOK_post_storage_add) (int retVal___, struct map_session_data *sd, struct storage_data *stor, int index, int amount);
typedef int (*HPMHOOK_pre_storage_get) (struct map_session_data **sd, struct storage_data **stor, int *index, int *amount);
Expand Down
12 changes: 6 additions & 6 deletions src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
Original file line number Diff line number Diff line change
Expand Up @@ -11075,29 +11075,29 @@ int HP_inter_storage_tosql(int account_id, int storage_id, const struct storage_
}
return retVal___;
}
int HP_inter_storage_fromsql(int account_id, int storage_id, struct storage_data *p, int storage_size) {
int HP_inter_storage_fromsql(int account_id, int storage_id, struct storage_data *p) {
int hIndex = 0;
int retVal___ = 0;
if (HPMHooks.count.HP_inter_storage_fromsql_pre > 0) {
int (*preHookFunc) (int *account_id, int *storage_id, struct storage_data **p, int *storage_size);
int (*preHookFunc) (int *account_id, int *storage_id, struct storage_data **p);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_fromsql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_storage_fromsql_pre[hIndex].func;
retVal___ = preHookFunc(&account_id, &storage_id, &p, &storage_size);
retVal___ = preHookFunc(&account_id, &storage_id, &p);
}
if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
retVal___ = HPMHooks.source.inter_storage.fromsql(account_id, storage_id, p, storage_size);
retVal___ = HPMHooks.source.inter_storage.fromsql(account_id, storage_id, p);
}
if (HPMHooks.count.HP_inter_storage_fromsql_post > 0) {
int (*postHookFunc) (int retVal___, int account_id, int storage_id, struct storage_data *p, int storage_size);
int (*postHookFunc) (int retVal___, int account_id, int storage_id, struct storage_data *p);
for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_fromsql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_storage_fromsql_post[hIndex].func;
retVal___ = postHookFunc(retVal___, account_id, storage_id, p, storage_size);
retVal___ = postHookFunc(retVal___, account_id, storage_id, p);
}
}
return retVal___;
Expand Down
12 changes: 6 additions & 6 deletions src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
Original file line number Diff line number Diff line change
Expand Up @@ -97442,29 +97442,29 @@ int HP_storage_delitem(struct map_session_data *sd, struct storage_data *stor, i
}
return retVal___;
}
int HP_storage_open(struct map_session_data *sd, struct storage_data *stor) {
int HP_storage_open(struct map_session_data *sd, struct storage_data *stor, enum storage_access_modes mode) {
int hIndex = 0;
int retVal___ = 0;
if (HPMHooks.count.HP_storage_open_pre > 0) {
int (*preHookFunc) (struct map_session_data **sd, struct storage_data **stor);
int (*preHookFunc) (struct map_session_data **sd, struct storage_data **stor, enum storage_access_modes *mode);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_open_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_storage_open_pre[hIndex].func;
retVal___ = preHookFunc(&sd, &stor);
retVal___ = preHookFunc(&sd, &stor, &mode);
}
if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
retVal___ = HPMHooks.source.storage.open(sd, stor);
retVal___ = HPMHooks.source.storage.open(sd, stor, mode);
}
if (HPMHooks.count.HP_storage_open_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct storage_data *stor);
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct storage_data *stor, enum storage_access_modes mode);
for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_open_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_storage_open_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, stor);
retVal___ = postHookFunc(retVal___, sd, stor, mode);
}
}
return retVal___;
Expand Down

0 comments on commit 4ed8a65

Please sign in to comment.