diff options
Diffstat (limited to 'src/plugins')
23 files changed, 301 insertions, 78 deletions
diff --git a/src/plugins/HPMHooking.c b/src/plugins/HPMHooking.c index 8e7ed4823..5af7576d3 100644 --- a/src/plugins/HPMHooking.c +++ b/src/plugins/HPMHooking.c @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2018 Hercules Dev Team + * Copyright (C) 2013-2020 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 diff --git a/src/plugins/HPMHooking.h b/src/plugins/HPMHooking.h index f94dccac4..76f12dbad 100644 --- a/src/plugins/HPMHooking.h +++ b/src/plugins/HPMHooking.h @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2016 Hercules Dev Team + * Copyright (C) 2016-2020 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 @@ -41,7 +41,11 @@ struct HPMHooking_core_interface { const char *(*Hooked)(bool *fr); }; #else // ! HERCULES_CORE +#ifdef HERCULES_CORE_HPMI_SKIP +extern struct HPMHooking_interface HPMHooking_s; +#else HPExport struct HPMHooking_interface HPMHooking_s; +#endif #include "HPMHooking/HPMHooking.Defs.inc" diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index fe72a7e13..1f34dfdd4 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-2019 Hercules Dev Team + * Copyright (C) 2013-2020 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 @@ -1562,8 +1562,10 @@ typedef void (*HPMHOOK_pre_clif_specialeffect) (struct block_list **bl, int *typ typedef void (*HPMHOOK_post_clif_specialeffect) (struct block_list *bl, int type, enum send_target target); typedef void (*HPMHOOK_pre_clif_specialeffect_single) (struct block_list **bl, int *type, int *fd); typedef void (*HPMHOOK_post_clif_specialeffect_single) (struct block_list *bl, int type, int fd); -typedef void (*HPMHOOK_pre_clif_specialeffect_value) (struct block_list **bl, int *effect_id, int *num, send_target *target); -typedef void (*HPMHOOK_post_clif_specialeffect_value) (struct block_list *bl, int effect_id, int num, send_target target); +typedef void (*HPMHOOK_pre_clif_specialeffect_value) (struct block_list **bl, int *effect_id, uint64 *num, send_target *target); +typedef void (*HPMHOOK_post_clif_specialeffect_value) (struct block_list *bl, int effect_id, uint64 num, send_target target); +typedef void (*HPMHOOK_pre_clif_specialeffect_value_single) (struct block_list **bl, int *effect_id, uint64 *num, int *fd); +typedef void (*HPMHOOK_post_clif_specialeffect_value_single) (struct block_list *bl, int effect_id, uint64 num, int fd); typedef void (*HPMHOOK_pre_clif_removeSpecialEffect) (struct block_list **bl, int *effectId, enum send_target *target); typedef void (*HPMHOOK_post_clif_removeSpecialEffect) (struct block_list *bl, int effectId, enum send_target target); typedef void (*HPMHOOK_pre_clif_removeSpecialEffect_single) (struct block_list **bl, int *effectId, struct block_list **targetBl); @@ -2508,8 +2510,12 @@ typedef void (*HPMHOOK_pre_clif_pBGQueueRevokeReq) (int *fd, struct map_session_ typedef void (*HPMHOOK_post_clif_pBGQueueRevokeReq) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_pBGQueueBattleBeginAck) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_pBGQueueBattleBeginAck) (int fd, struct map_session_data *sd); -typedef void (*HPMHOOK_pre_clif_pCashShopOpen) (int *fd, struct map_session_data **sd); -typedef void (*HPMHOOK_post_clif_pCashShopOpen) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_pCashShopOpen1) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_pCashShopOpen1) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_pCashShopOpen2) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_pCashShopOpen2) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_pCashShopLimitedReq) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_pCashShopLimitedReq) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_pCashShopClose) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_pCashShopClose) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_pCashShopReqTab) (int *fd, struct map_session_data **sd); @@ -2524,6 +2530,8 @@ typedef void (*HPMHOOK_pre_clif_pGuildInvite2) (int *fd, struct map_session_data typedef void (*HPMHOOK_post_clif_pGuildInvite2) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_cashShopBuyAck) (int *fd, struct map_session_data **sd, int *itemId, enum CASH_SHOP_BUY_RESULT *result); typedef void (*HPMHOOK_post_clif_cashShopBuyAck) (int fd, struct map_session_data *sd, int itemId, enum CASH_SHOP_BUY_RESULT result); +typedef void (*HPMHOOK_pre_clif_cashShopOpen) (int *fd, struct map_session_data **sd, int *tab); +typedef void (*HPMHOOK_post_clif_cashShopOpen) (int fd, struct map_session_data *sd, int tab); typedef void (*HPMHOOK_pre_clif_pPartyBookingAddFilter) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_pPartyBookingAddFilter) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_pPartyBookingSubFilter) (int *fd, struct map_session_data **sd); @@ -5480,10 +5488,12 @@ typedef struct optdrop_group* (*HPMHOOK_pre_mob_read_db_drops_option) (struct mo typedef struct optdrop_group* (*HPMHOOK_post_mob_read_db_drops_option) (struct optdrop_group* retVal___, struct mob_db *entry, const char *item_name, struct config_setting_t *drop, int *drop_rate); typedef void (*HPMHOOK_pre_mob_read_db_stats_sub) (struct mob_db **entry, struct config_setting_t **t); typedef void (*HPMHOOK_post_mob_read_db_stats_sub) (struct mob_db *entry, struct config_setting_t *t); +typedef void (*HPMHOOK_pre_mob_read_db_viewdata_sub) (struct mob_db **entry, struct config_setting_t **t); +typedef void (*HPMHOOK_post_mob_read_db_viewdata_sub) (struct mob_db *entry, struct config_setting_t *t); typedef void (*HPMHOOK_pre_mob_name_constants) (void); typedef void (*HPMHOOK_post_mob_name_constants) (void); -typedef bool (*HPMHOOK_pre_mob_readdb_mobavail) (char **str[], int *columns, int *current); -typedef bool (*HPMHOOK_post_mob_readdb_mobavail) (bool retVal___, char *str[], int columns, int current); +typedef void (*HPMHOOK_pre_mob_mobavail_removal_notice) (void); +typedef void (*HPMHOOK_post_mob_mobavail_removal_notice) (void); typedef int (*HPMHOOK_pre_mob_read_randommonster) (void); typedef int (*HPMHOOK_post_mob_read_randommonster) (int retVal___); typedef bool (*HPMHOOK_pre_mob_parse_row_chatdb) (char ***str, const char **source, int *line, int **last_msg_id); @@ -6414,8 +6424,8 @@ typedef void (*HPMHOOK_pre_pc_update_idle_time) (struct map_session_data **sd, e typedef void (*HPMHOOK_post_pc_update_idle_time) (struct map_session_data *sd, enum e_battle_config_idletime type); typedef int (*HPMHOOK_pre_pc_have_magnifier) (struct map_session_data **sd); typedef int (*HPMHOOK_post_pc_have_magnifier) (int retVal___, struct map_session_data *sd); -typedef int (*HPMHOOK_pre_pc_have_item_chain) (struct map_session_data **sd, unsigned short *chain_id); -typedef int (*HPMHOOK_post_pc_have_item_chain) (int retVal___, struct map_session_data *sd, unsigned short chain_id); +typedef int (*HPMHOOK_pre_pc_have_item_chain) (struct map_session_data **sd, enum e_chain_cache *chain_cache_id); +typedef int (*HPMHOOK_post_pc_have_item_chain) (int retVal___, struct map_session_data *sd, enum e_chain_cache chain_cache_id); typedef bool (*HPMHOOK_pre_pc_process_chat_message) (struct map_session_data **sd, const char **message); typedef bool (*HPMHOOK_post_pc_process_chat_message) (bool retVal___, struct map_session_data *sd, const char *message); typedef int (*HPMHOOK_pre_pc_wis_message_to_gm) (const char **sender_name, int *permission, const char **message); @@ -6432,6 +6442,8 @@ typedef bool (*HPMHOOK_pre_pc_has_second_costume) (struct map_session_data **sd) typedef bool (*HPMHOOK_post_pc_has_second_costume) (bool retVal___, struct map_session_data *sd); typedef bool (*HPMHOOK_pre_pc_expandInventory) (struct map_session_data **sd, int *adjustSize); typedef bool (*HPMHOOK_post_pc_expandInventory) (bool retVal___, struct map_session_data *sd, int adjustSize); +typedef bool (*HPMHOOK_pre_pc_auto_exp_insurance) (struct map_session_data **sd); +typedef bool (*HPMHOOK_post_pc_auto_exp_insurance) (bool retVal___, struct map_session_data *sd); #endif // MAP_PC_H #ifdef MAP_NPC_H /* libpcre */ typedef pcre* (*HPMHOOK_pre_libpcre_compile) (const char **pattern, int *options, const char ***errptr, int **erroffset, const unsigned char **tableptr); diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc index cdba77e09..a9a83511e 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-2019 Hercules Dev Team + * Copyright (C) 2013-2020 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 diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc index a6043756d..7f52ebe46 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-2019 Hercules Dev Team + * Copyright (C) 2013-2020 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 diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc index b25025b1d..d5297c29c 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-2019 Hercules Dev Team + * Copyright (C) 2013-2020 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 diff --git a/src/plugins/HPMHooking/HPMHooking_char.sources.inc b/src/plugins/HPMHooking/HPMHooking_char.sources.inc index 973f8aff3..7adc65b3c 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-2019 Hercules Dev Team + * Copyright (C) 2013-2020 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 diff --git a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc index 556757d76..c638a1ef6 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-2019 Hercules Dev Team + * Copyright (C) 2013-2020 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 diff --git a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc index 65680e072..ef6081f41 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-2019 Hercules Dev Team + * Copyright (C) 2013-2020 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 diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc index 8f6076e2a..20c709bce 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-2019 Hercules Dev Team + * Copyright (C) 2013-2020 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 diff --git a/src/plugins/HPMHooking/HPMHooking_login.sources.inc b/src/plugins/HPMHooking/HPMHooking_login.sources.inc index 510cb8bc4..8a548bedc 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-2019 Hercules Dev Team + * Copyright (C) 2013-2020 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 diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 76dfca774..eccf2a277 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-2019 Hercules Dev Team + * Copyright (C) 2013-2020 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 @@ -1154,6 +1154,8 @@ struct { struct HPMHookPoint *HP_clif_specialeffect_single_post; struct HPMHookPoint *HP_clif_specialeffect_value_pre; struct HPMHookPoint *HP_clif_specialeffect_value_post; + struct HPMHookPoint *HP_clif_specialeffect_value_single_pre; + struct HPMHookPoint *HP_clif_specialeffect_value_single_post; struct HPMHookPoint *HP_clif_removeSpecialEffect_pre; struct HPMHookPoint *HP_clif_removeSpecialEffect_post; struct HPMHookPoint *HP_clif_removeSpecialEffect_single_pre; @@ -2098,8 +2100,12 @@ struct { struct HPMHookPoint *HP_clif_pBGQueueRevokeReq_post; struct HPMHookPoint *HP_clif_pBGQueueBattleBeginAck_pre; struct HPMHookPoint *HP_clif_pBGQueueBattleBeginAck_post; - struct HPMHookPoint *HP_clif_pCashShopOpen_pre; - struct HPMHookPoint *HP_clif_pCashShopOpen_post; + struct HPMHookPoint *HP_clif_pCashShopOpen1_pre; + struct HPMHookPoint *HP_clif_pCashShopOpen1_post; + struct HPMHookPoint *HP_clif_pCashShopOpen2_pre; + struct HPMHookPoint *HP_clif_pCashShopOpen2_post; + struct HPMHookPoint *HP_clif_pCashShopLimitedReq_pre; + struct HPMHookPoint *HP_clif_pCashShopLimitedReq_post; struct HPMHookPoint *HP_clif_pCashShopClose_pre; struct HPMHookPoint *HP_clif_pCashShopClose_post; struct HPMHookPoint *HP_clif_pCashShopReqTab_pre; @@ -2114,6 +2120,8 @@ struct { struct HPMHookPoint *HP_clif_pGuildInvite2_post; struct HPMHookPoint *HP_clif_cashShopBuyAck_pre; struct HPMHookPoint *HP_clif_cashShopBuyAck_post; + struct HPMHookPoint *HP_clif_cashShopOpen_pre; + struct HPMHookPoint *HP_clif_cashShopOpen_post; struct HPMHookPoint *HP_clif_pPartyBookingAddFilter_pre; struct HPMHookPoint *HP_clif_pPartyBookingAddFilter_post; struct HPMHookPoint *HP_clif_pPartyBookingSubFilter_pre; @@ -4082,10 +4090,12 @@ struct { struct HPMHookPoint *HP_mob_read_db_drops_option_post; struct HPMHookPoint *HP_mob_read_db_stats_sub_pre; struct HPMHookPoint *HP_mob_read_db_stats_sub_post; + struct HPMHookPoint *HP_mob_read_db_viewdata_sub_pre; + struct HPMHookPoint *HP_mob_read_db_viewdata_sub_post; struct HPMHookPoint *HP_mob_name_constants_pre; struct HPMHookPoint *HP_mob_name_constants_post; - struct HPMHookPoint *HP_mob_readdb_mobavail_pre; - struct HPMHookPoint *HP_mob_readdb_mobavail_post; + struct HPMHookPoint *HP_mob_mobavail_removal_notice_pre; + struct HPMHookPoint *HP_mob_mobavail_removal_notice_post; struct HPMHookPoint *HP_mob_read_randommonster_pre; struct HPMHookPoint *HP_mob_read_randommonster_post; struct HPMHookPoint *HP_mob_parse_row_chatdb_pre; @@ -5016,6 +5026,8 @@ struct { struct HPMHookPoint *HP_pc_has_second_costume_post; struct HPMHookPoint *HP_pc_expandInventory_pre; struct HPMHookPoint *HP_pc_expandInventory_post; + struct HPMHookPoint *HP_pc_auto_exp_insurance_pre; + struct HPMHookPoint *HP_pc_auto_exp_insurance_post; struct HPMHookPoint *HP_libpcre_compile_pre; struct HPMHookPoint *HP_libpcre_compile_post; struct HPMHookPoint *HP_libpcre_study_pre; @@ -7987,6 +7999,8 @@ struct { int HP_clif_specialeffect_single_post; int HP_clif_specialeffect_value_pre; int HP_clif_specialeffect_value_post; + int HP_clif_specialeffect_value_single_pre; + int HP_clif_specialeffect_value_single_post; int HP_clif_removeSpecialEffect_pre; int HP_clif_removeSpecialEffect_post; int HP_clif_removeSpecialEffect_single_pre; @@ -8931,8 +8945,12 @@ struct { int HP_clif_pBGQueueRevokeReq_post; int HP_clif_pBGQueueBattleBeginAck_pre; int HP_clif_pBGQueueBattleBeginAck_post; - int HP_clif_pCashShopOpen_pre; - int HP_clif_pCashShopOpen_post; + int HP_clif_pCashShopOpen1_pre; + int HP_clif_pCashShopOpen1_post; + int HP_clif_pCashShopOpen2_pre; + int HP_clif_pCashShopOpen2_post; + int HP_clif_pCashShopLimitedReq_pre; + int HP_clif_pCashShopLimitedReq_post; int HP_clif_pCashShopClose_pre; int HP_clif_pCashShopClose_post; int HP_clif_pCashShopReqTab_pre; @@ -8947,6 +8965,8 @@ struct { int HP_clif_pGuildInvite2_post; int HP_clif_cashShopBuyAck_pre; int HP_clif_cashShopBuyAck_post; + int HP_clif_cashShopOpen_pre; + int HP_clif_cashShopOpen_post; int HP_clif_pPartyBookingAddFilter_pre; int HP_clif_pPartyBookingAddFilter_post; int HP_clif_pPartyBookingSubFilter_pre; @@ -10915,10 +10935,12 @@ struct { int HP_mob_read_db_drops_option_post; int HP_mob_read_db_stats_sub_pre; int HP_mob_read_db_stats_sub_post; + int HP_mob_read_db_viewdata_sub_pre; + int HP_mob_read_db_viewdata_sub_post; int HP_mob_name_constants_pre; int HP_mob_name_constants_post; - int HP_mob_readdb_mobavail_pre; - int HP_mob_readdb_mobavail_post; + int HP_mob_mobavail_removal_notice_pre; + int HP_mob_mobavail_removal_notice_post; int HP_mob_read_randommonster_pre; int HP_mob_read_randommonster_post; int HP_mob_parse_row_chatdb_pre; @@ -11849,6 +11871,8 @@ struct { int HP_pc_has_second_costume_post; int HP_pc_expandInventory_pre; int HP_pc_expandInventory_post; + int HP_pc_auto_exp_insurance_pre; + int HP_pc_auto_exp_insurance_post; int HP_libpcre_compile_pre; int HP_libpcre_compile_post; int HP_libpcre_study_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index e7b657082..b8d5f3482 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-2019 Hercules Dev Team + * Copyright (C) 2013-2020 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 @@ -601,6 +601,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->specialeffect, HP_clif_specialeffect) }, { HP_POP(clif->specialeffect_single, HP_clif_specialeffect_single) }, { HP_POP(clif->specialeffect_value, HP_clif_specialeffect_value) }, + { HP_POP(clif->specialeffect_value_single, HP_clif_specialeffect_value_single) }, { HP_POP(clif->removeSpecialEffect, HP_clif_removeSpecialEffect) }, { HP_POP(clif->removeSpecialEffect_single, HP_clif_removeSpecialEffect_single) }, { HP_POP(clif->millenniumshield, HP_clif_millenniumshield) }, @@ -1073,7 +1074,9 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->pBGQueueCheckState, HP_clif_pBGQueueCheckState) }, { HP_POP(clif->pBGQueueRevokeReq, HP_clif_pBGQueueRevokeReq) }, { HP_POP(clif->pBGQueueBattleBeginAck, HP_clif_pBGQueueBattleBeginAck) }, - { HP_POP(clif->pCashShopOpen, HP_clif_pCashShopOpen) }, + { HP_POP(clif->pCashShopOpen1, HP_clif_pCashShopOpen1) }, + { HP_POP(clif->pCashShopOpen2, HP_clif_pCashShopOpen2) }, + { HP_POP(clif->pCashShopLimitedReq, HP_clif_pCashShopLimitedReq) }, { HP_POP(clif->pCashShopClose, HP_clif_pCashShopClose) }, { HP_POP(clif->pCashShopReqTab, HP_clif_pCashShopReqTab) }, { HP_POP(clif->pCashShopSchedule, HP_clif_pCashShopSchedule) }, @@ -1081,6 +1084,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->pPartyTick, HP_clif_pPartyTick) }, { HP_POP(clif->pGuildInvite2, HP_clif_pGuildInvite2) }, { HP_POP(clif->cashShopBuyAck, HP_clif_cashShopBuyAck) }, + { HP_POP(clif->cashShopOpen, HP_clif_cashShopOpen) }, { HP_POP(clif->pPartyBookingAddFilter, HP_clif_pPartyBookingAddFilter) }, { HP_POP(clif->pPartyBookingSubFilter, HP_clif_pPartyBookingSubFilter) }, { HP_POP(clif->pPartyBookingReqVolunteer, HP_clif_pPartyBookingReqVolunteer) }, @@ -2090,8 +2094,9 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mob->read_db_mode_sub, HP_mob_read_db_mode_sub) }, { HP_POP(mob->read_db_drops_option, HP_mob_read_db_drops_option) }, { HP_POP(mob->read_db_stats_sub, HP_mob_read_db_stats_sub) }, + { HP_POP(mob->read_db_viewdata_sub, HP_mob_read_db_viewdata_sub) }, { HP_POP(mob->name_constants, HP_mob_name_constants) }, - { HP_POP(mob->readdb_mobavail, HP_mob_readdb_mobavail) }, + { HP_POP(mob->mobavail_removal_notice, HP_mob_mobavail_removal_notice) }, { HP_POP(mob->read_randommonster, HP_mob_read_randommonster) }, { HP_POP(mob->parse_row_chatdb, HP_mob_parse_row_chatdb) }, { HP_POP(mob->readchatdb, HP_mob_readchatdb) }, @@ -2566,6 +2571,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pc->isDeathPenaltyJob, HP_pc_isDeathPenaltyJob) }, { HP_POP(pc->has_second_costume, HP_pc_has_second_costume) }, { HP_POP(pc->expandInventory, HP_pc_expandInventory) }, + { HP_POP(pc->auto_exp_insurance, HP_pc_auto_exp_insurance) }, /* pcre_interface */ { HP_POP(libpcre->compile, HP_libpcre_compile) }, { HP_POP(libpcre->study, HP_libpcre_study) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 53d0104e3..e24b00f78 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-2019 Hercules Dev Team + * Copyright (C) 2013-2020 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 @@ -15028,10 +15028,10 @@ void HP_clif_specialeffect_single(struct block_list *bl, int type, int fd) { } return; } -void HP_clif_specialeffect_value(struct block_list *bl, int effect_id, int num, send_target target) { +void HP_clif_specialeffect_value(struct block_list *bl, int effect_id, uint64 num, send_target target) { int hIndex = 0; if (HPMHooks.count.HP_clif_specialeffect_value_pre > 0) { - void (*preHookFunc) (struct block_list **bl, int *effect_id, int *num, send_target *target); + void (*preHookFunc) (struct block_list **bl, int *effect_id, uint64 *num, send_target *target); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_specialeffect_value_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_specialeffect_value_pre[hIndex].func; @@ -15046,7 +15046,7 @@ void HP_clif_specialeffect_value(struct block_list *bl, int effect_id, int num, HPMHooks.source.clif.specialeffect_value(bl, effect_id, num, target); } if (HPMHooks.count.HP_clif_specialeffect_value_post > 0) { - void (*postHookFunc) (struct block_list *bl, int effect_id, int num, send_target target); + void (*postHookFunc) (struct block_list *bl, int effect_id, uint64 num, send_target target); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_specialeffect_value_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_specialeffect_value_post[hIndex].func; postHookFunc(bl, effect_id, num, target); @@ -15054,6 +15054,32 @@ void HP_clif_specialeffect_value(struct block_list *bl, int effect_id, int num, } return; } +void HP_clif_specialeffect_value_single(struct block_list *bl, int effect_id, uint64 num, int fd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_specialeffect_value_single_pre > 0) { + void (*preHookFunc) (struct block_list **bl, int *effect_id, uint64 *num, int *fd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_specialeffect_value_single_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_specialeffect_value_single_pre[hIndex].func; + preHookFunc(&bl, &effect_id, &num, &fd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.specialeffect_value_single(bl, effect_id, num, fd); + } + if (HPMHooks.count.HP_clif_specialeffect_value_single_post > 0) { + void (*postHookFunc) (struct block_list *bl, int effect_id, uint64 num, int fd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_specialeffect_value_single_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_specialeffect_value_single_post[hIndex].func; + postHookFunc(bl, effect_id, num, fd); + } + } + return; +} void HP_clif_removeSpecialEffect(struct block_list *bl, int effectId, enum send_target target) { int hIndex = 0; if (HPMHooks.count.HP_clif_removeSpecialEffect_pre > 0) { @@ -27344,13 +27370,13 @@ void HP_clif_pBGQueueBattleBeginAck(int fd, struct map_session_data *sd) { } return; } -void HP_clif_pCashShopOpen(int fd, struct map_session_data *sd) { +void HP_clif_pCashShopOpen1(int fd, struct map_session_data *sd) { int hIndex = 0; - if (HPMHooks.count.HP_clif_pCashShopOpen_pre > 0) { + if (HPMHooks.count.HP_clif_pCashShopOpen1_pre > 0) { void (*preHookFunc) (int *fd, struct map_session_data **sd); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopOpen_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_clif_pCashShopOpen_pre[hIndex].func; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopOpen1_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pCashShopOpen1_pre[hIndex].func; preHookFunc(&fd, &sd); } if (*HPMforce_return) { @@ -27359,12 +27385,64 @@ void HP_clif_pCashShopOpen(int fd, struct map_session_data *sd) { } } { - HPMHooks.source.clif.pCashShopOpen(fd, sd); + HPMHooks.source.clif.pCashShopOpen1(fd, sd); } - if (HPMHooks.count.HP_clif_pCashShopOpen_post > 0) { + if (HPMHooks.count.HP_clif_pCashShopOpen1_post > 0) { void (*postHookFunc) (int fd, struct map_session_data *sd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopOpen_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_clif_pCashShopOpen_post[hIndex].func; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopOpen1_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pCashShopOpen1_post[hIndex].func; + postHookFunc(fd, sd); + } + } + return; +} +void HP_clif_pCashShopOpen2(int fd, struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_pCashShopOpen2_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopOpen2_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pCashShopOpen2_pre[hIndex].func; + preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.pCashShopOpen2(fd, sd); + } + if (HPMHooks.count.HP_clif_pCashShopOpen2_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopOpen2_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pCashShopOpen2_post[hIndex].func; + postHookFunc(fd, sd); + } + } + return; +} +void HP_clif_pCashShopLimitedReq(int fd, struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_pCashShopLimitedReq_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopLimitedReq_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pCashShopLimitedReq_pre[hIndex].func; + preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.pCashShopLimitedReq(fd, sd); + } + if (HPMHooks.count.HP_clif_pCashShopLimitedReq_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopLimitedReq_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pCashShopLimitedReq_post[hIndex].func; postHookFunc(fd, sd); } } @@ -27552,6 +27630,32 @@ void HP_clif_cashShopBuyAck(int fd, struct map_session_data *sd, int itemId, enu } return; } +void HP_clif_cashShopOpen(int fd, struct map_session_data *sd, int tab) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_cashShopOpen_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd, int *tab); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cashShopOpen_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_cashShopOpen_pre[hIndex].func; + preHookFunc(&fd, &sd, &tab); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.cashShopOpen(fd, sd, tab); + } + if (HPMHooks.count.HP_clif_cashShopOpen_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd, int tab); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cashShopOpen_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_cashShopOpen_post[hIndex].func; + postHookFunc(fd, sd, tab); + } + } + return; +} void HP_clif_pPartyBookingAddFilter(int fd, struct map_session_data *sd) { int hIndex = 0; if (HPMHooks.count.HP_clif_pPartyBookingAddFilter_pre > 0) { @@ -54137,6 +54241,32 @@ void HP_mob_read_db_stats_sub(struct mob_db *entry, struct config_setting_t *t) } return; } +void HP_mob_read_db_viewdata_sub(struct mob_db *entry, struct config_setting_t *t) { + int hIndex = 0; + if (HPMHooks.count.HP_mob_read_db_viewdata_sub_pre > 0) { + void (*preHookFunc) (struct mob_db **entry, struct config_setting_t **t); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_viewdata_sub_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mob_read_db_viewdata_sub_pre[hIndex].func; + preHookFunc(&entry, &t); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mob.read_db_viewdata_sub(entry, t); + } + if (HPMHooks.count.HP_mob_read_db_viewdata_sub_post > 0) { + void (*postHookFunc) (struct mob_db *entry, struct config_setting_t *t); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_viewdata_sub_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mob_read_db_viewdata_sub_post[hIndex].func; + postHookFunc(entry, t); + } + } + return; +} void HP_mob_name_constants(void) { int hIndex = 0; if (HPMHooks.count.HP_mob_name_constants_pre > 0) { @@ -54163,32 +54293,31 @@ void HP_mob_name_constants(void) { } return; } -bool HP_mob_readdb_mobavail(char *str[], int columns, int current) { +void HP_mob_mobavail_removal_notice(void) { int hIndex = 0; - bool retVal___ = false; - if (HPMHooks.count.HP_mob_readdb_mobavail_pre > 0) { - bool (*preHookFunc) (char **str[], int *columns, int *current); + if (HPMHooks.count.HP_mob_mobavail_removal_notice_pre > 0) { + void (*preHookFunc) (void); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_mobavail_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mob_readdb_mobavail_pre[hIndex].func; - retVal___ = preHookFunc(&str, &columns, ¤t); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_mobavail_removal_notice_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mob_mobavail_removal_notice_pre[hIndex].func; + preHookFunc(); } if (*HPMforce_return) { *HPMforce_return = false; - return retVal___; + return; } } { - retVal___ = HPMHooks.source.mob.readdb_mobavail(str, columns, current); + HPMHooks.source.mob.mobavail_removal_notice(); } - if (HPMHooks.count.HP_mob_readdb_mobavail_post > 0) { - bool (*postHookFunc) (bool retVal___, char *str[], int columns, int current); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_mobavail_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mob_readdb_mobavail_post[hIndex].func; - retVal___ = postHookFunc(retVal___, str, columns, current); + if (HPMHooks.count.HP_mob_mobavail_removal_notice_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_mobavail_removal_notice_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mob_mobavail_removal_notice_post[hIndex].func; + postHookFunc(); } } - return retVal___; + return; } int HP_mob_read_randommonster(void) { int hIndex = 0; @@ -66514,15 +66643,15 @@ int HP_pc_have_magnifier(struct map_session_data *sd) { } return retVal___; } -int HP_pc_have_item_chain(struct map_session_data *sd, unsigned short chain_id) { +int HP_pc_have_item_chain(struct map_session_data *sd, enum e_chain_cache chain_cache_id) { int hIndex = 0; int retVal___ = 0; if (HPMHooks.count.HP_pc_have_item_chain_pre > 0) { - int (*preHookFunc) (struct map_session_data **sd, unsigned short *chain_id); + int (*preHookFunc) (struct map_session_data **sd, enum e_chain_cache *chain_cache_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_have_item_chain_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pc_have_item_chain_pre[hIndex].func; - retVal___ = preHookFunc(&sd, &chain_id); + retVal___ = preHookFunc(&sd, &chain_cache_id); } if (*HPMforce_return) { *HPMforce_return = false; @@ -66530,13 +66659,13 @@ int HP_pc_have_item_chain(struct map_session_data *sd, unsigned short chain_id) } } { - retVal___ = HPMHooks.source.pc.have_item_chain(sd, chain_id); + retVal___ = HPMHooks.source.pc.have_item_chain(sd, chain_cache_id); } if (HPMHooks.count.HP_pc_have_item_chain_post > 0) { - int (*postHookFunc) (int retVal___, struct map_session_data *sd, unsigned short chain_id); + int (*postHookFunc) (int retVal___, struct map_session_data *sd, enum e_chain_cache chain_cache_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_have_item_chain_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pc_have_item_chain_post[hIndex].func; - retVal___ = postHookFunc(retVal___, sd, chain_id); + retVal___ = postHookFunc(retVal___, sd, chain_cache_id); } } return retVal___; @@ -66762,6 +66891,33 @@ bool HP_pc_expandInventory(struct map_session_data *sd, int adjustSize) { } return retVal___; } +bool HP_pc_auto_exp_insurance(struct map_session_data *sd) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_pc_auto_exp_insurance_pre > 0) { + bool (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_auto_exp_insurance_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_pc_auto_exp_insurance_pre[hIndex].func; + retVal___ = preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pc.auto_exp_insurance(sd); + } + if (HPMHooks.count.HP_pc_auto_exp_insurance_post > 0) { + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_auto_exp_insurance_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_pc_auto_exp_insurance_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd); + } + } + return retVal___; +} /* pcre_interface */ pcre* HP_libpcre_compile(const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr) { int hIndex = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_map.sources.inc b/src/plugins/HPMHooking/HPMHooking_map.sources.inc index 786b60288..e49a6b166 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-2019 Hercules Dev Team + * Copyright (C) 2013-2020 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 diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in index e90a04f8b..5527ceb2f 100644 --- a/src/plugins/Makefile.in +++ b/src/plugins/Makefile.in @@ -1,7 +1,7 @@ # This file is part of Hercules. # http://herc.ws - http://github.com/HerculesWS/Hercules # -# Copyright (C) 2013-2018 Hercules Dev Team +# Copyright (C) 2013-2020 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 diff --git a/src/plugins/constdb2doc.c b/src/plugins/constdb2doc.c index ebaf7a833..5d01aa360 100644 --- a/src/plugins/constdb2doc.c +++ b/src/plugins/constdb2doc.c @@ -2,8 +2,8 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2016 Hercules Dev Team - * Copyright (C) 2016 Haru <haru@dotalux.com> + * Copyright (C) 2016-2020 Hercules Dev Team + * Copyright (C) 2016 Haru <haru@dotalux.com> * * Hercules is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/plugins/db2sql.c b/src/plugins/db2sql.c index 159d4e2a6..6ca52a593 100644 --- a/src/plugins/db2sql.c +++ b/src/plugins/db2sql.c @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2018 Hercules Dev Team + * Copyright (C) 2013-2020 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 @@ -104,7 +104,7 @@ void db2sql_fileheader(void) "-- This file is part of Hercules.\n" "-- http://herc.ws - http://github.com/HerculesWS/Hercules\n" "--\n" - "-- Copyright (C) 2013-%d Hercules Dev Team\n" + "-- Copyright (C) 2013-%d Hercules Dev Team\n" "--\n" "-- Hercules is free software: you can redistribute it and/or modify\n" "-- it under the terms of the GNU General Public License as published by\n" diff --git a/src/plugins/dbghelpplug.c b/src/plugins/dbghelpplug.c index b68bb1efc..ab6b5fc76 100644 --- a/src/plugins/dbghelpplug.c +++ b/src/plugins/dbghelpplug.c @@ -2,8 +2,8 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2012-2018 Hercules Dev Team - * Copyright (C) Athena Dev Teams + * Copyright (C) 2012-2020 Hercules Dev Team + * Copyright (C) Athena Dev Teams * * Hercules is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/plugins/generate-translations.c b/src/plugins/generate-translations.c index 14a3c0a4d..7aeae0c96 100644 --- a/src/plugins/generate-translations.c +++ b/src/plugins/generate-translations.c @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2016 Hercules Dev Team + * Copyright (C) 2016-2020 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 @@ -254,7 +254,7 @@ bool translations_enter_file(const char *filepath) "# This file is part of Hercules.\n" "# http://herc.ws - http://github.com/HerculesWS/Hercules\n" "#\n" - "# Copyright (C) 2013-%d Hercules Dev Team\n" + "# Copyright (C) 2013-%d Hercules Dev Team\n" "#\n" "# Hercules is free software: you can redistribute it and/or modify\n" "# it under the terms of the GNU General Public License as published by\n" diff --git a/src/plugins/mapcache.c b/src/plugins/mapcache.c index 5e44492f6..3dc6e3b34 100644 --- a/src/plugins/mapcache.c +++ b/src/plugins/mapcache.c @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * -* Copyright (C) 2013-2015 Hercules Dev Team +* Copyright (C) 2013-2020 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 @@ -281,7 +281,28 @@ bool mapcache_cache_map(const char *mapname) if (rsw == NULL) { water_height = NO_WATER; } else { - water_height = (int)GetFloat(rsw + 166); + if (memcmp(rsw, "GRSW", 4) != 0) { + ShowError("mapcache_cache_map: file %s is not in rsw format\n", filepath); + aFree(rsw); + return false; + } + int major_version = rsw[4]; + int minor_version = rsw[5]; + if (major_version > 2 || (major_version == 2 && minor_version > 2)) { + ShowError("mapcache_cache_map: Unsupported version %d.%d for rsw file %s\n", major_version, minor_version, filepath); + aFree(rsw); + return false; + } + if (major_version < 1 || (major_version == 1 && minor_version <= 4)) { + ShowError("mapcache_cache_map: Unsupported version %d.%d for rsw file %s\n", major_version, minor_version, filepath); + aFree(rsw); + return false; + } + int offset = 166; + if (major_version == 2 && minor_version >= 2) { + offset = 167; + } + water_height = (int)GetFloat(rsw + offset); aFree(rsw); } diff --git a/src/plugins/sample.c b/src/plugins/sample.c index da29bd837..41f9517b5 100644 --- a/src/plugins/sample.c +++ b/src/plugins/sample.c @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2015 Hercules Dev Team + * Copyright (C) 2013-2020 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 diff --git a/src/plugins/script_mapquit.c b/src/plugins/script_mapquit.c index b212ce1c6..af53dc00c 100644 --- a/src/plugins/script_mapquit.c +++ b/src/plugins/script_mapquit.c @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2014-2018 Hercules Dev Team + * Copyright (C) 2014-2020 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 |