summaryrefslogtreecommitdiff
path: root/src/plugins/HPMHooking
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-03-31 00:16:48 +0200
committerHaru <haru@dotalux.com>2016-04-16 07:43:45 +0200
commit37cc46c5e02bc62a8b510fb53f5c2ed0f2ee5d5f (patch)
tree29e7903fc69228e1a4f0d534564ad17067e99735 /src/plugins/HPMHooking
parent75557000f11741217adbcd0c1cebf45c661da1c4 (diff)
downloadhercules-37cc46c5e02bc62a8b510fb53f5c2ed0f2ee5d5f.tar.gz
hercules-37cc46c5e02bc62a8b510fb53f5c2ed0f2ee5d5f.tar.bz2
hercules-37cc46c5e02bc62a8b510fb53f5c2ed0f2ee5d5f.tar.xz
hercules-37cc46c5e02bc62a8b510fb53f5c2ed0f2ee5d5f.zip
HPM Hooks Update
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/plugins/HPMHooking')
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc13
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc4
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.Hooks.inc43
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.sources.inc1
4 files changed, 48 insertions, 13 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc
index 537c88936..9775b94e4 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc
@@ -110,8 +110,10 @@ struct {
struct HPMHookPoint *HP_lclif_parse_packet_post;
struct HPMHookPoint *HP_lclif_parse_pre;
struct HPMHookPoint *HP_lclif_parse_post;
- struct HPMHookPoint *HP_lclif_parse_sub_pre;
- struct HPMHookPoint *HP_lclif_parse_sub_post;
+ struct HPMHookPoint *HP_PRIV__lclif_packetdb_loaddb_pre;
+ struct HPMHookPoint *HP_PRIV__lclif_packetdb_loaddb_post;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_sub_pre;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_sub_post;
struct HPMHookPoint *HP_libconfig_read_pre;
struct HPMHookPoint *HP_libconfig_read_post;
struct HPMHookPoint *HP_libconfig_write_pre;
@@ -719,8 +721,10 @@ struct {
int HP_lclif_parse_packet_post;
int HP_lclif_parse_pre;
int HP_lclif_parse_post;
- int HP_lclif_parse_sub_pre;
- int HP_lclif_parse_sub_post;
+ int HP_PRIV__lclif_packetdb_loaddb_pre;
+ int HP_PRIV__lclif_packetdb_loaddb_post;
+ int HP_PRIV__lclif_parse_sub_pre;
+ int HP_PRIV__lclif_parse_sub_post;
int HP_libconfig_read_pre;
int HP_libconfig_read_post;
int HP_libconfig_write_pre;
@@ -1248,6 +1252,7 @@ struct {
struct core_interface core;
struct db_interface DB;
struct lclif_interface lclif;
+ struct lclif_interface_private PRIV__lclif;
struct libconfig_interface libconfig;
struct login_interface login;
struct malloc_interface iMalloc;
diff --git a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc
index a5adac2d0..bcfebf443 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc
@@ -72,7 +72,9 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(lclif->packet, HP_lclif_packet) },
{ HP_POP(lclif->parse_packet, HP_lclif_parse_packet) },
{ HP_POP(lclif->parse, HP_lclif_parse) },
- { HP_POP(lclif->parse_sub, HP_lclif_parse_sub) },
+/* lclif_interface_private */
+ { HP_POP(lclif->p->packetdb_loaddb, HP_PRIV__lclif_packetdb_loaddb) },
+ { HP_POP(lclif->p->parse_sub, HP_PRIV__lclif_parse_sub) },
/* libconfig_interface */
{ HP_POP(libconfig->read, HP_libconfig_read) },
{ HP_POP(libconfig->write, HP_libconfig_write) },
diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc
index b7ff2b77b..81d31c99e 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc
@@ -1182,14 +1182,41 @@ int HP_lclif_parse(int fd) {
}
return retVal___;
}
-enum parsefunc_rcode HP_lclif_parse_sub(int fd, struct login_session_data *sd) {
+/* lclif_interface_private */
+void HP_PRIV__lclif_packetdb_loaddb(void) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_PRIV__lclif_packetdb_loaddb_pre ) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_packetdb_loaddb_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_PRIV__lclif_packetdb_loaddb_pre[hIndex].func;
+ preHookFunc();
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.PRIV__lclif.packetdb_loaddb();
+ }
+ if( HPMHooks.count.HP_PRIV__lclif_packetdb_loaddb_post ) {
+ void (*postHookFunc) (void);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_packetdb_loaddb_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_PRIV__lclif_packetdb_loaddb_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+enum parsefunc_rcode HP_PRIV__lclif_parse_sub(int fd, struct login_session_data *sd) {
int hIndex = 0;
enum parsefunc_rcode retVal___ = PACKET_UNKNOWN;
- if( HPMHooks.count.HP_lclif_parse_sub_pre ) {
+ if( HPMHooks.count.HP_PRIV__lclif_parse_sub_pre ) {
enum parsefunc_rcode (*preHookFunc) (int *fd, struct login_session_data *sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_lclif_parse_sub_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_lclif_parse_sub_pre[hIndex].func;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_sub_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_sub_pre[hIndex].func;
retVal___ = preHookFunc(&fd, sd);
}
if( *HPMforce_return ) {
@@ -1198,12 +1225,12 @@ enum parsefunc_rcode HP_lclif_parse_sub(int fd, struct login_session_data *sd) {
}
}
{
- retVal___ = HPMHooks.source.lclif.parse_sub(fd, sd);
+ retVal___ = HPMHooks.source.PRIV__lclif.parse_sub(fd, sd);
}
- if( HPMHooks.count.HP_lclif_parse_sub_post ) {
+ if( HPMHooks.count.HP_PRIV__lclif_parse_sub_post ) {
enum parsefunc_rcode (*postHookFunc) (enum parsefunc_rcode retVal___, int *fd, struct login_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_lclif_parse_sub_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_lclif_parse_sub_post[hIndex].func;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_sub_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, &fd, sd);
}
}
diff --git a/src/plugins/HPMHooking/HPMHooking_login.sources.inc b/src/plugins/HPMHooking/HPMHooking_login.sources.inc
index 871facdc1..1c1927619 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.sources.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.sources.inc
@@ -29,6 +29,7 @@ memcpy(&HPMHooks.source.console, console, sizeof(struct console_interface));
memcpy(&HPMHooks.source.core, core, sizeof(struct core_interface));
memcpy(&HPMHooks.source.DB, DB, sizeof(struct db_interface));
memcpy(&HPMHooks.source.lclif, lclif, sizeof(struct lclif_interface));
+memcpy(&HPMHooks.source.PRIV__lclif, lclif->p, sizeof(struct lclif_interface_private));
memcpy(&HPMHooks.source.libconfig, libconfig, sizeof(struct libconfig_interface));
memcpy(&HPMHooks.source.login, login, sizeof(struct login_interface));
memcpy(&HPMHooks.source.iMalloc, iMalloc, sizeof(struct malloc_interface));