diff options
author | shennetsind <ind@henn.et> | 2013-11-06 15:11:23 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-11-06 15:11:23 -0200 |
commit | d932913f398d935347ba05de16e8616e1d89d220 (patch) | |
tree | 635bf1a3da4aedddd7e4bb39e3ebba1ed20df697 /src | |
parent | 6f77d070b98c73962a4f45f274a0f5c58a2448e3 (diff) | |
parent | 0a5abb6de766be6a5068da08eb6477e343f2d7b3 (diff) | |
download | hercules-d932913f398d935347ba05de16e8616e1d89d220.tar.gz hercules-d932913f398d935347ba05de16e8616e1d89d220.tar.bz2 hercules-d932913f398d935347ba05de16e8616e1d89d220.tar.xz hercules-d932913f398d935347ba05de16e8616e1d89d220.zip |
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.GetSymbol.inc | 1 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc | 49 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.HookingPoints.inc | 13 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Hooks.inc | 316 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.sources.inc | 1 |
5 files changed, 377 insertions, 3 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.GetSymbol.inc b/src/plugins/HPMHooking/HPMHooking.GetSymbol.inc index c3845675c..8482b9f80 100644 --- a/src/plugins/HPMHooking/HPMHooking.GetSymbol.inc +++ b/src/plugins/HPMHooking/HPMHooking.GetSymbol.inc @@ -30,6 +30,7 @@ if( !(mob = GET_SYMBOL("mob") ) ) return false; if( !(npc = GET_SYMBOL("npc") ) ) return false; if( !(party = GET_SYMBOL("party") ) ) return false; if( !(path = GET_SYMBOL("path") ) ) return false; +if( !(pcg = GET_SYMBOL("pc_groups") ) ) return false; if( !(pc = GET_SYMBOL("pc") ) ) return false; if( !(pet = GET_SYMBOL("pet") ) ) return false; if( !(quest = GET_SYMBOL("quest") ) ) return false; diff --git a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc index 9c4c5bc55..a4609ceed 100644 --- a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc @@ -3421,6 +3421,30 @@ struct { struct HPMHookPoint *HP_path_check_distance_post; struct HPMHookPoint *HP_path_distance_pre; struct HPMHookPoint *HP_path_distance_post; + struct HPMHookPoint *HP_pcg_init_pre; + struct HPMHookPoint *HP_pcg_init_post; + struct HPMHookPoint *HP_pcg_final_pre; + struct HPMHookPoint *HP_pcg_final_post; + struct HPMHookPoint *HP_pcg_reload_pre; + struct HPMHookPoint *HP_pcg_reload_post; + struct HPMHookPoint *HP_pcg_get_dummy_group_pre; + struct HPMHookPoint *HP_pcg_get_dummy_group_post; + struct HPMHookPoint *HP_pcg_exists_pre; + struct HPMHookPoint *HP_pcg_exists_post; + struct HPMHookPoint *HP_pcg_id2group_pre; + struct HPMHookPoint *HP_pcg_id2group_post; + struct HPMHookPoint *HP_pcg_has_permission_pre; + struct HPMHookPoint *HP_pcg_has_permission_post; + struct HPMHookPoint *HP_pcg_should_log_commands_pre; + struct HPMHookPoint *HP_pcg_should_log_commands_post; + struct HPMHookPoint *HP_pcg_get_name_pre; + struct HPMHookPoint *HP_pcg_get_name_post; + struct HPMHookPoint *HP_pcg_get_level_pre; + struct HPMHookPoint *HP_pcg_get_level_post; + struct HPMHookPoint *HP_pcg_get_idx_pre; + struct HPMHookPoint *HP_pcg_get_idx_post; + struct HPMHookPoint *HP_pcg_add_permission_pre; + struct HPMHookPoint *HP_pcg_add_permission_post; struct HPMHookPoint *HP_pc_init_pre; struct HPMHookPoint *HP_pc_init_post; struct HPMHookPoint *HP_pc_final_pre; @@ -8324,6 +8348,30 @@ struct { int HP_path_check_distance_post; int HP_path_distance_pre; int HP_path_distance_post; + int HP_pcg_init_pre; + int HP_pcg_init_post; + int HP_pcg_final_pre; + int HP_pcg_final_post; + int HP_pcg_reload_pre; + int HP_pcg_reload_post; + int HP_pcg_get_dummy_group_pre; + int HP_pcg_get_dummy_group_post; + int HP_pcg_exists_pre; + int HP_pcg_exists_post; + int HP_pcg_id2group_pre; + int HP_pcg_id2group_post; + int HP_pcg_has_permission_pre; + int HP_pcg_has_permission_post; + int HP_pcg_should_log_commands_pre; + int HP_pcg_should_log_commands_post; + int HP_pcg_get_name_pre; + int HP_pcg_get_name_post; + int HP_pcg_get_level_pre; + int HP_pcg_get_level_post; + int HP_pcg_get_idx_pre; + int HP_pcg_get_idx_post; + int HP_pcg_add_permission_pre; + int HP_pcg_add_permission_post; int HP_pc_init_pre; int HP_pc_init_post; int HP_pc_final_pre; @@ -9837,6 +9885,7 @@ struct { struct npc_interface npc; struct party_interface party; struct path_interface path; + struct pc_groups_interface pcg; struct pc_interface pc; struct pet_interface pet; struct quest_interface quest; diff --git a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc index 75fcdac54..7e357b142 100644 --- a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc @@ -1739,6 +1739,19 @@ struct HookingPointData HookingPoints[] = { { HP_POP(path->search_long, HP_path_search_long) }, { HP_POP(path->check_distance, HP_path_check_distance) }, { HP_POP(path->distance, HP_path_distance) }, +/* pcg */ + { HP_POP(pcg->init, HP_pcg_init) }, + { HP_POP(pcg->final, HP_pcg_final) }, + { HP_POP(pcg->reload, HP_pcg_reload) }, + { HP_POP(pcg->get_dummy_group, HP_pcg_get_dummy_group) }, + { HP_POP(pcg->exists, HP_pcg_exists) }, + { HP_POP(pcg->id2group, HP_pcg_id2group) }, + { HP_POP(pcg->has_permission, HP_pcg_has_permission) }, + { HP_POP(pcg->should_log_commands, HP_pcg_should_log_commands) }, + { HP_POP(pcg->get_name, HP_pcg_get_name) }, + { HP_POP(pcg->get_level, HP_pcg_get_level) }, + { HP_POP(pcg->get_idx, HP_pcg_get_idx) }, + { HP_POP(pcg->add_permission, HP_pcg_add_permission) }, /* pc */ { HP_POP(pc->init, HP_pc_init) }, { HP_POP(pc->final, HP_pc_final) }, diff --git a/src/plugins/HPMHooking/HPMHooking.Hooks.inc b/src/plugins/HPMHooking/HPMHooking.Hooks.inc index 178369035..91b7e9909 100644 --- a/src/plugins/HPMHooking/HPMHooking.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking.Hooks.inc @@ -44066,6 +44066,316 @@ unsigned int HP_path_distance(int dx, int dy) { } return retVal___; } +/* pcg */ +void HP_pcg_init(void) { + int hIndex = 0; + if( HPMHooks.count.HP_pcg_init_pre ) { + void (*preHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_init_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_pcg_init_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.pcg.init(); + } + if( HPMHooks.count.HP_pcg_init_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_init_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_pcg_init_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_pcg_final(void) { + int hIndex = 0; + if( HPMHooks.count.HP_pcg_final_pre ) { + void (*preHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_final_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_pcg_final_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.pcg.final(); + } + if( HPMHooks.count.HP_pcg_final_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_final_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_pcg_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_pcg_reload(void) { + int hIndex = 0; + if( HPMHooks.count.HP_pcg_reload_pre ) { + void (*preHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_reload_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_pcg_reload_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.pcg.reload(); + } + if( HPMHooks.count.HP_pcg_reload_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_reload_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_pcg_reload_post[hIndex].func; + postHookFunc(); + } + } + return; +} +GroupSettings* HP_pcg_get_dummy_group(void) { + int hIndex = 0; + GroupSettings* retVal___ = NULL; + if( HPMHooks.count.HP_pcg_get_dummy_group_pre ) { + GroupSettings* (*preHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_dummy_group_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_pcg_get_dummy_group_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pcg.get_dummy_group(); + } + if( HPMHooks.count.HP_pcg_get_dummy_group_post ) { + GroupSettings* (*postHookFunc) (GroupSettings* retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_dummy_group_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_pcg_get_dummy_group_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +bool HP_pcg_exists(int group_id) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_pcg_exists_pre ) { + bool (*preHookFunc) (int *group_id); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_exists_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_pcg_exists_pre[hIndex].func; + retVal___ = preHookFunc(&group_id); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pcg.exists(group_id); + } + if( HPMHooks.count.HP_pcg_exists_post ) { + bool (*postHookFunc) (bool retVal___, int *group_id); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_exists_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_pcg_exists_post[hIndex].func; + retVal___ = postHookFunc(retVal___, &group_id); + } + } + return retVal___; +} +GroupSettings* HP_pcg_id2group(int group_id) { + int hIndex = 0; + GroupSettings* retVal___ = NULL; + if( HPMHooks.count.HP_pcg_id2group_pre ) { + GroupSettings* (*preHookFunc) (int *group_id); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_id2group_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_pcg_id2group_pre[hIndex].func; + retVal___ = preHookFunc(&group_id); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pcg.id2group(group_id); + } + if( HPMHooks.count.HP_pcg_id2group_post ) { + GroupSettings* (*postHookFunc) (GroupSettings* retVal___, int *group_id); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_id2group_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_pcg_id2group_post[hIndex].func; + retVal___ = postHookFunc(retVal___, &group_id); + } + } + return retVal___; +} +bool HP_pcg_has_permission(GroupSettings *group, unsigned int permission) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_pcg_has_permission_pre ) { + bool (*preHookFunc) (GroupSettings *group, unsigned int *permission); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_has_permission_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_pcg_has_permission_pre[hIndex].func; + retVal___ = preHookFunc(group, &permission); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pcg.has_permission(group, permission); + } + if( HPMHooks.count.HP_pcg_has_permission_post ) { + bool (*postHookFunc) (bool retVal___, GroupSettings *group, unsigned int *permission); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_has_permission_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_pcg_has_permission_post[hIndex].func; + retVal___ = postHookFunc(retVal___, group, &permission); + } + } + return retVal___; +} +bool HP_pcg_should_log_commands(GroupSettings *group) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_pcg_should_log_commands_pre ) { + bool (*preHookFunc) (GroupSettings *group); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_should_log_commands_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_pcg_should_log_commands_pre[hIndex].func; + retVal___ = preHookFunc(group); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pcg.should_log_commands(group); + } + if( HPMHooks.count.HP_pcg_should_log_commands_post ) { + bool (*postHookFunc) (bool retVal___, GroupSettings *group); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_should_log_commands_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_pcg_should_log_commands_post[hIndex].func; + retVal___ = postHookFunc(retVal___, group); + } + } + return retVal___; +} +const char* HP_pcg_get_name(GroupSettings *group) { + int hIndex = 0; + const char* retVal___ = NULL; + if( HPMHooks.count.HP_pcg_get_name_pre ) { + const char* (*preHookFunc) (GroupSettings *group); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_name_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_pcg_get_name_pre[hIndex].func; + retVal___ = preHookFunc(group); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pcg.get_name(group); + } + if( HPMHooks.count.HP_pcg_get_name_post ) { + const char* (*postHookFunc) (const char* retVal___, GroupSettings *group); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_name_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_pcg_get_name_post[hIndex].func; + retVal___ = postHookFunc(retVal___, group); + } + } + return retVal___; +} +int HP_pcg_get_level(GroupSettings *group) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_pcg_get_level_pre ) { + int (*preHookFunc) (GroupSettings *group); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_level_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_pcg_get_level_pre[hIndex].func; + retVal___ = preHookFunc(group); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pcg.get_level(group); + } + if( HPMHooks.count.HP_pcg_get_level_post ) { + int (*postHookFunc) (int retVal___, GroupSettings *group); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_level_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_pcg_get_level_post[hIndex].func; + retVal___ = postHookFunc(retVal___, group); + } + } + return retVal___; +} +int HP_pcg_get_idx(GroupSettings *group) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_pcg_get_idx_pre ) { + int (*preHookFunc) (GroupSettings *group); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_idx_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_pcg_get_idx_pre[hIndex].func; + retVal___ = preHookFunc(group); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pcg.get_idx(group); + } + if( HPMHooks.count.HP_pcg_get_idx_post ) { + int (*postHookFunc) (int retVal___, GroupSettings *group); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_idx_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_pcg_get_idx_post[hIndex].func; + retVal___ = postHookFunc(retVal___, group); + } + } + return retVal___; +} +unsigned int HP_pcg_add_permission(const char *name) { + int hIndex = 0; + unsigned int retVal___ = 0; + if( HPMHooks.count.HP_pcg_add_permission_pre ) { + unsigned int (*preHookFunc) (const char *name); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_add_permission_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_pcg_add_permission_pre[hIndex].func; + retVal___ = preHookFunc(name); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pcg.add_permission(name); + } + if( HPMHooks.count.HP_pcg_add_permission_post ) { + unsigned int (*postHookFunc) (unsigned int retVal___, const char *name); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_add_permission_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_pcg_add_permission_post[hIndex].func; + retVal___ = postHookFunc(retVal___, name); + } + } + return retVal___; +} /* pc */ void HP_pc_init(void) { int hIndex = 0; @@ -44247,11 +44557,11 @@ bool HP_pc_can_use_command(struct map_session_data *sd, const char *command) { } return retVal___; } -bool HP_pc_has_permission(struct map_session_data *sd, enum e_pc_permission permission) { +bool HP_pc_has_permission(struct map_session_data *sd, unsigned int permission) { int hIndex = 0; bool retVal___ = false; if( HPMHooks.count.HP_pc_has_permission_pre ) { - bool (*preHookFunc) (struct map_session_data *sd, enum e_pc_permission *permission); + bool (*preHookFunc) (struct map_session_data *sd, unsigned int *permission); for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_has_permission_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_pc_has_permission_pre[hIndex].func; retVal___ = preHookFunc(sd, &permission); @@ -44265,7 +44575,7 @@ bool HP_pc_has_permission(struct map_session_data *sd, enum e_pc_permission perm retVal___ = HPMHooks.source.pc.has_permission(sd, permission); } if( HPMHooks.count.HP_pc_has_permission_post ) { - bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, enum e_pc_permission *permission); + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, unsigned int *permission); for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_has_permission_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_pc_has_permission_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd, &permission); diff --git a/src/plugins/HPMHooking/HPMHooking.sources.inc b/src/plugins/HPMHooking/HPMHooking.sources.inc index e6dd89814..53bb6bcad 100644 --- a/src/plugins/HPMHooking/HPMHooking.sources.inc +++ b/src/plugins/HPMHooking/HPMHooking.sources.inc @@ -30,6 +30,7 @@ memcpy(&HPMHooks.source.mob, mob, sizeof(struct mob_interface)); memcpy(&HPMHooks.source.npc, npc, sizeof(struct npc_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.pet, pet, sizeof(struct pet_interface)); memcpy(&HPMHooks.source.quest, quest, sizeof(struct quest_interface)); |