diff options
Diffstat (limited to 'src/plugins')
18 files changed, 1143 insertions, 136 deletions
diff --git a/src/plugins/HPMHooking.c b/src/plugins/HPMHooking.c index a975c034e..18bfaf220 100644 --- a/src/plugins/HPMHooking.c +++ b/src/plugins/HPMHooking.c @@ -1,7 +1,22 @@ -// Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// See the LICENSE file -// Sample Hercules Plugin - +/** + * This file is part of Hercules. + * http://herc.ws - http://github.com/HerculesWS/Hercules + * + * Copyright (C) 2013-2015 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ #include "common/hercules.h" #include "common/db.h" #include "common/memmgr.h" diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc index c5f135937..aefb3aa93 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc @@ -1,8 +1,27 @@ -// Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// See the LICENSE file -// -// NOTE: This file was auto-generated and should never be manually edited, -// as it will get overwritten. +/** + * This file is part of Hercules. + * http://herc.ws - http://github.com/HerculesWS/Hercules + * + * Copyright (C) 2013-2015 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* + * NOTE: This file was auto-generated and should never be manually edited, + * as it will get overwritten. + */ struct { struct HPMHookPoint *HP_HCache_init_pre; @@ -347,6 +366,8 @@ struct { struct HPMHookPoint *HP_console_final_post; struct HPMHookPoint *HP_console_display_title_pre; struct HPMHookPoint *HP_console_display_title_post; + struct HPMHookPoint *HP_console_display_gplnotice_pre; + struct HPMHookPoint *HP_console_display_gplnotice_post; struct HPMHookPoint *HP_core_shutdown_callback_pre; struct HPMHookPoint *HP_core_shutdown_callback_post; struct HPMHookPoint *HP_DB_fix_options_pre; @@ -1722,6 +1743,8 @@ struct { int HP_console_final_post; int HP_console_display_title_pre; int HP_console_display_title_post; + int HP_console_display_gplnotice_pre; + int HP_console_display_gplnotice_post; int HP_core_shutdown_callback_pre; int HP_core_shutdown_callback_post; int HP_DB_fix_options_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc index 59c82f0e2..3c442c4ab 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc @@ -1,8 +1,26 @@ -// Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// See the LICENSE file -// -// NOTE: This file was auto-generated and should never be manually edited, -// as it will get overwritten. +/** + * This file is part of Hercules. + * + * Copyright (C) 2013-2015 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* + * NOTE: This file was auto-generated and should never be manually edited, + * as it will get overwritten. + */ struct HookingPointData HookingPoints[] = { /* HCache */ @@ -180,6 +198,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(console->init, HP_console_init) }, { HP_POP(console->final, HP_console_final) }, { HP_POP(console->display_title, HP_console_display_title) }, + { HP_POP(console->display_gplnotice, HP_console_display_gplnotice) }, /* core */ { HP_POP(core->shutdown_callback, HP_core_shutdown_callback) }, /* DB */ diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc index e113611e4..3e9e6e1d2 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc @@ -1,8 +1,27 @@ -// Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// See the LICENSE file -// -// NOTE: This file was auto-generated and should never be manually edited, -// as it will get overwritten. +/** + * This file is part of Hercules. + * http://herc.ws - http://github.com/HerculesWS/Hercules + * + * Copyright (C) 2013-2015 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* + * NOTE: This file was auto-generated and should never be manually edited, + * as it will get overwritten. + */ /* HCache */ void HP_HCache_init(void) { @@ -4543,6 +4562,32 @@ void HP_console_display_title(void) { } return; } +void HP_console_display_gplnotice(void) { + int hIndex = 0; + if( HPMHooks.count.HP_console_display_gplnotice_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_console_display_gplnotice_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.console.display_gplnotice(); + } + if( HPMHooks.count.HP_console_display_gplnotice_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_console_display_gplnotice_post[hIndex].func; + postHookFunc(); + } + } + return; +} /* core */ void HP_core_shutdown_callback(void) { int hIndex = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_char.sources.inc b/src/plugins/HPMHooking/HPMHooking_char.sources.inc index 489917771..92623f516 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.sources.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.sources.inc @@ -1,8 +1,27 @@ -// Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// See the LICENSE file -// -// NOTE: This file was auto-generated and should never be manually edited, -// as it will get overwritten. +/** + * This file is part of Hercules. + * http://herc.ws - http://github.com/HerculesWS/Hercules + * + * Copyright (C) 2013-2015 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* + * NOTE: This file was auto-generated and should never be manually edited, + * as it will get overwritten. + */ memcpy(&HPMHooks.source.HCache, HCache, sizeof(struct HCache_interface)); memcpy(&HPMHooks.source.chr, chr, sizeof(struct char_interface)); diff --git a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc index 4edefd5b7..5540e15b3 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc @@ -1,8 +1,27 @@ -// Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// See the LICENSE file -// -// NOTE: This file was auto-generated and should never be manually edited, -// as it will get overwritten. +/** + * This file is part of Hercules. + * http://herc.ws - http://github.com/HerculesWS/Hercules + * + * Copyright (C) 2013-2015 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* + * NOTE: This file was auto-generated and should never be manually edited, + * as it will get overwritten. + */ struct { struct HPMHookPoint *HP_HCache_init_pre; @@ -29,6 +48,8 @@ struct { struct HPMHookPoint *HP_console_final_post; struct HPMHookPoint *HP_console_display_title_pre; struct HPMHookPoint *HP_console_display_title_post; + struct HPMHookPoint *HP_console_display_gplnotice_pre; + struct HPMHookPoint *HP_console_display_gplnotice_post; struct HPMHookPoint *HP_core_shutdown_callback_pre; struct HPMHookPoint *HP_core_shutdown_callback_post; struct HPMHookPoint *HP_DB_fix_options_pre; @@ -600,6 +621,8 @@ struct { int HP_console_final_post; int HP_console_display_title_pre; int HP_console_display_title_post; + int HP_console_display_gplnotice_pre; + int HP_console_display_gplnotice_post; int HP_core_shutdown_callback_pre; int HP_core_shutdown_callback_post; int HP_DB_fix_options_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc index cdcdedcb5..27e0f857d 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc @@ -1,8 +1,26 @@ -// Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// See the LICENSE file -// -// NOTE: This file was auto-generated and should never be manually edited, -// as it will get overwritten. +/** + * This file is part of Hercules. + * + * Copyright (C) 2013-2015 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* + * NOTE: This file was auto-generated and should never be manually edited, + * as it will get overwritten. + */ struct HookingPointData HookingPoints[] = { /* HCache */ @@ -20,6 +38,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(console->init, HP_console_init) }, { HP_POP(console->final, HP_console_final) }, { HP_POP(console->display_title, HP_console_display_title) }, + { HP_POP(console->display_gplnotice, HP_console_display_gplnotice) }, /* core */ { HP_POP(core->shutdown_callback, HP_core_shutdown_callback) }, /* DB */ diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc index 5d4fad4d8..012240bb3 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc @@ -1,8 +1,27 @@ -// Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// See the LICENSE file -// -// NOTE: This file was auto-generated and should never be manually edited, -// as it will get overwritten. +/** + * This file is part of Hercules. + * http://herc.ws - http://github.com/HerculesWS/Hercules + * + * Copyright (C) 2013-2015 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* + * NOTE: This file was auto-generated and should never be manually edited, + * as it will get overwritten. + */ /* HCache */ void HP_HCache_init(void) { @@ -325,6 +344,32 @@ void HP_console_display_title(void) { } return; } +void HP_console_display_gplnotice(void) { + int hIndex = 0; + if( HPMHooks.count.HP_console_display_gplnotice_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_console_display_gplnotice_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.console.display_gplnotice(); + } + if( HPMHooks.count.HP_console_display_gplnotice_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_console_display_gplnotice_post[hIndex].func; + postHookFunc(); + } + } + return; +} /* core */ void HP_core_shutdown_callback(void) { int hIndex = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_login.sources.inc b/src/plugins/HPMHooking/HPMHooking_login.sources.inc index aed0dc77f..38500f0ee 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.sources.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.sources.inc @@ -1,8 +1,27 @@ -// Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// See the LICENSE file -// -// NOTE: This file was auto-generated and should never be manually edited, -// as it will get overwritten. +/** + * This file is part of Hercules. + * http://herc.ws - http://github.com/HerculesWS/Hercules + * + * Copyright (C) 2013-2015 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* + * NOTE: This file was auto-generated and should never be manually edited, + * as it will get overwritten. + */ memcpy(&HPMHooks.source.HCache, HCache, sizeof(struct HCache_interface)); memcpy(&HPMHooks.source.cmdline, cmdline, sizeof(struct cmdline_interface)); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index b6afa8fcf..59844e766 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -1,8 +1,27 @@ -// Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// See the LICENSE file -// -// NOTE: This file was auto-generated and should never be manually edited, -// as it will get overwritten. +/** + * This file is part of Hercules. + * http://herc.ws - http://github.com/HerculesWS/Hercules + * + * Copyright (C) 2013-2015 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* + * NOTE: This file was auto-generated and should never be manually edited, + * as it will get overwritten. + */ struct { struct HPMHookPoint *HP_HCache_init_pre; @@ -1845,6 +1864,8 @@ struct { struct HPMHookPoint *HP_console_final_post; struct HPMHookPoint *HP_console_display_title_pre; struct HPMHookPoint *HP_console_display_title_post; + struct HPMHookPoint *HP_console_display_gplnotice_pre; + struct HPMHookPoint *HP_console_display_gplnotice_post; struct HPMHookPoint *HP_core_shutdown_callback_pre; struct HPMHookPoint *HP_core_shutdown_callback_post; struct HPMHookPoint *HP_DB_fix_options_pre; @@ -3481,6 +3502,24 @@ struct { struct HPMHookPoint *HP_mob_clear_spawninfo_post; struct HPMHookPoint *HP_mob_destroy_mob_db_pre; struct HPMHookPoint *HP_mob_destroy_mob_db_post; + struct HPMHookPoint *HP_npc_chat_sub_pre; + struct HPMHookPoint *HP_npc_chat_sub_post; + struct HPMHookPoint *HP_npc_chat_finalize_pre; + struct HPMHookPoint *HP_npc_chat_finalize_post; + struct HPMHookPoint *HP_npc_chat_def_pattern_pre; + struct HPMHookPoint *HP_npc_chat_def_pattern_post; + struct HPMHookPoint *HP_npc_chat_create_pcrematch_entry_pre; + struct HPMHookPoint *HP_npc_chat_create_pcrematch_entry_post; + struct HPMHookPoint *HP_npc_chat_delete_pcreset_pre; + struct HPMHookPoint *HP_npc_chat_delete_pcreset_post; + struct HPMHookPoint *HP_npc_chat_deactivate_pcreset_pre; + struct HPMHookPoint *HP_npc_chat_deactivate_pcreset_post; + struct HPMHookPoint *HP_npc_chat_activate_pcreset_pre; + struct HPMHookPoint *HP_npc_chat_activate_pcreset_post; + struct HPMHookPoint *HP_npc_chat_lookup_pcreset_pre; + struct HPMHookPoint *HP_npc_chat_lookup_pcreset_post; + struct HPMHookPoint *HP_npc_chat_finalize_pcrematch_entry_pre; + struct HPMHookPoint *HP_npc_chat_finalize_pcrematch_entry_post; struct HPMHookPoint *HP_npc_init_pre; struct HPMHookPoint *HP_npc_init_post; struct HPMHookPoint *HP_npc_final_pre; @@ -4267,6 +4306,22 @@ struct { struct HPMHookPoint *HP_pc_check_job_name_post; struct HPMHookPoint *HP_pc_update_idle_time_pre; struct HPMHookPoint *HP_pc_update_idle_time_post; + struct HPMHookPoint *HP_libpcre_compile_pre; + struct HPMHookPoint *HP_libpcre_compile_post; + struct HPMHookPoint *HP_libpcre_study_pre; + struct HPMHookPoint *HP_libpcre_study_post; + struct HPMHookPoint *HP_libpcre_exec_pre; + struct HPMHookPoint *HP_libpcre_exec_post; + struct HPMHookPoint *HP_libpcre_free_pre; + struct HPMHookPoint *HP_libpcre_free_post; + struct HPMHookPoint *HP_libpcre_copy_substring_pre; + struct HPMHookPoint *HP_libpcre_copy_substring_post; + struct HPMHookPoint *HP_libpcre_free_substring_pre; + struct HPMHookPoint *HP_libpcre_free_substring_post; + struct HPMHookPoint *HP_libpcre_copy_named_substring_pre; + struct HPMHookPoint *HP_libpcre_copy_named_substring_post; + struct HPMHookPoint *HP_libpcre_get_substring_pre; + struct HPMHookPoint *HP_libpcre_get_substring_post; struct HPMHookPoint *HP_pet_init_pre; struct HPMHookPoint *HP_pet_init_post; struct HPMHookPoint *HP_pet_final_pre; @@ -7628,6 +7683,8 @@ struct { int HP_console_final_post; int HP_console_display_title_pre; int HP_console_display_title_post; + int HP_console_display_gplnotice_pre; + int HP_console_display_gplnotice_post; int HP_core_shutdown_callback_pre; int HP_core_shutdown_callback_post; int HP_DB_fix_options_pre; @@ -9264,6 +9321,24 @@ struct { int HP_mob_clear_spawninfo_post; int HP_mob_destroy_mob_db_pre; int HP_mob_destroy_mob_db_post; + int HP_npc_chat_sub_pre; + int HP_npc_chat_sub_post; + int HP_npc_chat_finalize_pre; + int HP_npc_chat_finalize_post; + int HP_npc_chat_def_pattern_pre; + int HP_npc_chat_def_pattern_post; + int HP_npc_chat_create_pcrematch_entry_pre; + int HP_npc_chat_create_pcrematch_entry_post; + int HP_npc_chat_delete_pcreset_pre; + int HP_npc_chat_delete_pcreset_post; + int HP_npc_chat_deactivate_pcreset_pre; + int HP_npc_chat_deactivate_pcreset_post; + int HP_npc_chat_activate_pcreset_pre; + int HP_npc_chat_activate_pcreset_post; + int HP_npc_chat_lookup_pcreset_pre; + int HP_npc_chat_lookup_pcreset_post; + int HP_npc_chat_finalize_pcrematch_entry_pre; + int HP_npc_chat_finalize_pcrematch_entry_post; int HP_npc_init_pre; int HP_npc_init_post; int HP_npc_final_pre; @@ -10050,6 +10125,22 @@ struct { int HP_pc_check_job_name_post; int HP_pc_update_idle_time_pre; int HP_pc_update_idle_time_post; + int HP_libpcre_compile_pre; + int HP_libpcre_compile_post; + int HP_libpcre_study_pre; + int HP_libpcre_study_post; + int HP_libpcre_exec_pre; + int HP_libpcre_exec_post; + int HP_libpcre_free_pre; + int HP_libpcre_free_post; + int HP_libpcre_copy_substring_pre; + int HP_libpcre_copy_substring_post; + int HP_libpcre_free_substring_pre; + int HP_libpcre_free_substring_post; + int HP_libpcre_copy_named_substring_pre; + int HP_libpcre_copy_named_substring_post; + int HP_libpcre_get_substring_pre; + int HP_libpcre_get_substring_post; int HP_pet_init_pre; int HP_pet_init_post; int HP_pet_final_pre; @@ -11603,12 +11694,14 @@ struct { struct mapreg_interface mapreg; struct mercenary_interface mercenary; struct mob_interface mob; + struct npc_chat_interface npc_chat; struct npc_interface npc; struct nullpo_interface nullpo; struct party_interface party; struct path_interface path; struct pc_groups_interface pcg; struct pc_interface pc; + struct pcre_interface libpcre; struct pet_interface pet; struct quest_interface quest; struct script_interface script; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index c937241f3..bc78fe8b4 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1,8 +1,26 @@ -// Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// See the LICENSE file -// -// NOTE: This file was auto-generated and should never be manually edited, -// as it will get overwritten. +/** + * This file is part of Hercules. + * + * Copyright (C) 2013-2015 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* + * NOTE: This file was auto-generated and should never be manually edited, + * as it will get overwritten. + */ struct HookingPointData HookingPoints[] = { /* HCache */ @@ -936,6 +954,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(console->init, HP_console_init) }, { HP_POP(console->final, HP_console_final) }, { HP_POP(console->display_title, HP_console_display_title) }, + { HP_POP(console->display_gplnotice, HP_console_display_gplnotice) }, /* core */ { HP_POP(core->shutdown_callback, HP_core_shutdown_callback) }, /* DB */ @@ -1775,6 +1794,16 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mob->load, HP_mob_load) }, { HP_POP(mob->clear_spawninfo, HP_mob_clear_spawninfo) }, { HP_POP(mob->destroy_mob_db, HP_mob_destroy_mob_db) }, +/* npc_chat */ + { HP_POP(npc_chat->sub, HP_npc_chat_sub) }, + { HP_POP(npc_chat->finalize, HP_npc_chat_finalize) }, + { HP_POP(npc_chat->def_pattern, HP_npc_chat_def_pattern) }, + { HP_POP(npc_chat->create_pcrematch_entry, HP_npc_chat_create_pcrematch_entry) }, + { HP_POP(npc_chat->delete_pcreset, HP_npc_chat_delete_pcreset) }, + { HP_POP(npc_chat->deactivate_pcreset, HP_npc_chat_deactivate_pcreset) }, + { HP_POP(npc_chat->activate_pcreset, HP_npc_chat_activate_pcreset) }, + { HP_POP(npc_chat->lookup_pcreset, HP_npc_chat_lookup_pcreset) }, + { HP_POP(npc_chat->finalize_pcrematch_entry, HP_npc_chat_finalize_pcrematch_entry) }, /* npc */ { HP_POP(npc->init, HP_npc_init) }, { HP_POP(npc->final, HP_npc_final) }, @@ -2174,6 +2203,15 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pc->autotrade_final, HP_pc_autotrade_final) }, { HP_POP(pc->check_job_name, HP_pc_check_job_name) }, { HP_POP(pc->update_idle_time, HP_pc_update_idle_time) }, +/* libpcre */ + { HP_POP(libpcre->compile, HP_libpcre_compile) }, + { HP_POP(libpcre->study, HP_libpcre_study) }, + { HP_POP(libpcre->exec, HP_libpcre_exec) }, + { HP_POP(libpcre->free, HP_libpcre_free) }, + { HP_POP(libpcre->copy_substring, HP_libpcre_copy_substring) }, + { HP_POP(libpcre->free_substring, HP_libpcre_free_substring) }, + { HP_POP(libpcre->copy_named_substring, HP_libpcre_copy_named_substring) }, + { HP_POP(libpcre->get_substring, HP_libpcre_get_substring) }, /* pet */ { HP_POP(pet->init, HP_pet_init) }, { HP_POP(pet->final, HP_pet_final) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 78c9136de..4c828dc56 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -1,8 +1,27 @@ -// Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// See the LICENSE file -// -// NOTE: This file was auto-generated and should never be manually edited, -// as it will get overwritten. +/** + * This file is part of Hercules. + * http://herc.ws - http://github.com/HerculesWS/Hercules + * + * Copyright (C) 2013-2015 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* + * NOTE: This file was auto-generated and should never be manually edited, + * as it will get overwritten. + */ /* HCache */ void HP_HCache_init(void) { @@ -2344,15 +2363,15 @@ int HP_battle_config_set_value(const char *w1, const char *w2) { } return retVal___; } -int HP_battle_config_get_value(const char *w1) { +bool HP_battle_config_get_value(const char *w1, int *value) { int hIndex = 0; - int retVal___ = 0; + bool retVal___ = false; if( HPMHooks.count.HP_battle_config_get_value_pre ) { - int (*preHookFunc) (const char *w1); + bool (*preHookFunc) (const char *w1, int *value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_get_value_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_battle_config_get_value_pre[hIndex].func; - retVal___ = preHookFunc(w1); + retVal___ = preHookFunc(w1, value); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -2360,13 +2379,13 @@ int HP_battle_config_get_value(const char *w1) { } } { - retVal___ = HPMHooks.source.battle.config_get_value(w1); + retVal___ = HPMHooks.source.battle.config_get_value(w1, value); } if( HPMHooks.count.HP_battle_config_get_value_post ) { - int (*postHookFunc) (int retVal___, const char *w1); + bool (*postHookFunc) (bool retVal___, const char *w1, int *value); for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_get_value_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_battle_config_get_value_post[hIndex].func; - retVal___ = postHookFunc(retVal___, w1); + retVal___ = postHookFunc(retVal___, w1, value); } } return retVal___; @@ -24262,6 +24281,32 @@ void HP_console_display_title(void) { } return; } +void HP_console_display_gplnotice(void) { + int hIndex = 0; + if( HPMHooks.count.HP_console_display_gplnotice_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_console_display_gplnotice_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.console.display_gplnotice(); + } + if( HPMHooks.count.HP_console_display_gplnotice_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_console_display_gplnotice_post[hIndex].func; + postHookFunc(); + } + } + return; +} /* core */ void HP_core_shutdown_callback(void) { int hIndex = 0; @@ -46477,6 +46522,250 @@ void HP_mob_destroy_mob_db(int index) { } return; } +/* npc_chat */ +int HP_npc_chat_sub(struct block_list *bl, va_list ap) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_npc_chat_sub_pre ) { + int (*preHookFunc) (struct block_list *bl, va_list ap); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_sub_pre; hIndex++ ) { + va_list ap___copy; va_copy(ap___copy, ap); + preHookFunc = HPMHooks.list.HP_npc_chat_sub_pre[hIndex].func; + retVal___ = preHookFunc(bl, ap___copy); + va_end(ap___copy); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + va_list ap___copy; va_copy(ap___copy, ap); + retVal___ = HPMHooks.source.npc_chat.sub(bl, ap___copy); + va_end(ap___copy); + } + if( HPMHooks.count.HP_npc_chat_sub_post ) { + int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap); + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_sub_post; hIndex++ ) { + va_list ap___copy; va_copy(ap___copy, ap); + postHookFunc = HPMHooks.list.HP_npc_chat_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, bl, ap___copy); + va_end(ap___copy); + } + } + return retVal___; +} +void HP_npc_chat_finalize(struct npc_data *nd) { + int hIndex = 0; + if( HPMHooks.count.HP_npc_chat_finalize_pre ) { + void (*preHookFunc) (struct npc_data *nd); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_finalize_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_npc_chat_finalize_pre[hIndex].func; + preHookFunc(nd); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.npc_chat.finalize(nd); + } + if( HPMHooks.count.HP_npc_chat_finalize_post ) { + void (*postHookFunc) (struct npc_data *nd); + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_finalize_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_npc_chat_finalize_post[hIndex].func; + postHookFunc(nd); + } + } + return; +} +void HP_npc_chat_def_pattern(struct npc_data *nd, int setid, const char *pattern, const char *label) { + int hIndex = 0; + if( HPMHooks.count.HP_npc_chat_def_pattern_pre ) { + void (*preHookFunc) (struct npc_data *nd, int *setid, const char *pattern, const char *label); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_def_pattern_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_npc_chat_def_pattern_pre[hIndex].func; + preHookFunc(nd, &setid, pattern, label); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.npc_chat.def_pattern(nd, setid, pattern, label); + } + if( HPMHooks.count.HP_npc_chat_def_pattern_post ) { + void (*postHookFunc) (struct npc_data *nd, int *setid, const char *pattern, const char *label); + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_def_pattern_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_npc_chat_def_pattern_post[hIndex].func; + postHookFunc(nd, &setid, pattern, label); + } + } + return; +} +struct pcrematch_entry* HP_npc_chat_create_pcrematch_entry(struct pcrematch_set *set) { + int hIndex = 0; + struct pcrematch_entry* retVal___ = NULL; + if( HPMHooks.count.HP_npc_chat_create_pcrematch_entry_pre ) { + struct pcrematch_entry* (*preHookFunc) (struct pcrematch_set *set); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_create_pcrematch_entry_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_npc_chat_create_pcrematch_entry_pre[hIndex].func; + retVal___ = preHookFunc(set); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.npc_chat.create_pcrematch_entry(set); + } + if( HPMHooks.count.HP_npc_chat_create_pcrematch_entry_post ) { + struct pcrematch_entry* (*postHookFunc) (struct pcrematch_entry* retVal___, struct pcrematch_set *set); + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_create_pcrematch_entry_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_npc_chat_create_pcrematch_entry_post[hIndex].func; + retVal___ = postHookFunc(retVal___, set); + } + } + return retVal___; +} +void HP_npc_chat_delete_pcreset(struct npc_data *nd, int setid) { + int hIndex = 0; + if( HPMHooks.count.HP_npc_chat_delete_pcreset_pre ) { + void (*preHookFunc) (struct npc_data *nd, int *setid); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_delete_pcreset_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_npc_chat_delete_pcreset_pre[hIndex].func; + preHookFunc(nd, &setid); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.npc_chat.delete_pcreset(nd, setid); + } + if( HPMHooks.count.HP_npc_chat_delete_pcreset_post ) { + void (*postHookFunc) (struct npc_data *nd, int *setid); + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_delete_pcreset_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_npc_chat_delete_pcreset_post[hIndex].func; + postHookFunc(nd, &setid); + } + } + return; +} +void HP_npc_chat_deactivate_pcreset(struct npc_data *nd, int setid) { + int hIndex = 0; + if( HPMHooks.count.HP_npc_chat_deactivate_pcreset_pre ) { + void (*preHookFunc) (struct npc_data *nd, int *setid); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_deactivate_pcreset_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_npc_chat_deactivate_pcreset_pre[hIndex].func; + preHookFunc(nd, &setid); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.npc_chat.deactivate_pcreset(nd, setid); + } + if( HPMHooks.count.HP_npc_chat_deactivate_pcreset_post ) { + void (*postHookFunc) (struct npc_data *nd, int *setid); + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_deactivate_pcreset_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_npc_chat_deactivate_pcreset_post[hIndex].func; + postHookFunc(nd, &setid); + } + } + return; +} +void HP_npc_chat_activate_pcreset(struct npc_data *nd, int setid) { + int hIndex = 0; + if( HPMHooks.count.HP_npc_chat_activate_pcreset_pre ) { + void (*preHookFunc) (struct npc_data *nd, int *setid); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_activate_pcreset_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_npc_chat_activate_pcreset_pre[hIndex].func; + preHookFunc(nd, &setid); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.npc_chat.activate_pcreset(nd, setid); + } + if( HPMHooks.count.HP_npc_chat_activate_pcreset_post ) { + void (*postHookFunc) (struct npc_data *nd, int *setid); + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_activate_pcreset_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_npc_chat_activate_pcreset_post[hIndex].func; + postHookFunc(nd, &setid); + } + } + return; +} +struct pcrematch_set* HP_npc_chat_lookup_pcreset(struct npc_data *nd, int setid) { + int hIndex = 0; + struct pcrematch_set* retVal___ = NULL; + if( HPMHooks.count.HP_npc_chat_lookup_pcreset_pre ) { + struct pcrematch_set* (*preHookFunc) (struct npc_data *nd, int *setid); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_lookup_pcreset_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_npc_chat_lookup_pcreset_pre[hIndex].func; + retVal___ = preHookFunc(nd, &setid); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.npc_chat.lookup_pcreset(nd, setid); + } + if( HPMHooks.count.HP_npc_chat_lookup_pcreset_post ) { + struct pcrematch_set* (*postHookFunc) (struct pcrematch_set* retVal___, struct npc_data *nd, int *setid); + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_lookup_pcreset_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_npc_chat_lookup_pcreset_post[hIndex].func; + retVal___ = postHookFunc(retVal___, nd, &setid); + } + } + return retVal___; +} +void HP_npc_chat_finalize_pcrematch_entry(struct pcrematch_entry *e) { + int hIndex = 0; + if( HPMHooks.count.HP_npc_chat_finalize_pcrematch_entry_pre ) { + void (*preHookFunc) (struct pcrematch_entry *e); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_finalize_pcrematch_entry_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_npc_chat_finalize_pcrematch_entry_pre[hIndex].func; + preHookFunc(e); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.npc_chat.finalize_pcrematch_entry(e); + } + if( HPMHooks.count.HP_npc_chat_finalize_pcrematch_entry_post ) { + void (*postHookFunc) (struct pcrematch_entry *e); + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_finalize_pcrematch_entry_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_npc_chat_finalize_pcrematch_entry_post[hIndex].func; + postHookFunc(e); + } + } + return; +} /* npc */ int HP_npc_init(bool minimal) { int hIndex = 0; @@ -48245,11 +48534,11 @@ struct npc_data* HP_npc_add_warp(char *name, short from_mapid, short from_x, sho } return retVal___; } -const char* HP_npc_parse_warp(char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { +const char* HP_npc_parse_warp(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { int hIndex = 0; const char* retVal___ = NULL; if( HPMHooks.count.HP_npc_parse_warp_pre ) { - const char* (*preHookFunc) (char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval); + const char* (*preHookFunc) (const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_warp_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_npc_parse_warp_pre[hIndex].func; @@ -48264,7 +48553,7 @@ const char* HP_npc_parse_warp(char *w1, char *w2, char *w3, char *w4, const char retVal___ = HPMHooks.source.npc.parse_warp(w1, w2, w3, w4, start, buffer, filepath, retval); } if( HPMHooks.count.HP_npc_parse_warp_post ) { - const char* (*postHookFunc) (const char* retVal___, char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval); + const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_warp_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_npc_parse_warp_post[hIndex].func; retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, retval); @@ -48272,11 +48561,11 @@ const char* HP_npc_parse_warp(char *w1, char *w2, char *w3, char *w4, const char } return retVal___; } -const char* HP_npc_parse_shop(char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { +const char* HP_npc_parse_shop(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { int hIndex = 0; const char* retVal___ = NULL; if( HPMHooks.count.HP_npc_parse_shop_pre ) { - const char* (*preHookFunc) (char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval); + const char* (*preHookFunc) (const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_shop_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_npc_parse_shop_pre[hIndex].func; @@ -48291,7 +48580,7 @@ const char* HP_npc_parse_shop(char *w1, char *w2, char *w3, char *w4, const char retVal___ = HPMHooks.source.npc.parse_shop(w1, w2, w3, w4, start, buffer, filepath, retval); } if( HPMHooks.count.HP_npc_parse_shop_post ) { - const char* (*postHookFunc) (const char* retVal___, char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval); + const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_shop_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_npc_parse_shop_post[hIndex].func; retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, retval); @@ -48299,11 +48588,11 @@ const char* HP_npc_parse_shop(char *w1, char *w2, char *w3, char *w4, const char } return retVal___; } -const char* HP_npc_parse_unknown_object(char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { +const char* HP_npc_parse_unknown_object(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { int hIndex = 0; const char* retVal___ = NULL; if( HPMHooks.count.HP_npc_parse_unknown_object_pre ) { - const char* (*preHookFunc) (char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval); + const char* (*preHookFunc) (const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_unknown_object_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_npc_parse_unknown_object_pre[hIndex].func; @@ -48318,7 +48607,7 @@ const char* HP_npc_parse_unknown_object(char *w1, char *w2, char *w3, char *w4, retVal___ = HPMHooks.source.npc.parse_unknown_object(w1, w2, w3, w4, start, buffer, filepath, retval); } if( HPMHooks.count.HP_npc_parse_unknown_object_post ) { - const char* (*postHookFunc) (const char* retVal___, char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval); + const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_unknown_object_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_npc_parse_unknown_object_post[hIndex].func; retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, retval); @@ -48379,11 +48668,11 @@ const char* HP_npc_skip_script(const char *start, const char *buffer, const char } return retVal___; } -const char* HP_npc_parse_script(char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval) { +const char* HP_npc_parse_script(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval) { int hIndex = 0; const char* retVal___ = NULL; if( HPMHooks.count.HP_npc_parse_script_pre ) { - const char* (*preHookFunc) (char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *options, int *retval); + const char* (*preHookFunc) (const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *options, int *retval); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_script_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_npc_parse_script_pre[hIndex].func; @@ -48398,7 +48687,7 @@ const char* HP_npc_parse_script(char *w1, char *w2, char *w3, char *w4, const ch retVal___ = HPMHooks.source.npc.parse_script(w1, w2, w3, w4, start, buffer, filepath, options, retval); } if( HPMHooks.count.HP_npc_parse_script_post ) { - const char* (*postHookFunc) (const char* retVal___, char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *options, int *retval); + const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *options, int *retval); for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_script_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_npc_parse_script_post[hIndex].func; retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, &options, retval); @@ -48540,11 +48829,11 @@ bool HP_npc_duplicate_sub(struct npc_data *nd, const struct npc_data *snd, int x } return retVal___; } -const char* HP_npc_parse_duplicate(char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval) { +const char* HP_npc_parse_duplicate(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval) { int hIndex = 0; const char* retVal___ = NULL; if( HPMHooks.count.HP_npc_parse_duplicate_pre ) { - const char* (*preHookFunc) (char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *options, int *retval); + const char* (*preHookFunc) (const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *options, int *retval); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_duplicate_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_npc_parse_duplicate_pre[hIndex].func; @@ -48559,7 +48848,7 @@ const char* HP_npc_parse_duplicate(char *w1, char *w2, char *w3, char *w4, const retVal___ = HPMHooks.source.npc.parse_duplicate(w1, w2, w3, w4, start, buffer, filepath, options, retval); } if( HPMHooks.count.HP_npc_parse_duplicate_post ) { - const char* (*postHookFunc) (const char* retVal___, char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *options, int *retval); + const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *options, int *retval); for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_duplicate_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_npc_parse_duplicate_post[hIndex].func; retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, &options, retval); @@ -48784,11 +49073,11 @@ int HP_npc_do_atcmd_event(struct map_session_data *sd, const char *command, cons } return retVal___; } -const char* HP_npc_parse_function(char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { +const char* HP_npc_parse_function(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { int hIndex = 0; const char* retVal___ = NULL; if( HPMHooks.count.HP_npc_parse_function_pre ) { - const char* (*preHookFunc) (char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval); + const char* (*preHookFunc) (const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_function_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_npc_parse_function_pre[hIndex].func; @@ -48803,7 +49092,7 @@ const char* HP_npc_parse_function(char *w1, char *w2, char *w3, char *w4, const retVal___ = HPMHooks.source.npc.parse_function(w1, w2, w3, w4, start, buffer, filepath, retval); } if( HPMHooks.count.HP_npc_parse_function_post ) { - const char* (*postHookFunc) (const char* retVal___, char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval); + const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_function_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_npc_parse_function_post[hIndex].func; retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, retval); @@ -48837,11 +49126,11 @@ void HP_npc_parse_mob2(struct spawn_data *mobspawn) { } return; } -const char* HP_npc_parse_mob(char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { +const char* HP_npc_parse_mob(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { int hIndex = 0; const char* retVal___ = NULL; if( HPMHooks.count.HP_npc_parse_mob_pre ) { - const char* (*preHookFunc) (char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval); + const char* (*preHookFunc) (const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_mob_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_npc_parse_mob_pre[hIndex].func; @@ -48856,7 +49145,7 @@ const char* HP_npc_parse_mob(char *w1, char *w2, char *w3, char *w4, const char retVal___ = HPMHooks.source.npc.parse_mob(w1, w2, w3, w4, start, buffer, filepath, retval); } if( HPMHooks.count.HP_npc_parse_mob_post ) { - const char* (*postHookFunc) (const char* retVal___, char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval); + const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_mob_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_npc_parse_mob_post[hIndex].func; retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, retval); @@ -48864,11 +49153,11 @@ const char* HP_npc_parse_mob(char *w1, char *w2, char *w3, char *w4, const char } return retVal___; } -const char* HP_npc_parse_mapflag(char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { +const char* HP_npc_parse_mapflag(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { int hIndex = 0; const char* retVal___ = NULL; if( HPMHooks.count.HP_npc_parse_mapflag_pre ) { - const char* (*preHookFunc) (char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval); + const char* (*preHookFunc) (const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_mapflag_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_npc_parse_mapflag_pre[hIndex].func; @@ -48883,7 +49172,7 @@ const char* HP_npc_parse_mapflag(char *w1, char *w2, char *w3, char *w4, const c retVal___ = HPMHooks.source.npc.parse_mapflag(w1, w2, w3, w4, start, buffer, filepath, retval); } if( HPMHooks.count.HP_npc_parse_mapflag_post ) { - const char* (*postHookFunc) (const char* retVal___, char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval); + const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_mapflag_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_npc_parse_mapflag_post[hIndex].func; retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, retval); @@ -48891,10 +49180,10 @@ const char* HP_npc_parse_mapflag(char *w1, char *w2, char *w3, char *w4, const c } return retVal___; } -void HP_npc_parse_unknown_mapflag(const char *name, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { +void HP_npc_parse_unknown_mapflag(const char *name, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { int hIndex = 0; if( HPMHooks.count.HP_npc_parse_unknown_mapflag_pre ) { - void (*preHookFunc) (const char *name, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval); + void (*preHookFunc) (const char *name, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_unknown_mapflag_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_npc_parse_unknown_mapflag_pre[hIndex].func; @@ -48909,7 +49198,7 @@ void HP_npc_parse_unknown_mapflag(const char *name, char *w3, char *w4, const ch HPMHooks.source.npc.parse_unknown_mapflag(name, w3, w4, start, buffer, filepath, retval); } if( HPMHooks.count.HP_npc_parse_unknown_mapflag_post ) { - void (*postHookFunc) (const char *name, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval); + void (*postHookFunc) (const char *name, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_unknown_mapflag_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_npc_parse_unknown_mapflag_post[hIndex].func; postHookFunc(name, w3, w4, start, buffer, filepath, retval); @@ -57122,6 +57411,221 @@ void HP_pc_update_idle_time(struct map_session_data *sd, enum e_battle_config_id } return; } +/* libpcre */ +pcre* HP_libpcre_compile(const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr) { + int hIndex = 0; + pcre* retVal___ = NULL; + if( HPMHooks.count.HP_libpcre_compile_pre ) { + pcre* (*preHookFunc) (const char *pattern, int *options, const char **errptr, int *erroffset, const unsigned char *tableptr); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_compile_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_libpcre_compile_pre[hIndex].func; + retVal___ = preHookFunc(pattern, &options, errptr, erroffset, tableptr); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.libpcre.compile(pattern, options, errptr, erroffset, tableptr); + } + if( HPMHooks.count.HP_libpcre_compile_post ) { + pcre* (*postHookFunc) (pcre* retVal___, const char *pattern, int *options, const char **errptr, int *erroffset, const unsigned char *tableptr); + for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_compile_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_libpcre_compile_post[hIndex].func; + retVal___ = postHookFunc(retVal___, pattern, &options, errptr, erroffset, tableptr); + } + } + return retVal___; +} +pcre_extra* HP_libpcre_study(const pcre *code, int options, const char **errptr) { + int hIndex = 0; + pcre_extra* retVal___ = NULL; + if( HPMHooks.count.HP_libpcre_study_pre ) { + pcre_extra* (*preHookFunc) (const pcre *code, int *options, const char **errptr); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_study_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_libpcre_study_pre[hIndex].func; + retVal___ = preHookFunc(code, &options, errptr); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.libpcre.study(code, options, errptr); + } + if( HPMHooks.count.HP_libpcre_study_post ) { + pcre_extra* (*postHookFunc) (pcre_extra* retVal___, const pcre *code, int *options, const char **errptr); + for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_study_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_libpcre_study_post[hIndex].func; + retVal___ = postHookFunc(retVal___, code, &options, errptr); + } + } + return retVal___; +} +int HP_libpcre_exec(const pcre *code, const pcre_extra *extra, const char *subject, int length, int startoffset, int options, int *ovector, int ovecsize) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_libpcre_exec_pre ) { + int (*preHookFunc) (const pcre *code, const pcre_extra *extra, const char *subject, int *length, int *startoffset, int *options, int *ovector, int *ovecsize); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_exec_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_libpcre_exec_pre[hIndex].func; + retVal___ = preHookFunc(code, extra, subject, &length, &startoffset, &options, ovector, &ovecsize); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.libpcre.exec(code, extra, subject, length, startoffset, options, ovector, ovecsize); + } + if( HPMHooks.count.HP_libpcre_exec_post ) { + int (*postHookFunc) (int retVal___, const pcre *code, const pcre_extra *extra, const char *subject, int *length, int *startoffset, int *options, int *ovector, int *ovecsize); + for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_exec_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_libpcre_exec_post[hIndex].func; + retVal___ = postHookFunc(retVal___, code, extra, subject, &length, &startoffset, &options, ovector, &ovecsize); + } + } + return retVal___; +} +void HP_libpcre_free(void *ptr) { + int hIndex = 0; + if( HPMHooks.count.HP_libpcre_free_pre ) { + void (*preHookFunc) (void *ptr); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_free_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_libpcre_free_pre[hIndex].func; + preHookFunc(ptr); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.libpcre.free(ptr); + } + if( HPMHooks.count.HP_libpcre_free_post ) { + void (*postHookFunc) (void *ptr); + for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_free_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_libpcre_free_post[hIndex].func; + postHookFunc(ptr); + } + } + return; +} +int HP_libpcre_copy_substring(const char *subject, int *ovector, int stringcount, int stringnumber, char *buffer, int buffersize) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_libpcre_copy_substring_pre ) { + int (*preHookFunc) (const char *subject, int *ovector, int *stringcount, int *stringnumber, char *buffer, int *buffersize); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_copy_substring_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_libpcre_copy_substring_pre[hIndex].func; + retVal___ = preHookFunc(subject, ovector, &stringcount, &stringnumber, buffer, &buffersize); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.libpcre.copy_substring(subject, ovector, stringcount, stringnumber, buffer, buffersize); + } + if( HPMHooks.count.HP_libpcre_copy_substring_post ) { + int (*postHookFunc) (int retVal___, const char *subject, int *ovector, int *stringcount, int *stringnumber, char *buffer, int *buffersize); + for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_copy_substring_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_libpcre_copy_substring_post[hIndex].func; + retVal___ = postHookFunc(retVal___, subject, ovector, &stringcount, &stringnumber, buffer, &buffersize); + } + } + return retVal___; +} +void HP_libpcre_free_substring(const char *stringptr) { + int hIndex = 0; + if( HPMHooks.count.HP_libpcre_free_substring_pre ) { + void (*preHookFunc) (const char *stringptr); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_free_substring_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_libpcre_free_substring_pre[hIndex].func; + preHookFunc(stringptr); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.libpcre.free_substring(stringptr); + } + if( HPMHooks.count.HP_libpcre_free_substring_post ) { + void (*postHookFunc) (const char *stringptr); + for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_free_substring_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_libpcre_free_substring_post[hIndex].func; + postHookFunc(stringptr); + } + } + return; +} +int HP_libpcre_copy_named_substring(const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, char *buffer, int buffersize) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_libpcre_copy_named_substring_pre ) { + int (*preHookFunc) (const pcre *code, const char *subject, int *ovector, int *stringcount, const char *stringname, char *buffer, int *buffersize); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_copy_named_substring_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_libpcre_copy_named_substring_pre[hIndex].func; + retVal___ = preHookFunc(code, subject, ovector, &stringcount, stringname, buffer, &buffersize); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.libpcre.copy_named_substring(code, subject, ovector, stringcount, stringname, buffer, buffersize); + } + if( HPMHooks.count.HP_libpcre_copy_named_substring_post ) { + int (*postHookFunc) (int retVal___, const pcre *code, const char *subject, int *ovector, int *stringcount, const char *stringname, char *buffer, int *buffersize); + for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_copy_named_substring_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_libpcre_copy_named_substring_post[hIndex].func; + retVal___ = postHookFunc(retVal___, code, subject, ovector, &stringcount, stringname, buffer, &buffersize); + } + } + return retVal___; +} +int HP_libpcre_get_substring(const char *subject, int *ovector, int stringcount, int stringnumber, const char **stringptr) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_libpcre_get_substring_pre ) { + int (*preHookFunc) (const char *subject, int *ovector, int *stringcount, int *stringnumber, const char **stringptr); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_get_substring_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_libpcre_get_substring_pre[hIndex].func; + retVal___ = preHookFunc(subject, ovector, &stringcount, &stringnumber, stringptr); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.libpcre.get_substring(subject, ovector, stringcount, stringnumber, stringptr); + } + if( HPMHooks.count.HP_libpcre_get_substring_post ) { + int (*postHookFunc) (int retVal___, const char *subject, int *ovector, int *stringcount, int *stringnumber, const char **stringptr); + for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_get_substring_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_libpcre_get_substring_post[hIndex].func; + retVal___ = postHookFunc(retVal___, subject, ovector, &stringcount, &stringnumber, stringptr); + } + } + return retVal___; +} /* pet */ int HP_pet_init(bool minimal) { int hIndex = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_map.sources.inc b/src/plugins/HPMHooking/HPMHooking_map.sources.inc index 024febdf8..bab4f3931 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.sources.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.sources.inc @@ -1,8 +1,27 @@ -// Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// See the LICENSE file -// -// NOTE: This file was auto-generated and should never be manually edited, -// as it will get overwritten. +/** + * This file is part of Hercules. + * http://herc.ws - http://github.com/HerculesWS/Hercules + * + * Copyright (C) 2013-2015 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* + * NOTE: This file was auto-generated and should never be manually edited, + * as it will get overwritten. + */ memcpy(&HPMHooks.source.HCache, HCache, sizeof(struct HCache_interface)); memcpy(&HPMHooks.source.atcommand, atcommand, sizeof(struct atcommand_interface)); @@ -36,12 +55,14 @@ memcpy(&HPMHooks.source.mapit, mapit, sizeof(struct mapit_interface)); memcpy(&HPMHooks.source.mapreg, mapreg, sizeof(struct mapreg_interface)); memcpy(&HPMHooks.source.mercenary, mercenary, sizeof(struct mercenary_interface)); memcpy(&HPMHooks.source.mob, mob, sizeof(struct mob_interface)); +memcpy(&HPMHooks.source.npc_chat, npc_chat, sizeof(struct npc_chat_interface)); memcpy(&HPMHooks.source.npc, npc, sizeof(struct npc_interface)); memcpy(&HPMHooks.source.nullpo, nullpo, sizeof(struct nullpo_interface)); memcpy(&HPMHooks.source.party, party, sizeof(struct party_interface)); memcpy(&HPMHooks.source.path, path, sizeof(struct path_interface)); memcpy(&HPMHooks.source.pcg, pcg, sizeof(struct pc_groups_interface)); memcpy(&HPMHooks.source.pc, pc, sizeof(struct pc_interface)); +memcpy(&HPMHooks.source.libpcre, libpcre, sizeof(struct pcre_interface)); memcpy(&HPMHooks.source.pet, pet, sizeof(struct pet_interface)); memcpy(&HPMHooks.source.quest, quest, sizeof(struct quest_interface)); memcpy(&HPMHooks.source.script, script, sizeof(struct script_interface)); diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in index e2ae0b8c3..6e8e3bfac 100644 --- a/src/plugins/Makefile.in +++ b/src/plugins/Makefile.in @@ -1,5 +1,20 @@ -# Copyright (c) Hercules Dev Team, licensed under GNU GPL. -# See the LICENSE file +# This file is part of Hercules. +# http://herc.ws - http://github.com/HerculesWS/Hercules +# +# Copyright (C) 2013-2015 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 +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. # @configure_input@ diff --git a/src/plugins/db2sql.c b/src/plugins/db2sql.c index 6d4a7789c..5b5d79bac 100644 --- a/src/plugins/db2sql.c +++ b/src/plugins/db2sql.c @@ -1,6 +1,22 @@ -// Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// See the LICENSE file - +/** + * This file is part of Hercules. + * http://herc.ws - http://github.com/HerculesWS/Hercules + * + * Copyright (C) 2013-2015 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ #include "config/core.h" #include "common/hercules.h" @@ -238,7 +254,30 @@ int db2sql(config_setting_t *entry, int n, const char *source) { return it?it->nameid:0; } void totable(void) { + time_t t; + struct tm *lt; + t = time(NULL); + lt = localtime(&t); + int year = lt->tm_year+1900; fprintf(tosql.fp, + "-- 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" + "--\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" + "-- the Free Software Foundation, either version 3 of the License, or\n" + "-- (at your option) any later version.\n" + "--\n" + "-- This program is distributed in the hope that it will be useful,\n" + "-- but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + "-- GNU General Public License for more details.\n" + "--\n" + "-- You should have received a copy of the GNU General Public License\n" + "-- along with this program. If not, see <http://www.gnu.org/licenses/>.\n\n" + "-- NOTE: This file was auto-generated and should never be manually edited,\n" "-- as it will get overwritten. If you need to modify this file,\n" "-- please consider modifying the corresponding .conf file inside\n" @@ -287,7 +326,7 @@ void totable(void) { " `unequip_script` text,\n" " PRIMARY KEY (`id`)\n" ") ENGINE=MyISAM;\n" - "\n",tosql.db_name,tosql.db_name,tosql.db_name); + "\n", year, tosql.db_name,tosql.db_name,tosql.db_name); } void do_db2sql(void) { /* link */ diff --git a/src/plugins/dbghelpplug.c b/src/plugins/dbghelpplug.c index b5f1fe485..edd47814d 100644 --- a/src/plugins/dbghelpplug.c +++ b/src/plugins/dbghelpplug.c @@ -1,6 +1,23 @@ -// Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// See the LICENSE file -// Portions Copyright (c) Athena Dev Teams +/** + * This file is part of Hercules. + * http://herc.ws - http://github.com/HerculesWS/Hercules + * + * Copyright (C) 2012-2015 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ // Ported from eAthena Dev Team's version @ http://eathena-project.googlecode.com/svn/trunk/src/plugins/dbghelpplug.c // Currently supported dbghelp 5.1 diff --git a/src/plugins/sample.c b/src/plugins/sample.c index fea25514b..1ddecdc66 100644 --- a/src/plugins/sample.c +++ b/src/plugins/sample.c @@ -1,6 +1,24 @@ -// Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// See the LICENSE file -// Sample Hercules Plugin +/** + * This file is part of Hercules. + * http://herc.ws - http://github.com/HerculesWS/Hercules + * + * Copyright (C) 2013-2015 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/// Sample Hercules Plugin #include "common/hercules.h" /* Should always be the first Hercules file included! (if you don't make it first, you won't be able to use interfaces) */ #include "common/memmgr.h" @@ -40,6 +58,8 @@ struct sample_data_struct { unsigned int someNumber; }; +int my_setting; + /* sample packet implementation */ /* cmd 0xf3 - it is a client-server existent id, for clif_parse_GlobalMessage */ /* in this sample we do nothing and simply redirect */ @@ -111,10 +131,31 @@ int my_pc_dropitem_post(int retVal, struct map_session_data *sd,int *n,int *amou } return 1; } -void parse_my_setting(const char *val) { - ShowDebug("Received 'my_setting:%s'\n",val); +/* +* Key is the setting name in our example it's 'my_setting' while val is the value of it. +* this way you can manage more than one setting in one function instead of define multiable ones +*/ + +void parse_my_setting(const char *key, const char *val) { + ShowDebug("Received '%s:%s'\n",key,val); /* do anything with the var e.g. config_switch(val) */ + /* for our example we will save it in global variable */ + + /* please note, battle settings can be only returned as int for scripts and other usage */ + if (strcmpi(key,"my_setting") == 0) + my_setting = atoi(val); +} + +/* Battle Config Settings need to have return function in-case scripts need to read it */ +int return_my_setting(const char *key) +{ + /* first we check the key to know what setting we need to return with strcmpi then return it */ + if (strcmpi(key, "my_setting") == 0) + return my_setting; + + return 0; } + /* run when server starts */ HPExport void plugin_init (void) { ShowInfo("Server type is "); @@ -127,13 +168,19 @@ HPExport void plugin_init (void) { ShowInfo("I'm being run from the '%s' filename\n", SERVER_NAME); - /* addAtcommand("command-key",command-function) tells map server to call ACMD(sample) when "sample" command is used */ - /* - it will print a warning when used on a non-map-server plugin */ - addAtcommand("sample",sample);//link our '@sample' command + // Atcommands only make sense on the map server + if (SERVER_TYPE == SERVER_TYPE_MAP) { + /* addAtcommand("command-key",command-function) tells map server to call ACMD(sample) when "sample" command is used */ + /* - it will print a warning when used on a non-map-server plugin */ + addAtcommand("sample",sample);//link our '@sample' command + } - /* addScriptCommand("script-command-name","script-command-params-info",script-function) tells map server to call BUILDIN(sample) for the "sample(i)" command */ - /* - it will print a warning when used on a non-map-server plugin */ - addScriptCommand("sample","i",sample); + // Script commands only make sense on the map server + if (SERVER_TYPE == SERVER_TYPE_MAP) { + /* addScriptCommand("script-command-name","script-command-params-info",script-function) tells map server to call BUILDIN(sample) for the "sample(i)" command */ + /* - it will print a warning when used on a non-map-server plugin */ + addScriptCommand("sample","i",sample); + } /* addCPCommand("console-command-name",command-function) tells server to call CPCMD(sample) for the 'this is a sample <optional-args>' console call */ /* in "console-command-name" usage of ':' indicates a category, for example 'this:is:a:sample' translates to 'this is a sample', @@ -147,23 +194,26 @@ HPExport void plugin_init (void) { * to trigger packetFunction in the packetIncomingPoint section ( available points listed in enum HPluginPacketHookingPoints within src/common/HPMi.h ) */ addPacket(0xf3,-1,sample_packet0f3,hpClif_Parse); - /* in this sample we add a PreHook to pc->dropitem */ - /* to identify whether the item being dropped is on amount higher than 1 */ - /* if so, it stores the amount on a variable (my_pc_dropitem_storage) and changes the amount to 1 */ - addHookPre("pc->dropitem",my_pc_dropitem_pre); - - /* in this sample we add a PostHook to pc->dropitem */ - /* if the original pc->dropitem was successful and the amount stored on my_pc_dropitem_storage is higher than 1, */ - /* our posthook will display a message to the user about the cap */ - /* - by checking whether it was successful (retVal value) it allows for the originals conditions to take place */ - addHookPost("pc->dropitem",my_pc_dropitem_post); + // The following hooks would show an error message where pc->dropitem doesn't exist (login or char server) + if (SERVER_TYPE == SERVER_TYPE_MAP) { + /* in this sample we add a PreHook to pc->dropitem */ + /* to identify whether the item being dropped is on amount higher than 1 */ + /* if so, it stores the amount on a variable (my_pc_dropitem_storage) and changes the amount to 1 */ + addHookPre("pc->dropitem",my_pc_dropitem_pre); + + /* in this sample we add a PostHook to pc->dropitem */ + /* if the original pc->dropitem was successful and the amount stored on my_pc_dropitem_storage is higher than 1, */ + /* our posthook will display a message to the user about the cap */ + /* - by checking whether it was successful (retVal value) it allows for the originals conditions to take place */ + addHookPost("pc->dropitem",my_pc_dropitem_post); + } } /* triggered when server starts loading, before any server-specific data is set */ HPExport void server_preinit (void) { /* makes map server listen to mysetting:value in any "battleconf" file (including imported or custom ones) */ /* value is not limited to numbers, its passed to our plugins handler (parse_my_setting) as const char *, - * and thus can be manipulated at will */ - addBattleConf("my_setting",parse_my_setting); + * however for battle config to be returned to our script engine we need it to be number (int) so keep use it as int only */ + addBattleConf("my_setting",parse_my_setting,return_my_setting); } /* run when server is ready (online) */ HPExport void server_online (void) { diff --git a/src/plugins/script_mapquit.c b/src/plugins/script_mapquit.c index 8ed108f82..767292f2d 100644 --- a/src/plugins/script_mapquit.c +++ b/src/plugins/script_mapquit.c @@ -1,21 +1,24 @@ -/* - * Copyright (c) 2014 Hercules Dev Team - * Base author: Haru <haru@dotalux.com> +/** + * This file is part of Hercules. + * http://herc.ws - http://github.com/HerculesWS/Hercules * - * This plugin is free software: you can redistribute it and/or modify + * Copyright (C) 2014-2015 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 * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This plugin is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this plugin. If not, see <http://www.gnu.org/licenses/>. + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +/// Base author: Haru <haru@dotalux.com> /// mapquit() script command #include "common/hercules.h" |