summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHercules.ws <dev@herc.ws>2018-04-04 22:53:03 +0200
committerHerculesWSAPI <dev@herc.ws>2018-04-04 22:53:03 +0200
commit3a0badaffa02b29d11290dcb5ed8ccaf381e77e8 (patch)
tree27fa56f0eb6b9b9faae3c6006231c009a9a0e09e
parent53af9436ba90f619fb0dc4a6f9a28a81061420be (diff)
downloadhercules-3a0badaffa02b29d11290dcb5ed8ccaf381e77e8.tar.gz
hercules-3a0badaffa02b29d11290dcb5ed8ccaf381e77e8.tar.bz2
hercules-3a0badaffa02b29d11290dcb5ed8ccaf381e77e8.tar.xz
hercules-3a0badaffa02b29d11290dcb5ed8ccaf381e77e8.zip
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
-rw-r--r--src/common/HPMDataCheck.h2
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc4
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc8
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc52
5 files changed, 68 insertions, 0 deletions
diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h
index 30cb01857..884b05272 100644
--- a/src/common/HPMDataCheck.h
+++ b/src/common/HPMDataCheck.h
@@ -605,9 +605,11 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "PACKET_ZC_ADD_MEMBER_TO_GROUP", sizeof(struct PACKET_ZC_ADD_MEMBER_TO_GROUP), SERVER_TYPE_MAP },
{ "PACKET_ZC_CHECKNAME", sizeof(struct PACKET_ZC_CHECKNAME), SERVER_TYPE_MAP },
{ "PACKET_ZC_CLANINFO", sizeof(struct PACKET_ZC_CLANINFO), SERVER_TYPE_MAP },
+ { "PACKET_ZC_FORMATSTRING_MSG", sizeof(struct PACKET_ZC_FORMATSTRING_MSG), SERVER_TYPE_MAP },
{ "PACKET_ZC_GROUP_LIST", sizeof(struct PACKET_ZC_GROUP_LIST), SERVER_TYPE_MAP },
{ "PACKET_ZC_GROUP_LIST_SUB", sizeof(struct PACKET_ZC_GROUP_LIST_SUB), SERVER_TYPE_MAP },
{ "PACKET_ZC_MAIL_LIST", sizeof(struct PACKET_ZC_MAIL_LIST), SERVER_TYPE_MAP },
+ { "PACKET_ZC_MSG_COLOR", sizeof(struct PACKET_ZC_MSG_COLOR), SERVER_TYPE_MAP },
{ "PACKET_ZC_NOTIFY_CLAN_CHAT", sizeof(struct PACKET_ZC_NOTIFY_CLAN_CHAT), SERVER_TYPE_MAP },
{ "PACKET_ZC_NOTIFY_CLAN_CONNECTINFO", sizeof(struct PACKET_ZC_NOTIFY_CLAN_CONNECTINFO), SERVER_TYPE_MAP },
{ "PACKET_ZC_NOTIFY_UNREADMAIL", sizeof(struct PACKET_ZC_NOTIFY_UNREADMAIL), SERVER_TYPE_MAP },
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index da70abc12..ae503fa38 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -1452,6 +1452,10 @@ typedef void (*HPMHOOK_pre_clif_msgtable_num) (struct map_session_data **sd, uns
typedef void (*HPMHOOK_post_clif_msgtable_num) (struct map_session_data *sd, unsigned short msg_id, int value);
typedef void (*HPMHOOK_pre_clif_msgtable_skill) (struct map_session_data **sd, uint16 *skill_id, int *msg_id);
typedef void (*HPMHOOK_post_clif_msgtable_skill) (struct map_session_data *sd, uint16 skill_id, int msg_id);
+typedef void (*HPMHOOK_pre_clif_msgtable_str) (struct map_session_data **sd, uint16 *msg_id, const char **value);
+typedef void (*HPMHOOK_post_clif_msgtable_str) (struct map_session_data *sd, uint16 msg_id, const char *value);
+typedef void (*HPMHOOK_pre_clif_msgtable_color) (struct map_session_data **sd, uint16 *msg_id, uint32 *color);
+typedef void (*HPMHOOK_post_clif_msgtable_color) (struct map_session_data *sd, uint16 msg_id, uint32 color);
typedef void (*HPMHOOK_pre_clif_message) (const int *fd, const char **mes);
typedef void (*HPMHOOK_post_clif_message) (const int fd, const char *mes);
typedef void (*HPMHOOK_pre_clif_messageln) (const int *fd, const char **mes);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index d799b8693..4d15e4784 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -1046,6 +1046,10 @@ struct {
struct HPMHookPoint *HP_clif_msgtable_num_post;
struct HPMHookPoint *HP_clif_msgtable_skill_pre;
struct HPMHookPoint *HP_clif_msgtable_skill_post;
+ struct HPMHookPoint *HP_clif_msgtable_str_pre;
+ struct HPMHookPoint *HP_clif_msgtable_str_post;
+ struct HPMHookPoint *HP_clif_msgtable_color_pre;
+ struct HPMHookPoint *HP_clif_msgtable_color_post;
struct HPMHookPoint *HP_clif_message_pre;
struct HPMHookPoint *HP_clif_message_post;
struct HPMHookPoint *HP_clif_messageln_pre;
@@ -7333,6 +7337,10 @@ struct {
int HP_clif_msgtable_num_post;
int HP_clif_msgtable_skill_pre;
int HP_clif_msgtable_skill_post;
+ int HP_clif_msgtable_str_pre;
+ int HP_clif_msgtable_str_post;
+ int HP_clif_msgtable_color_pre;
+ int HP_clif_msgtable_color_post;
int HP_clif_message_pre;
int HP_clif_message_post;
int HP_clif_messageln_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 045c8a087..6191bea21 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -546,6 +546,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->msgtable, HP_clif_msgtable) },
{ HP_POP(clif->msgtable_num, HP_clif_msgtable_num) },
{ HP_POP(clif->msgtable_skill, HP_clif_msgtable_skill) },
+ { HP_POP(clif->msgtable_str, HP_clif_msgtable_str) },
+ { HP_POP(clif->msgtable_color, HP_clif_msgtable_color) },
{ HP_POP(clif->message, HP_clif_message) },
{ HP_POP(clif->messageln, HP_clif_messageln) },
{ HP_POP(clif->process_chat_message, HP_clif_process_chat_message) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 22129c026..51206c6f5 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -13622,6 +13622,58 @@ void HP_clif_msgtable_skill(struct map_session_data *sd, uint16 skill_id, int ms
}
return;
}
+void HP_clif_msgtable_str(struct map_session_data *sd, uint16 msg_id, const char *value) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_msgtable_str_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, uint16 *msg_id, const char **value);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_msgtable_str_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_msgtable_str_pre[hIndex].func;
+ preHookFunc(&sd, &msg_id, &value);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.msgtable_str(sd, msg_id, value);
+ }
+ if (HPMHooks.count.HP_clif_msgtable_str_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, uint16 msg_id, const char *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_msgtable_str_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_msgtable_str_post[hIndex].func;
+ postHookFunc(sd, msg_id, value);
+ }
+ }
+ return;
+}
+void HP_clif_msgtable_color(struct map_session_data *sd, uint16 msg_id, uint32 color) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_msgtable_color_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, uint16 *msg_id, uint32 *color);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_msgtable_color_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_msgtable_color_pre[hIndex].func;
+ preHookFunc(&sd, &msg_id, &color);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.msgtable_color(sd, msg_id, color);
+ }
+ if (HPMHooks.count.HP_clif_msgtable_color_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, uint16 msg_id, uint32 color);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_msgtable_color_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_msgtable_color_post[hIndex].func;
+ postHookFunc(sd, msg_id, color);
+ }
+ }
+ return;
+}
void HP_clif_message(const int fd, const char *mes) {
int hIndex = 0;
if (HPMHooks.count.HP_clif_message_pre > 0) {