diff options
-rw-r--r-- | src/char/int_guild.c | 1 | ||||
-rw-r--r-- | src/char/int_party.c | 1 | ||||
-rw-r--r-- | src/char/inter.c | 95 | ||||
-rw-r--r-- | src/char/inter.h | 11 | ||||
-rw-r--r-- | src/char/mapif.c | 198 | ||||
-rw-r--r-- | src/char/mapif.h | 13 | ||||
-rw-r--r-- | src/common/HPMDataCheck.h | 1 | ||||
-rw-r--r-- | src/map/atcommand.c | 10 | ||||
-rw-r--r-- | src/map/clif.c | 12 | ||||
-rw-r--r-- | src/map/guild.c | 22 | ||||
-rw-r--r-- | src/map/guild.h | 1 | ||||
-rw-r--r-- | src/map/intif.c | 329 | ||||
-rw-r--r-- | src/map/intif.h | 13 | ||||
-rw-r--r-- | src/map/party.c | 25 | ||||
-rw-r--r-- | src/map/party.h | 1 | ||||
-rw-r--r-- | src/map/pc.c | 54 | ||||
-rw-r--r-- | src/map/pc.h | 2 | ||||
-rw-r--r-- | src/map/script.c | 20 | ||||
-rw-r--r-- | src/map/trade.c | 6 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 68 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc | 68 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc | 17 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_char.Hooks.inc | 463 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc | 68 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 17 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 466 |
26 files changed, 169 insertions, 1813 deletions
diff --git a/src/char/int_guild.c b/src/char/int_guild.c index 8e05c76e2..87cb3bee0 100644 --- a/src/char/int_guild.c +++ b/src/char/int_guild.c @@ -1612,7 +1612,6 @@ static int inter_guild_parse_frommap(int fd) case 0x3034: mapif->parse_GuildLeave(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOB(fd,14), RFIFOP(fd,15)); break; case 0x3035: mapif->parse_GuildChangeMemberInfoShort(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOL(fd,15),RFIFOL(fd,19)); break; case 0x3036: mapif->parse_BreakGuild(fd,RFIFOL(fd,2)); break; - case 0x3037: mapif->parse_GuildMessage(fd, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12), RFIFOW(fd,2)-12); break; case 0x3039: mapif->parse_GuildBasicInfoChange(fd, RFIFOL(fd,4), RFIFOW(fd,8), RFIFOP(fd,10), RFIFOW(fd,2)-10); break; case 0x303A: mapif->parse_GuildMemberInfoChange(fd, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOL(fd,12), RFIFOW(fd,16), RFIFOP(fd,18), RFIFOW(fd,2)-18); break; case 0x303B: mapif->parse_GuildPosition(fd, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12)); break; diff --git a/src/char/int_party.c b/src/char/int_party.c index 8ee03ecc5..c27d708f2 100644 --- a/src/char/int_party.c +++ b/src/char/int_party.c @@ -599,7 +599,6 @@ static int inter_party_parse_frommap(int fd) case 0x3024: mapif->parse_PartyLeave(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10)); break; case 0x3025: mapif->parse_PartyChangeMap(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOW(fd,14), RFIFOB(fd,16), RFIFOW(fd,17)); break; case 0x3026: mapif->parse_BreakParty(fd, RFIFOL(fd,2)); break; - case 0x3027: mapif->parse_PartyMessage(fd, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12), RFIFOW(fd,2)-12); break; case 0x3029: mapif->parse_PartyLeaderChange(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10)); break; default: return 0; diff --git a/src/char/inter.c b/src/char/inter.c index 64c840c16..264327289 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -53,9 +53,6 @@ #include <stdio.h> #include <stdlib.h> -#define WISDATA_TTL (60*1000) // Wis data Time To Live (60 seconds) -#define WISDELLIST_MAX 256 // Number of elements in the list Delete data Wis - static struct inter_interface inter_s; struct inter_interface *inter; @@ -70,10 +67,10 @@ int party_share_level = 10; // recv. packet list static int inter_recv_packet_length[] = { - -1,-1, 7,-1, -1,13,36, (2 + 4 + 4 + 4 + NAME_LENGTH), 0, 0, 0, 0, 0, 0, 0, 0, // 3000- + 0, 0, 0, 0, -1,13,36, (2 + 4 + 4 + 4 + NAME_LENGTH), 0, 0, 0, 0, 0, 0, 0, 0, // 3000- 6,-1, 6,-1, 0, 0, 0, 0, 10,-1, 0, 0, 0, 0, 0, 0, // 3010- Account Storage, Achievements [Smokexyz] - -1,10,-1,14, 14,19, 6,-1, 14,14, 0, 0, 0, 0, 0, 0, // 3020- Party - -1, 6,-1,-1, 55,23, 6,-1, 14,-1,-1,-1, 18,19,186,-1, // 3030- + -1,10,-1,14, 14,19, 6, 0, 14,14, 0, 0, 0, 0, 0, 0, // 3020- Party + -1, 6,-1,-1, 55,23, 6, 0, 14,-1,-1,-1, 18,19,186,-1, // 3030- -1, 9, 0, 0, 10,10, 0, 0, 7, 6,10,10, 10,-1, 0, 0, // 3040- Clan System(3044-3045) -1,-1,10,10, 0,-1,12, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3050- Auction System [Zephyrus], Item Bound [Mhalicot] 6,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3060- Quest system [Kevin] [Inkfish] @@ -82,9 +79,6 @@ static int inter_recv_packet_length[] = { -1,10,-1, 6, 0, 20,10,20, -1,6 + NAME_LENGTH, 0, 0, 0, 0, 0, 0, // 3090- Homunculus packets [albator], RoDEX packets }; -static struct DBMap *wis_db = NULL; // int wis_id -> struct WisData* -static int wis_dellist[WISDELLIST_MAX], wis_delnum; - #define MAX_JOB_NAMES 150 static char *msg_table[MAX_JOB_NAMES]; // messages 550 ~ 699 are job names @@ -964,7 +958,6 @@ static int inter_init_sql(const char *file) Sql_ShowDebug(inter->sql_handle); } - wis_db = idb_alloc(DB_OPT_RELEASE_DATA); inter_guild->sql_init(); inter_storage->sql_init(); inter_party->sql_init(); @@ -985,8 +978,6 @@ static int inter_init_sql(const char *file) // finalize static void inter_final(void) { - wis_db->destroy(wis_db, NULL); - inter_guild->sql_final(); inter_storage->sql_final(); inter_party->sql_final(); @@ -1011,77 +1002,6 @@ static int inter_mapif_init(int fd) //-------------------------------------------------------- -/** - * Existence check of WISP data - * @see DBApply - */ -static int inter_check_ttl_wisdata_sub(union DBKey key, struct DBData *data, va_list ap) -{ - int64 tick; - struct WisData *wd = DB->data2ptr(data); - nullpo_ret(wd); - tick = va_arg(ap, int64); - - if (DIFF_TICK(tick, wd->tick) > WISDATA_TTL && wis_delnum < WISDELLIST_MAX) - wis_dellist[wis_delnum++] = wd->id; - - return 0; -} - -static int inter_check_ttl_wisdata(void) -{ - int64 tick = timer->gettick(); - int i; - - do { - wis_delnum = 0; - wis_db->foreach(wis_db, inter->check_ttl_wisdata_sub, tick); - for(i = 0; i < wis_delnum; i++) { - struct WisData *wd = (struct WisData*)idb_get(wis_db, wis_dellist[i]); - ShowWarning("inter: wis data id=%d time out : from %s to %s\n", wd->id, wd->src, wd->dst); - // removed. not send information after a timeout. Just no answer for the player - //mapif->wis_end(wd, 1); // flag: 0: success to send whisper, 1: target character is not logged in?, 2: ignored by target - idb_remove(wis_db, wd->id); - } - } while(wis_delnum >= WISDELLIST_MAX); - - return 0; -} - -static struct WisData *inter_add_wisdata(int fd, const unsigned char *src, const unsigned char *dst, const unsigned char *msg, int msg_len) -{ - static int wisid = 0; - struct WisData *wd; - - CREATE(wd, struct WisData, 1); - - // Whether the failure of previous wisp/page transmission (timeout) - inter->check_ttl_wisdata(); - - wd->id = ++wisid; - wd->fd = fd; - wd->len = msg_len; - memcpy(wd->src, src, NAME_LENGTH); - memcpy(wd->dst, dst, NAME_LENGTH); - memcpy(wd->msg, msg, wd->len); - wd->tick = timer->gettick(); - idb_put(wis_db, wd->id, wd); - - return wd; -} - -static struct WisData *inter_get_wisdata(int id) -{ - return idb_get(wis_db, id); -} - -static void inter_remove_wisdata(int id) -{ - idb_remove(wis_db, id); -} - -//-------------------------------------------------------- - /// Returns the length of the next complete packet to process, /// or 0 if no complete packet exists in the queue. /// @@ -1115,10 +1035,6 @@ static int inter_parse_frommap(int fd) return 2; switch(cmd) { - case 0x3000: mapif->parse_broadcast(fd); break; - case 0x3001: mapif->parse_WisRequest(fd); break; - case 0x3002: mapif->parse_WisReply(fd); break; - case 0x3003: mapif->parse_WisToGM(fd); break; case 0x3004: mapif->parse_Registry(fd); break; case 0x3005: mapif->parse_RegistryRequest(fd); break; case 0x3006: mapif->parse_NameChangeRequest(fd); break; @@ -1167,8 +1083,6 @@ void inter_defaults(void) inter->log = inter_log; inter->init_sql = inter_init_sql; inter->mapif_init = inter_mapif_init; - inter->check_ttl_wisdata_sub = inter_check_ttl_wisdata_sub; - inter->check_ttl_wisdata = inter_check_ttl_wisdata; inter->check_length = inter_check_length; inter->parse_frommap = inter_parse_frommap; inter->final = inter_final; @@ -1176,7 +1090,4 @@ void inter_defaults(void) inter->config_read_connection = inter_config_read_connection; inter->accinfo = inter_accinfo; inter->accinfo2 = inter_accinfo2; - inter->add_wisdata = inter_add_wisdata; - inter->get_wisdata = inter_get_wisdata; - inter->remove_wisdata = inter_remove_wisdata; } diff --git a/src/char/inter.h b/src/char/inter.h index 94ee3ab60..f97c619c0 100644 --- a/src/char/inter.h +++ b/src/char/inter.h @@ -30,12 +30,6 @@ struct Sql; // common/sql.h struct config_t; // common/conf.h -struct WisData { - int id, fd, count, len; - int64 tick; - unsigned char src[24], dst[24], msg[512]; -}; - /** * inter interface **/ @@ -54,8 +48,6 @@ struct inter_interface { int (*log) (char* fmt, ...); int (*init_sql) (const char *file); int (*mapif_init) (int fd); - int (*check_ttl_wisdata_sub) (union DBKey key, struct DBData *data, va_list ap); - int (*check_ttl_wisdata) (void); int (*check_length) (int fd, int length); int (*parse_frommap) (int fd); void (*final) (void); @@ -66,9 +58,6 @@ struct inter_interface { void (*accinfo2) (bool success, int map_fd, int u_fd, int u_aid, int account_id, const char *userid, const char *user_pass, const char *email, const char *last_ip, const char *lastlogin, const char *pin_code, const char *birthdate, int group_id, int logincount, int state); - struct WisData *(*add_wisdata) (int fd, const unsigned char *src, const unsigned char *dst, const unsigned char *msg, int msg_len); - struct WisData *(*get_wisdata) (int id); - void (*remove_wisdata) (int id); }; #ifdef HERCULES_CORE diff --git a/src/char/mapif.c b/src/char/mapif.c index 8f213ecb5..29be4eaa2 100644 --- a/src/char/mapif.c +++ b/src/char/mapif.c @@ -596,22 +596,6 @@ static int mapif_guild_broken(int guild_id, int flag) return 0; } -// Send guild message -static int mapif_guild_message(int guild_id, int account_id, const char *mes, int len, int sfd) -{ - unsigned char buf[512]; - nullpo_ret(mes); - if (len > 500) - len = 500; - WBUFW(buf, 0) = 0x3837; - WBUFW(buf, 2) = len + 12; - WBUFL(buf, 4) = guild_id; - WBUFL(buf, 8) = account_id; - memcpy(WBUFP(buf, 12), mes, len); - mapif->sendallwos(sfd, buf, len + 12); - return 0; -} - // Send basic info static int mapif_guild_basicinfochanged(int guild_id, int type, const void *data, int len) { @@ -810,12 +794,6 @@ static int mapif_parse_BreakGuild(int fd, int guild_id) return 0; } -// Forward Guild message to others map servers -static int mapif_parse_GuildMessage(int fd, int guild_id, int account_id, const char *mes, int len) -{ - return mapif->guild_message(guild_id,account_id,mes,len, fd); -} - /** * Changes basic guild information * The types are available in mmo.h::guild_basic_info @@ -1319,20 +1297,6 @@ static int mapif_party_broken(int party_id, int flag) return 0; } -//Remarks in the party -static int mapif_party_message(int party_id, int account_id, const char *mes, int len, int sfd) -{ - unsigned char buf[512]; - nullpo_ret(mes); - WBUFW(buf, 0) = 0x3827; - WBUFW(buf, 2) = len + 12; - WBUFL(buf, 4) = party_id; - WBUFL(buf, 8) = account_id; - memcpy(WBUFP(buf, 12), mes, len); - mapif->sendallwos(sfd, buf, len + 12); - return 0; -} - // Create Party static int mapif_parse_CreateParty(int fd, const char *name, int item, int item2, const struct party_member *leader) { @@ -1408,12 +1372,6 @@ static int mapif_parse_BreakParty(int fd, int party_id) return 0; } -//Party sending the message -static int mapif_parse_PartyMessage(int fd, int party_id, int account_id, const char *mes, int len) -{ - return mapif->party_message(party_id, account_id, mes, len, fd); -} - static int mapif_parse_PartyLeaderChange(int fd, int party_id, int account_id, int char_id) { if (!inter_party->change_leader(party_id, account_id, char_id)) @@ -2034,67 +1992,6 @@ static void mapif_parse_accinfo(int fd) inter->accinfo(u_fd, aid, castergroup, query, fd); } -// broadcast sending -static int mapif_broadcast(const unsigned char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, int sfd) -{ - unsigned char *buf = (unsigned char*)aMalloc((len)*sizeof(unsigned char)); - - nullpo_ret(mes); - Assert_ret(len >= 16); - WBUFW(buf, 0) = 0x3800; - WBUFW(buf, 2) = len; - WBUFL(buf, 4) = fontColor; - WBUFW(buf, 8) = fontType; - WBUFW(buf, 10) = fontSize; - WBUFW(buf, 12) = fontAlign; - WBUFW(buf, 14) = fontY; - memcpy(WBUFP(buf, 16), mes, len - 16); - mapif->sendallwos(sfd, buf, len); - - aFree(buf); - return 0; -} - -// Wis sending -static int mapif_wis_message(struct WisData *wd) -{ - unsigned char buf[2048]; - nullpo_ret(wd); - //if (wd->len > 2047-56) wd->len = 2047-56; //Force it to fit to avoid crashes. [Skotlex] - if (wd->len < 0) - wd->len = 0; - if (wd->len >= (int)sizeof(wd->msg) - 1) - wd->len = (int)sizeof(wd->msg) - 1; - - WBUFW(buf, 0) = 0x3801; - WBUFW(buf, 2) = 56 + wd->len; - WBUFL(buf, 4) = wd->id; - memcpy(WBUFP(buf, 8), wd->src, NAME_LENGTH); - memcpy(WBUFP(buf, 32), wd->dst, NAME_LENGTH); - memcpy(WBUFP(buf, 56), wd->msg, wd->len); - wd->count = mapif->sendall(buf, WBUFW(buf, 2)); - - return 0; -} - -static void mapif_wis_response(int fd, const unsigned char *src, int flag) -{ - unsigned char buf[27]; - nullpo_retv(src); - WBUFW(buf, 0) = 0x3802; - memcpy(WBUFP(buf, 2), src, 24); - WBUFB(buf, 26) = flag; - mapif->send(fd, buf, 27); -} - -// Wis sending result -static int mapif_wis_end(struct WisData *wd, int flag) -{ - nullpo_ret(wd); - mapif->wis_response(wd->fd, wd->src, flag); - return 0; -} - #if 0 // Account registry transfer to map-server static void mapif_account_reg(int fd, unsigned char *src) @@ -2126,89 +2023,6 @@ static int mapif_disconnectplayer(int fd, int account_id, int char_id, int reaso return 0; } -// broadcast sending -static int mapif_parse_broadcast(int fd) -{ - mapif->broadcast(RFIFOP(fd, 16), RFIFOW(fd, 2), RFIFOL(fd, 4), RFIFOW(fd, 8), RFIFOW(fd, 10), RFIFOW(fd, 12), RFIFOW(fd, 14), fd); - return 0; -} - -// Wisp/page request to send -static int mapif_parse_WisRequest(int fd) -{ - struct WisData* wd; - char name[NAME_LENGTH]; - char *data; - size_t len; - - if (fd <= 0) // check if we have a valid fd - return 0; - - if (RFIFOW(fd, 2) - 52 >= sizeof(wd->msg)) { - ShowWarning("inter: Wis message size too long.\n"); - return 0; - } else if (RFIFOW(fd, 2) - 52 <= 0) { // normally, impossible, but who knows... - ShowError("inter: Wis message doesn't exist.\n"); - return 0; - } - - safestrncpy(name, RFIFOP(fd, 28), NAME_LENGTH); //Received name may be too large and not contain \0! [Skotlex] - - // search if character exists before to ask all map-servers - if (!chr->name_exists(name, NULL)) { - mapif->wis_response(fd, RFIFOP(fd, 4), 1); - } else { - // Character exists. So, ask all map-servers - - // to be sure of the correct name, rewrite it - SQL->GetData(inter->sql_handle, 0, &data, &len); - memset(name, 0, NAME_LENGTH); - memcpy(name, data, min(len, NAME_LENGTH)); - // if source is destination, don't ask other servers. - if (strncmp(RFIFOP(fd, 4), name, NAME_LENGTH) == 0) { - mapif->wis_response(fd, RFIFOP(fd, 4), 1); - } else { - wd = inter->add_wisdata(fd, RFIFOP(fd, 4), RFIFOP(fd, 28), RFIFOP(fd, 52), RFIFOW(fd, 2) - 52); - mapif->wis_message(wd); - } - } - - SQL->FreeResult(inter->sql_handle); - return 0; -} - -// Wisp/page transmission result -static int mapif_parse_WisReply(int fd) -{ - int id, flag; - struct WisData *wd; - - id = RFIFOL(fd,2); - flag = RFIFOB(fd,6); - wd = inter->get_wisdata(id); - if (wd == NULL) - return 0; // This wisp was probably suppress before, because it was timeout of because of target was found on another map-server - - if ((--wd->count) <= 0 || flag != 1) { - mapif->wis_end(wd, flag); // flag: 0: success to send whisper, 1: target character is not logged in?, 2: ignored by target - inter->remove_wisdata(id); - } - - return 0; -} - -// Received wisp message from map-server for ALL gm (just copy the message and resends it to ALL map-servers) -static int mapif_parse_WisToGM(int fd) -{ - unsigned char buf[2048]; // 0x3003/0x3803 <packet_len>.w <wispname>.24B <min_gm_level>.w <message>.?B - - memcpy(WBUFP(buf,0), RFIFOP(fd,0), RFIFOW(fd,2)); // Message contains the NUL terminator (see intif_wis_message_to_gm()) - WBUFW(buf, 0) = 0x3803; - mapif->sendall(buf, RFIFOW(fd,2)); - - return 0; -} - // Save account_reg into sql (type=2) static int mapif_parse_Registry(int fd) { @@ -2532,7 +2346,6 @@ void mapif_defaults(void) mapif->guild_withdraw = mapif_guild_withdraw; mapif->guild_memberinfoshort = mapif_guild_memberinfoshort; mapif->guild_broken = mapif_guild_broken; - mapif->guild_message = mapif_guild_message; mapif->guild_basicinfochanged = mapif_guild_basicinfochanged; mapif->guild_memberinfochanged = mapif_guild_memberinfochanged; mapif->guild_skillupack = mapif_guild_skillupack; @@ -2548,7 +2361,6 @@ void mapif_defaults(void) mapif->parse_GuildLeave = mapif_parse_GuildLeave; mapif->parse_GuildChangeMemberInfoShort = mapif_parse_GuildChangeMemberInfoShort; mapif->parse_BreakGuild = mapif_parse_BreakGuild; - mapif->parse_GuildMessage = mapif_parse_GuildMessage; mapif->parse_GuildBasicInfoChange = mapif_parse_GuildBasicInfoChange; mapif->parse_GuildMemberInfoChange = mapif_parse_GuildMemberInfoChange; mapif->parse_GuildPosition = mapif_parse_GuildPosition; @@ -2596,7 +2408,6 @@ void mapif_defaults(void) mapif->party_withdraw = mapif_party_withdraw; mapif->party_membermoved = mapif_party_membermoved; mapif->party_broken = mapif_party_broken; - mapif->party_message = mapif_party_message; mapif->parse_CreateParty = mapif_parse_CreateParty; mapif->parse_PartyInfo = mapif_parse_PartyInfo; mapif->parse_PartyAddMember = mapif_parse_PartyAddMember; @@ -2604,7 +2415,6 @@ void mapif_defaults(void) mapif->parse_PartyLeave = mapif_parse_PartyLeave; mapif->parse_PartyChangeMap = mapif_parse_PartyChangeMap; mapif->parse_BreakParty = mapif_parse_BreakParty; - mapif->parse_PartyMessage = mapif_parse_PartyMessage; mapif->parse_PartyLeaderChange = mapif_parse_PartyLeaderChange; mapif->pet_created = mapif_pet_created; mapif->pet_info = mapif_pet_info; @@ -2644,16 +2454,8 @@ void mapif_defaults(void) mapif->itembound_ack = mapif_itembound_ack; mapif->parse_ItemBoundRetrieve = mapif_parse_ItemBoundRetrieve; mapif->parse_accinfo = mapif_parse_accinfo; - mapif->broadcast = mapif_broadcast; - mapif->wis_message = mapif_wis_message; - mapif->wis_response = mapif_wis_response; - mapif->wis_end = mapif_wis_end; mapif->account_reg_reply = mapif_account_reg_reply; mapif->disconnectplayer = mapif_disconnectplayer; - mapif->parse_broadcast = mapif_parse_broadcast; - mapif->parse_WisRequest = mapif_parse_WisRequest; - mapif->parse_WisReply = mapif_parse_WisReply; - mapif->parse_WisToGM = mapif_parse_WisToGM; mapif->parse_Registry = mapif_parse_Registry; mapif->parse_RegistryRequest = mapif_parse_RegistryRequest; mapif->namechange_ack = mapif_namechange_ack; diff --git a/src/char/mapif.h b/src/char/mapif.h index 71a41f94c..f5b54b6b7 100644 --- a/src/char/mapif.h +++ b/src/char/mapif.h @@ -23,7 +23,6 @@ #include "common/hercules.h" #include "common/mmo.h" -struct WisData; struct rodex_item; /** @@ -71,7 +70,6 @@ struct mapif_interface { int (*guild_withdraw) (int guild_id, int account_id, int char_id, int flag, const char *name, const char *mes); int (*guild_memberinfoshort) (struct guild *g, int idx); int (*guild_broken) (int guild_id, int flag); - int (*guild_message) (int guild_id, int account_id, const char *mes, int len, int sfd); int (*guild_basicinfochanged) (int guild_id, int type, const void *data, int len); int (*guild_memberinfochanged) (int guild_id, int account_id, int char_id, int type, const void *data, int len); int (*guild_skillupack) (int guild_id, uint16 skill_id, int account_id); @@ -87,7 +85,6 @@ struct mapif_interface { int (*parse_GuildLeave) (int fd, int guild_id, int account_id, int char_id, int flag, const char *mes); int (*parse_GuildChangeMemberInfoShort) (int fd, int guild_id, int account_id, int char_id, int online, int lv, int class); int (*parse_BreakGuild) (int fd, int guild_id); - int (*parse_GuildMessage) (int fd, int guild_id, int account_id, const char *mes, int len); int (*parse_GuildBasicInfoChange) (int fd, int guild_id, int type, const void *data, int len); int (*parse_GuildMemberInfoChange) (int fd, int guild_id, int account_id, int char_id, int type, const char *data, int len); int (*parse_GuildPosition) (int fd, int guild_id, int idx, const struct guild_position *p); @@ -135,7 +132,6 @@ struct mapif_interface { int (*party_withdraw) (int party_id,int account_id, int char_id); int (*party_membermoved) (struct party *p, int idx); int (*party_broken) (int party_id, int flag); - int (*party_message) (int party_id, int account_id, const char *mes, int len, int sfd); int (*parse_CreateParty) (int fd, const char *name, int item, int item2, const struct party_member *leader); void (*parse_PartyInfo) (int fd, int party_id, int char_id); int (*parse_PartyAddMember) (int fd, int party_id, const struct party_member *member); @@ -143,7 +139,6 @@ struct mapif_interface { int (*parse_PartyLeave) (int fd, int party_id, int account_id, int char_id); int (*parse_PartyChangeMap) (int fd, int party_id, int account_id, int char_id, unsigned short map, int online, unsigned int lv); int (*parse_BreakParty) (int fd, int party_id); - int (*parse_PartyMessage) (int fd, int party_id, int account_id, const char *mes, int len); int (*parse_PartyLeaderChange) (int fd, int party_id, int account_id, int char_id); int (*pet_created) (int fd, int account_id, struct s_pet *p); int (*pet_info) (int fd, int account_id, struct s_pet *p); @@ -182,16 +177,8 @@ struct mapif_interface { int (*itembound_ack) (int fd, int aid, int guild_id); void (*parse_ItemBoundRetrieve) (int fd); void (*parse_accinfo) (int fd); - int (*broadcast) (const unsigned char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, int sfd); - int (*wis_message) (struct WisData *wd); - void (*wis_response) (int fd, const unsigned char *src, int flag); - int (*wis_end) (struct WisData *wd, int flag); int (*account_reg_reply) (int fd,int account_id,int char_id, int type); int (*disconnectplayer) (int fd, int account_id, int char_id, int reason); - int (*parse_broadcast) (int fd); - int (*parse_WisRequest) (int fd); - int (*parse_WisReply) (int fd); - int (*parse_WisToGM) (int fd); int (*parse_Registry) (int fd); int (*parse_RegistryRequest) (int fd); void (*namechange_ack) (int fd, int account_id, int char_id, int type, int flag, const char *name); diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index ec3479f4d..96fea8fe0 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -52,7 +52,6 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { #define CHAR_GEOIP_H #endif // CHAR_GEOIP_H #ifdef CHAR_INTER_H - { "WisData", sizeof(struct WisData), SERVER_TYPE_CHAR }, { "inter_interface", sizeof(struct inter_interface), SERVER_TYPE_CHAR }, #else #define CHAR_INTER_H diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 2fac5b4a4..22969606d 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -1107,8 +1107,10 @@ ACMD(kami) sscanf(message, "%199[^\n]", atcmd_output); if (stristr(info->command, "l") != NULL) clif->broadcast(&sd->bl, atcmd_output, (int)strlen(atcmd_output) + 1, BC_DEFAULT, ALL_SAMEMAP); + else if (info->command[4] == 'b' || info->command[4] == 'B') + clif->broadcast(NULL, atcmd_output, (int)strlen(atcmd_output) + 1, BC_BLUE, ALL_CLIENT); else - intif->broadcast(atcmd_output, (int)strlen(atcmd_output) + 1, (*(info->command + 4) == 'b' || *(info->command + 4) == 'B') ? BC_BLUE : BC_YELLOW); + clif->broadcast(NULL, atcmd_output, (int)strlen(atcmd_output) + 1, BC_YELLOW, ALL_CLIENT); } else { if(!*message || (sscanf(message, "%10u %199[^\n]", &color, atcmd_output) < 2)) { clif->message(fd, msg_fd(fd,981)); // Please enter color and message (usage: @kamic <color> <message>). @@ -1119,7 +1121,7 @@ ACMD(kami) clif->message(fd, msg_fd(fd,982)); // Invalid color. return false; } - intif->broadcast2(atcmd_output, (int)strlen(atcmd_output) + 1, color, 0x190, 12, 0, 0); + clif->broadcast2(NULL, atcmd_output, (int)strlen(atcmd_output) + 1, color, 0x190, 12, 0, 0, ALL_CLIENT); } return true; } @@ -5125,7 +5127,7 @@ ACMD(broadcast) } safesnprintf(atcmd_output, sizeof(atcmd_output), "%s: %s", sd->status.name, message); - intif->broadcast(atcmd_output, (int)strlen(atcmd_output) + 1, BC_DEFAULT); + clif->broadcast(NULL, atcmd_output, (int)strlen(atcmd_output) + 1, BC_DEFAULT, ALL_CLIENT); return true; } @@ -8263,7 +8265,7 @@ ACMD(request) } safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,278), message); // (@request): %s - intif->wis_message_to_gm(sd->status.name, PC_PERM_RECEIVE_REQUESTS, atcmd_output); + pc->wis_message_to_gm(sd->status.name, PC_PERM_RECEIVE_REQUESTS, atcmd_output); clif_disp_onlyself(sd, atcmd_output); clif->message(sd->fd,msg_fd(fd,279)); // @request sent. return true; diff --git a/src/map/clif.c b/src/map/clif.c index 421274b0f..1c245ed43 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11096,13 +11096,13 @@ static void clif_parse_GetCharNameRequest(int fd, struct map_session_data *sd) sc = status->get_sc(bl); if (sc && sc->option&OPTION_INVISIBLE && !clif->isdisguised(bl) && bl->type != BL_NPC && //Skip hidden NPCs which can be seen using Maya Purple - pc_get_group_level(sd) < battle_config.hack_info_GM_level + !pc_has_permission(sd, PC_PERM_RECEIVE_HACK_INFO) ) { char gm_msg[256]; sprintf(gm_msg, "Hack on NameRequest: character '%s' (account: %d) requested the name of an invisible target (id: %d).\n", sd->status.name, sd->status.account_id, id); ShowWarning(gm_msg); // information is sent to all online GMs - intif->wis_message_to_gm(map->wisp_server_name, battle_config.hack_info_GM_level, gm_msg); + pc->wis_message_to_gm(map->wisp_server_name, PC_PERM_RECEIVE_HACK_INFO, gm_msg); return; } #endif // 0 @@ -11593,12 +11593,8 @@ static void clif_parse_WisMessage(int fd, struct map_session_data *sd) dstsd = map->nick2sd(target); if (dstsd == NULL || strcmp(dstsd->status.name, target) != 0) { - // player is not on this map-server - // At this point, don't send wisp/page if it's not exactly the same name, because (example) - // if there are 'Test' player on an other map-server and 'test' player on this map-server, - // and if we ask for 'Test', we must not contact 'test' player - // so, we send information to inter-server, which is the only one which decide (and copy correct name). - intif->wis_message(sd, target, message, (int)strlen(message)); + // Character not found (or found through partial match). + clif->wis_end(sd->fd, 1); return; } diff --git a/src/map/guild.c b/src/map/guild.c index aadb55c78..415a46db5 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -1137,13 +1137,14 @@ static int guild_recv_memberinfoshort(int guild_id, int account_id, int char_id, *---------------------------------------------------*/ static int guild_send_message(struct map_session_data *sd, const char *mes) { - int len = (int)strlen(mes); nullpo_ret(sd); - if (sd->status.guild_id == 0) + if (sd->status.guild_id == 0 || sd->guild == NULL) return 0; - intif->guild_message(sd->status.guild_id, sd->status.account_id, mes, len); - guild->recv_message(sd->status.guild_id, sd->status.account_id, mes, len); + + int len = (int)strlen(mes); + + clif->guild_message(sd->guild, sd->status.account_id, mes, len); // Chat logging type 'G' / Guild Chat logs->chat(LOG_CHAT_GUILD, sd->status.guild_id, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, mes); @@ -1152,18 +1153,6 @@ static int guild_send_message(struct map_session_data *sd, const char *mes) } /*==================================================== - * Guild receive a message, will be displayed to whole member - *---------------------------------------------------*/ -static int guild_recv_message(int guild_id, int account_id, const char *mes, int len) -{ - struct guild *g; - if( (g=guild->search(guild_id))==NULL) - return 0; - clif->guild_message(g,account_id,mes,len); - return 0; -} - -/*==================================================== * Member changing position in guild *---------------------------------------------------*/ static int guild_change_memberposition(int guild_id, int account_id, int char_id, short idx) @@ -2480,7 +2469,6 @@ void guild_defaults(void) guild->change_emblem = guild_change_emblem; guild->emblem_changed = guild_emblem_changed; guild->send_message = guild_send_message; - guild->recv_message = guild_recv_message; guild->send_dot_remove = guild_send_dot_remove; guild->skillupack = guild_skillupack; guild->dobreak = guild_break; diff --git a/src/map/guild.h b/src/map/guild.h index 40209b988..d0374103f 100644 --- a/src/map/guild.h +++ b/src/map/guild.h @@ -136,7 +136,6 @@ struct guild_interface { int (*change_emblem) (struct map_session_data *sd,int len,const char *data); int (*emblem_changed) (int len,int guild_id,int emblem_id,const char *data); int (*send_message) (struct map_session_data *sd, const char *mes); - int (*recv_message) (int guild_id,int account_id,const char *mes,int len); int (*send_dot_remove) (struct map_session_data *sd); int (*skillupack) (int guild_id,uint16 skill_id,int account_id); int (*dobreak) (struct map_session_data *sd, const char *name); diff --git a/src/map/intif.c b/src/map/intif.c index e25f56b63..5a62f9644 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -153,158 +153,6 @@ static int intif_rename(struct map_session_data *sd, int type, const char *name) return 0; } -// GM Send a message -static int intif_broadcast(const char *mes, int len, int type) -{ - int lp = (type&BC_COLOR_MASK) ? 4 : 0; - - nullpo_ret(mes); - Assert_ret(len < 32000); - // Send to the local players - clif->broadcast(NULL, mes, len, type, ALL_CLIENT); - - if (intif->CheckForCharServer()) - return 0; - - if (chrif->other_mapserver_count < 1) - return 0; //No need to send. - - WFIFOHEAD(inter_fd, 16 + lp + len); - WFIFOW(inter_fd,0) = 0x3000; - WFIFOW(inter_fd,2) = 16 + lp + len; - WFIFOL(inter_fd,4) = 0xFF000000; // 0xFF000000 color signals standard broadcast - WFIFOW(inter_fd,8) = 0; // fontType not used with standard broadcast - WFIFOW(inter_fd,10) = 0; // fontSize not used with standard broadcast - WFIFOW(inter_fd,12) = 0; // fontAlign not used with standard broadcast - WFIFOW(inter_fd,14) = 0; // fontY not used with standard broadcast - if (type&BC_BLUE) - WFIFOL(inter_fd,16) = 0x65756c62; //If there's "blue" at the beginning of the message, game client will display it in blue instead of yellow. - else if (type&BC_WOE) - WFIFOL(inter_fd,16) = 0x73737373; //If there's "ssss", game client will recognize message as 'WoE broadcast'. - memcpy(WFIFOP(inter_fd,16 + lp), mes, len); - WFIFOSET(inter_fd, WFIFOW(inter_fd,2)); - return 0; -} - -static int intif_broadcast2(const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY) -{ - nullpo_ret(mes); - Assert_ret(len < 32000); - // Send to the local players - clif->broadcast2(NULL, mes, len, fontColor, fontType, fontSize, fontAlign, fontY, ALL_CLIENT); - - if (intif->CheckForCharServer()) - return 0; - - if (chrif->other_mapserver_count < 1) - return 0; //No need to send. - - WFIFOHEAD(inter_fd, 16 + len); - WFIFOW(inter_fd,0) = 0x3000; - WFIFOW(inter_fd,2) = 16 + len; - WFIFOL(inter_fd,4) = fontColor; - WFIFOW(inter_fd,8) = fontType; - WFIFOW(inter_fd,10) = fontSize; - WFIFOW(inter_fd,12) = fontAlign; - WFIFOW(inter_fd,14) = fontY; - memcpy(WFIFOP(inter_fd,16), mes, len); - WFIFOSET(inter_fd, WFIFOW(inter_fd,2)); - return 0; -} - -/// send a message using the main chat system -/// <sd> the source of message -/// <message> the message that was sent -static int intif_main_message(struct map_session_data *sd, const char *message) -{ - char output[256]; - - nullpo_ret(sd); - nullpo_ret(message); - - // format the message for main broadcasting - snprintf( output, sizeof(output), msg_txt(386), sd->status.name, message ); - - // send the message using the inter-server broadcast service - intif->broadcast2(output, (int)strlen(output) + 1, 0xFE000000, 0, 0, 0, 0); - - // log the chat message - logs->chat( LOG_CHAT_MAINCHAT, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message ); - - return 0; -} - -// The transmission of Wisp/Page to inter-server (player not found on this server) -static int intif_wis_message(struct map_session_data *sd, const char *nick, const char *mes, int mes_len) -{ - if (intif->CheckForCharServer()) - return 0; - nullpo_ret(sd); - nullpo_ret(nick); - nullpo_ret(mes); - - if (chrif->other_mapserver_count < 1) { - //Character not found. - clif->wis_end(sd->fd, 1); - return 0; - } - - WFIFOHEAD(inter_fd,mes_len + 52); - WFIFOW(inter_fd,0) = 0x3001; - WFIFOW(inter_fd,2) = mes_len + 52; - memcpy(WFIFOP(inter_fd,4), sd->status.name, NAME_LENGTH); - memcpy(WFIFOP(inter_fd,4+NAME_LENGTH), nick, NAME_LENGTH); - memcpy(WFIFOP(inter_fd,4+2*NAME_LENGTH), mes, mes_len); - WFIFOSET(inter_fd, WFIFOW(inter_fd,2)); - - if (battle_config.etc_log) - ShowInfo("intif_wis_message from %s to %s (message: '%s')\n", sd->status.name, nick, mes); - - return 0; -} - -// The reply of Wisp/page -static int intif_wis_replay(int id, int flag) -{ - if (intif->CheckForCharServer()) - return 0; - WFIFOHEAD(inter_fd,7); - WFIFOW(inter_fd,0) = 0x3002; - WFIFOL(inter_fd,2) = id; - WFIFOB(inter_fd,6) = flag; // flag: 0: success to send whisper, 1: target character is not logged in?, 2: ignored by target - WFIFOSET(inter_fd,7); - - if (battle_config.etc_log) - ShowInfo("intif_wis_replay: id: %d, flag:%d\n", id, flag); - - return 0; -} - -// The transmission of GM only Wisp/Page from server to inter-server -static int intif_wis_message_to_gm(char *wisp_name, int permission, char *mes) -{ - int mes_len; - if (intif->CheckForCharServer()) - return 0; - nullpo_ret(wisp_name); - nullpo_ret(mes); - mes_len = (int)strlen(mes) + 1; // + null - Assert_ret(mes_len > 0 && mes_len <= INT16_MAX - 32); - - WFIFOHEAD(inter_fd, mes_len + 32); - WFIFOW(inter_fd,0) = 0x3003; - WFIFOW(inter_fd,2) = mes_len + 32; - memcpy(WFIFOP(inter_fd,4), wisp_name, NAME_LENGTH); - WFIFOL(inter_fd,4+NAME_LENGTH) = permission; - memcpy(WFIFOP(inter_fd,8+NAME_LENGTH), mes, mes_len); - WFIFOSET(inter_fd, WFIFOW(inter_fd,2)); - - if (battle_config.etc_log) - ShowNotice("intif_wis_message_to_gm: from: '%s', required permission: %d, message: '%s'.\n", wisp_name, permission, mes); - - return 0; -} - //Request for saving registry values. static int intif_saveregistry(struct map_session_data *sd) { @@ -714,27 +562,6 @@ static int intif_break_party(int party_id) return 0; } -// Sending party chat -static int intif_party_message(int party_id, int account_id, const char *mes, int len) -{ - if (intif->CheckForCharServer()) - return 0; - - if (chrif->other_mapserver_count < 1) - return 0; //No need to send. - - nullpo_ret(mes); - Assert_ret(len > 0 && len < 32000); - WFIFOHEAD(inter_fd,len + 12); - WFIFOW(inter_fd,0)=0x3027; - WFIFOW(inter_fd,2)=len+12; - WFIFOL(inter_fd,4)=party_id; - WFIFOL(inter_fd,8)=account_id; - memcpy(WFIFOP(inter_fd,12),mes,len); - WFIFOSET(inter_fd,len+12); - return 0; -} - // Request a new leader for party static int intif_party_leaderchange(int party_id, int account_id, int char_id) { @@ -931,28 +758,6 @@ static int intif_guild_break(int guild_id) return 0; } -// Send a guild message -static int intif_guild_message(int guild_id, int account_id, const char *mes, int len) -{ - if (intif->CheckForCharServer()) - return 0; - - if (chrif->other_mapserver_count < 1) - return 0; //No need to send. - - nullpo_ret(mes); - Assert_ret(len > 0 && len < 32000); - WFIFOHEAD(inter_fd, len + 12); - WFIFOW(inter_fd,0)=0x3037; - WFIFOW(inter_fd,2)=len+12; - WFIFOL(inter_fd,4)=guild_id; - WFIFOL(inter_fd,8)=account_id; - memcpy(WFIFOP(inter_fd,12),mes,len); - WFIFOSET(inter_fd,len+12); - - return 0; -} - /** * Requests to change a basic guild information, it is parsed via mapif_parse_GuildBasicInfoChange * To see the information types that can be changed see mmo.h::guild_basic_info @@ -1166,98 +971,6 @@ static int intif_homunculus_requestdelete(int homun_id) //----------------------------------------------------------------- // Packets receive from inter server -// Wisp/Page reception // rewritten by [Yor] -static void intif_parse_WisMessage(int fd) -{ - struct map_session_data* sd; - const char *wisp_source; - char name[NAME_LENGTH]; - int id, i; - - id=RFIFOL(fd,4); - - safestrncpy(name, RFIFOP(fd,32), NAME_LENGTH); - sd = map->nick2sd(name); - if(sd == NULL || strcmp(sd->status.name, name) != 0) { - //Not found - intif_wis_replay(id,1); - return; - } - if(sd->state.ignoreAll) { - intif_wis_replay(id, 2); - return; - } - wisp_source = RFIFOP(fd,8); // speed up [Yor] - for(i=0; i < MAX_IGNORE_LIST && - sd->ignore[i].name[0] != '\0' && - strcmp(sd->ignore[i].name, wisp_source) != 0 - ; i++); - - if (i < MAX_IGNORE_LIST && sd->ignore[i].name[0] != '\0') { - //Ignored - intif_wis_replay(id, 2); - return; - } - //Success to send whisper. - clif->wis_message(sd->fd, wisp_source, RFIFOP(fd,56),RFIFOW(fd,2)-57); - intif_wis_replay(id,0); // success -} - -// Wisp/page transmission result reception -static void intif_parse_WisEnd(int fd) -{ - struct map_session_data* sd; - const char *playername = RFIFOP(fd, 2); - - if (battle_config.etc_log) - ShowInfo("intif_parse_wisend: player: %s, flag: %d\n", playername, RFIFOB(fd,26)); // flag: 0: success to send whisper, 1: target character is not logged in?, 2: ignored by target - sd = map->nick2sd(playername); - if (sd != NULL) - clif->wis_end(sd->fd, RFIFOB(fd,26)); - - return; -} - -static int intif_parse_WisToGM_sub(struct map_session_data *sd, va_list va) -{ - int permission = va_arg(va, int); - char *wisp_name; - char *message; - int len; - - nullpo_ret(sd); - if (!pc_has_permission(sd, permission)) - return 0; - wisp_name = va_arg(va, char*); - message = va_arg(va, char*); - len = va_arg(va, int); - clif->wis_message(sd->fd, wisp_name, message, len); - return 1; -} - -// Received wisp message from map-server via char-server for ALL gm -// 0x3003/0x3803 <packet_len>.w <wispname>.24B <permission>.l <message>.?B -static void intif_parse_WisToGM(int fd) -{ - int permission, mes_len; - char Wisp_name[NAME_LENGTH]; - char mbuf[255] = { 0 }; - char *message; - - mes_len = RFIFOW(fd,2) - 33; // Length not including the NUL terminator - Assert_retv(mes_len > 0 && mes_len < 32000); - message = (mes_len >= 255 ? aMalloc(mes_len + 1) : mbuf); - - permission = RFIFOL(fd,28); - safestrncpy(Wisp_name, RFIFOP(fd,4), NAME_LENGTH); - safestrncpy(message, RFIFOP(fd,32), mes_len + 1); - // information is sent to all online GM - map->foreachpc(intif->pWisToGM_sub, permission, Wisp_name, message, mes_len); - - if (message != mbuf) - aFree(message); -} - // Request player registre static void intif_parse_Registers(int fd) { @@ -1464,12 +1177,6 @@ static void intif_parse_PartyMove(int fd) party->recv_movemap(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOW(fd,14),RFIFOB(fd,16),RFIFOW(fd,17)); } -// ACK party messages -static void intif_parse_PartyMessage(int fd) -{ - party->recv_message(RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12), RFIFOW(fd,2)-12); -} - // ACK guild creation static void intif_parse_GuildCreated(int fd) { @@ -1619,12 +1326,6 @@ static void intif_parse_GuildEmblem(int fd) guild->emblem_changed(RFIFOW(fd,2)-12, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12)); } -// ACK guild message -static void intif_parse_GuildMessage(int fd) -{ - guild->recv_message(RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12), RFIFOW(fd,2)-12); -} - // Reply guild castle data request static void intif_parse_GuildCastleDataLoad(int fd) { @@ -2915,15 +2616,6 @@ static int intif_parse(int fd) } // Processing branch switch(cmd){ - case 0x3800: - if (RFIFOL(fd,4) == 0xFF000000) //Normal announce. - clif->broadcast(NULL, RFIFOP(fd,16), packet_len-16, BC_DEFAULT, ALL_CLIENT); - else //Color announce. - clif->broadcast2(NULL, RFIFOP(fd,16), packet_len-16, RFIFOL(fd,4), RFIFOW(fd,8), RFIFOW(fd,10), RFIFOW(fd,12), RFIFOW(fd,14), ALL_CLIENT); - break; - case 0x3801: intif->pWisMessage(fd); break; - case 0x3802: intif->pWisEnd(fd); break; - case 0x3803: intif->pWisToGM(fd); break; case 0x3804: intif->pRegisters(fd); break; case 0x3805: intif->pAccountStorage(fd); break; case 0x3806: intif->pChangeNameOk(fd); break; @@ -2939,14 +2631,12 @@ static int intif_parse(int fd) case 0x3824: intif->pPartyMemberWithdraw(fd); break; case 0x3825: intif->pPartyMove(fd); break; case 0x3826: intif->pPartyBroken(fd); break; - case 0x3827: intif->pPartyMessage(fd); break; case 0x3830: intif->pGuildCreated(fd); break; case 0x3831: intif->pGuildInfo(fd); break; case 0x3832: intif->pGuildMemberAdded(fd); break; case 0x3834: intif->pGuildMemberWithdraw(fd); break; case 0x3835: intif->pGuildMemberInfoShort(fd); break; case 0x3836: intif->pGuildBroken(fd); break; - case 0x3837: intif->pGuildMessage(fd); break; case 0x3839: intif->pGuildBasicInfoChanged(fd); break; case 0x383a: intif->pGuildMemberInfoChanged(fd); break; case 0x383b: intif->pGuildPosition(fd); break; @@ -3028,10 +2718,10 @@ static int intif_parse(int fd) void intif_defaults(void) { const int packet_len_table [INTIF_PACKET_LEN_TABLE_SIZE] = { - -1,-1,27,-1, -1,-1,37,-1, 7, 0, 0, 0, 0, 0, 0, 0, //0x3800-0x380f + 0, 0, 0, 0, -1,-1,37,-1, 7, 0, 0, 0, 0, 0, 0, 0, //0x3800-0x380f -1, 0, 0, 0, 0, 0, 0, 0, -1,11, 0, 0, 0, 0, 0, 0, //0x3810 Achievements [Smokexyz/Hercules] - 39,-1,15,15, 14,19, 7,-1, 0, 0, 0, 0, 0, 0, 0, 0, //0x3820 - 10,-1,15, 0, 79,25, 7,-1, 0,-1,-1,-1, 14,67,186,-1, //0x3830 + 39,-1,15,15, 14,19, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3820 + 10,-1,15, 0, 79,25, 7, 0, 0,-1,-1,-1, 14,67,186,-1, //0x3830 -1, 0, 0,14, 0, 0, 0, 0, -1,74,-1,11, 11,-1, 0, 0, //0x3840 -1,-1, 7, 7, 7,11, 8, 0, 10, 0, 0, 0, 0, 0, 0, 0, //0x3850 Auctions [Zephyrus] itembound[Akinari] Clan System[Murilo BiO] -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3860 Quests [Kevin] [Inkfish] @@ -3048,11 +2738,6 @@ void intif_defaults(void) /* funcs */ intif->parse = intif_parse; intif->create_pet = intif_create_pet; - intif->broadcast = intif_broadcast; - intif->broadcast2 = intif_broadcast2; - intif->main_message = intif_main_message; - intif->wis_message = intif_wis_message; - intif->wis_message_to_gm = intif_wis_message_to_gm; intif->saveregistry = intif_saveregistry; intif->request_registry = intif_request_registry; intif->request_account_storage = intif_request_account_storage; @@ -3066,7 +2751,6 @@ void intif_defaults(void) intif->party_leave = intif_party_leave; intif->party_changemap = intif_party_changemap; intif->break_party = intif_break_party; - intif->party_message = intif_party_message; intif->party_leaderchange = intif_party_leaderchange; intif->guild_create = intif_guild_create; intif->guild_request_info = intif_guild_request_info; @@ -3074,7 +2758,6 @@ void intif_defaults(void) intif->guild_leave = intif_guild_leave; intif->guild_memberinfoshort = intif_guild_memberinfoshort; intif->guild_break = intif_guild_break; - intif->guild_message = intif_guild_message; intif->guild_change_gm = intif_guild_change_gm; intif->guild_change_basicinfo = intif_guild_change_basicinfo; intif->guild_change_memberinfo = intif_guild_change_memberinfo; @@ -3138,10 +2821,6 @@ void intif_defaults(void) intif->achievements_request = intif_achievements_request; intif->achievements_save = intif_achievements_save; /* parse functions */ - intif->pWisMessage = intif_parse_WisMessage; - intif->pWisEnd = intif_parse_WisEnd; - intif->pWisToGM_sub = intif_parse_WisToGM_sub; - intif->pWisToGM = intif_parse_WisToGM; intif->pRegisters = intif_parse_Registers; intif->pChangeNameOk = intif_parse_ChangeNameOk; intif->pMessageToFD = intif_parse_MessageToFD; @@ -3156,14 +2835,12 @@ void intif_defaults(void) intif->pPartyMemberWithdraw = intif_parse_PartyMemberWithdraw; intif->pPartyMove = intif_parse_PartyMove; intif->pPartyBroken = intif_parse_PartyBroken; - intif->pPartyMessage = intif_parse_PartyMessage; intif->pGuildCreated = intif_parse_GuildCreated; intif->pGuildInfo = intif_parse_GuildInfo; intif->pGuildMemberAdded = intif_parse_GuildMemberAdded; intif->pGuildMemberWithdraw = intif_parse_GuildMemberWithdraw; intif->pGuildMemberInfoShort = intif_parse_GuildMemberInfoShort; intif->pGuildBroken = intif_parse_GuildBroken; - intif->pGuildMessage = intif_parse_GuildMessage; intif->pGuildBasicInfoChanged = intif_parse_GuildBasicInfoChanged; intif->pGuildMemberInfoChanged = intif_parse_GuildMemberInfoChanged; intif->pGuildPosition = intif_parse_GuildPosition; diff --git a/src/map/intif.h b/src/map/intif.h index 8df669217..ffac4a1c9 100644 --- a/src/map/intif.h +++ b/src/map/intif.h @@ -60,11 +60,6 @@ struct intif_interface { int (*parse) (int fd); int (*create_pet)(int account_id, int char_id, int pet_type, int pet_lv, int pet_egg_id, int pet_equip, short intimate, short hungry, char rename_flag, char incubate, char *pet_name); - int (*broadcast) (const char *mes, int len, int type); - int (*broadcast2) (const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY); - int (*main_message) (struct map_session_data* sd, const char* message); - int (*wis_message) (struct map_session_data *sd, const char *nick, const char *mes, int mes_len); - int (*wis_message_to_gm) (char *Wisp_name, int permission, char *mes); int (*saveregistry) (struct map_session_data *sd); int (*request_registry) (struct map_session_data *sd, int flag); void (*request_account_storage) (const struct map_session_data *sd); @@ -78,7 +73,6 @@ struct intif_interface { int (*party_leave) (int party_id,int account_id, int char_id); int (*party_changemap) (struct map_session_data *sd, int online); int (*break_party) (int party_id); - int (*party_message) (int party_id, int account_id, const char *mes,int len); int (*party_leaderchange) (int party_id,int account_id,int char_id); int (*guild_create) (const char *name, const struct guild_member *master); int (*guild_request_info) (int guild_id); @@ -86,7 +80,6 @@ struct intif_interface { int (*guild_leave) (int guild_id, int account_id, int char_id, int flag, const char *mes); int (*guild_memberinfoshort) (int guild_id, int account_id, int char_id, int online, int lv, int class); int (*guild_break) (int guild_id); - int (*guild_message) (int guild_id, int account_id, const char *mes, int len); int (*guild_change_gm) (int guild_id, const char *name, int len); int (*guild_change_basicinfo) (int guild_id, int type, const void *data, int len); int (*guild_change_memberinfo) (int guild_id, int account_id, int char_id, int type, const void *data, int len); @@ -151,10 +144,6 @@ struct intif_interface { void(*achievements_request) (struct map_session_data *sd); void(*achievements_save) (struct map_session_data *sd); /* */ - void (*pWisMessage) (int fd); - void (*pWisEnd) (int fd); - int (*pWisToGM_sub) (struct map_session_data* sd,va_list va); - void (*pWisToGM) (int fd); void (*pRegisters) (int fd); void (*pAccountStorage) (int fd); void (*pChangeNameOk) (int fd); @@ -169,14 +158,12 @@ struct intif_interface { void (*pPartyMemberWithdraw) (int fd); void (*pPartyMove) (int fd); void (*pPartyBroken) (int fd); - void (*pPartyMessage) (int fd); void (*pGuildCreated) (int fd); void (*pGuildInfo) (int fd); void (*pGuildMemberAdded) (int fd); void (*pGuildMemberWithdraw) (int fd); void (*pGuildMemberInfoShort) (int fd); void (*pGuildBroken) (int fd); - void (*pGuildMessage) (int fd); void (*pGuildBasicInfoChanged) (int fd); void (*pGuildMemberInfoChanged) (int fd); void (*pGuildPosition) (int fd); diff --git a/src/map/party.c b/src/map/party.c index dc330d92d..9fbe915f3 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -886,17 +886,20 @@ static int party_send_logout(struct map_session_data *sd) static int party_send_message(struct map_session_data *sd, const char *mes) { - int len; - nullpo_ret(sd); nullpo_ret(mes); - len = (int)strlen(mes); - if (sd->status.party_id == 0) return 0; - intif->party_message(sd->status.party_id, sd->status.account_id, mes, len); - party->recv_message(sd->status.party_id, sd->status.account_id, mes, len); + + struct party_data *p = party->search(sd->status.party_id); + + if (p == NULL) + return 0; + + int len = (int)strlen(mes); + + clif->party_message(p, sd->status.account_id, mes, len); // Chat logging type 'P' / Party Chat logs->chat(LOG_CHAT_PARTY, sd->status.party_id, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, mes); @@ -904,15 +907,6 @@ static int party_send_message(struct map_session_data *sd, const char *mes) return 0; } -static int party_recv_message(int party_id, int account_id, const char *mes, int len) -{ - struct party_data *p; - if( (p=party->search(party_id))==NULL) - return 0; - clif->party_message(p,account_id,mes,len); - return 0; -} - static int party_skill_check(struct map_session_data *sd, int party_id, uint16 skill_id, uint16 skill_lv) { struct party_data *p; @@ -1532,7 +1526,6 @@ void party_defaults(void) party->send_levelup = party_send_levelup; party->send_logout = party_send_logout; party->send_message = party_send_message; - party->recv_message = party_recv_message; party->skill_check = party_skill_check; party->send_xy_clear = party_send_xy_clear; party->exp_share = party_exp_share; diff --git a/src/map/party.h b/src/map/party.h index 28e16dff7..1831da414 100644 --- a/src/map/party.h +++ b/src/map/party.h @@ -118,7 +118,6 @@ struct party_interface { void (*send_levelup) (struct map_session_data *sd); int (*send_logout) (struct map_session_data *sd); int (*send_message) (struct map_session_data *sd, const char *mes); - int (*recv_message) (int party_id,int account_id,const char *mes,int len); int (*skill_check) (struct map_session_data *sd, int party_id, uint16 skill_id, uint16 skill_lv); int (*send_xy_clear) (struct party_data *p); int (*exp_share) (struct party_data *p,struct block_list *src,unsigned int base_exp,unsigned int job_exp,int zeny); diff --git a/src/map/pc.c b/src/map/pc.c index 1e7ac5817..24f71f47b 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -10990,7 +10990,7 @@ static int map_day_timer(int tid, int64 tick, int id, intptr_t data) map->night_flag = 0; // 0=day, 1=night [Yor] map->foreachpc(pc->daynight_timer_sub); safestrncpy(tmp_soutput, (data == 0) ? msg_txt(502) : msg_txt(60), sizeof(tmp_soutput)); // The day has arrived! - intif->broadcast(tmp_soutput, (int)strlen(tmp_soutput) + 1, BC_DEFAULT); + clif->broadcast(NULL, tmp_soutput, (int)strlen(tmp_soutput) + 1, BC_DEFAULT, ALL_CLIENT); return 0; } @@ -11011,7 +11011,7 @@ static int map_night_timer(int tid, int64 tick, int id, intptr_t data) map->night_flag = 1; // 0=day, 1=night [Yor] map->foreachpc(pc->daynight_timer_sub); safestrncpy(tmp_soutput, (data == 0) ? msg_txt(503) : msg_txt(59), sizeof(tmp_soutput)); // The night has fallen... - intif->broadcast(tmp_soutput, (int)strlen(tmp_soutput) + 1, BC_DEFAULT); + clif->broadcast(NULL, tmp_soutput, (int)strlen(tmp_soutput) + 1, BC_DEFAULT, ALL_CLIENT); return 0; } @@ -12311,6 +12311,54 @@ static void pc_check_supernovice_call(struct map_session_data *sd, const char *m } } +/** + * Sends a message t all online GMs having the specified permission. + * + * @param sender_name Sender character name. + * @param permission The required permission to receive this message. + * @param message The message body. + * + * @return The amount of characters the message was delivered to. + */ +// The transmission of GM only Wisp/Page from server to inter-server +static int pc_wis_message_to_gm(const char *sender_name, int permission, const char *message) +{ + nullpo_ret(sender_name); + nullpo_ret(message); + int mes_len = (int)strlen(message) + 1; // + null + int count = 0; + + // information is sent to all online GM + map->foreachpc(pc->wis_message_to_gm_sub, permission, sender_name, message, mes_len, &count); + + return count; +} + +/** + * Helper function for pc_wis_message_to_gm(). + */ +static int pc_wis_message_to_gm_sub(struct map_session_data *sd, va_list va) +{ + nullpo_ret(sd); + + int permission = va_arg(va, int); + if (!pc_has_permission(sd, permission)) + return 0; + + const char *sender_name = va_arg(va, const char *); + const char *message = va_arg(va, const char *); + int len = va_arg(va, int); + int *count = va_arg(va, int *); + + nullpo_ret(sender_name); + nullpo_ret(message); + nullpo_ret(count); + + clif->wis_message(sd->fd, sender_name, message, len); + ++*count; + return 1; +} + static void pc_update_job_and_level(struct map_session_data *sd) { nullpo_retv(sd); @@ -12758,6 +12806,8 @@ void pc_defaults(void) pc->check_supernovice_call = pc_check_supernovice_call; pc->process_chat_message = pc_process_chat_message; + pc->wis_message_to_gm = pc_wis_message_to_gm; + pc->wis_message_to_gm_sub = pc_wis_message_to_gm_sub; /** * Autotrade persistency [Ind/Hercules <3] diff --git a/src/map/pc.h b/src/map/pc.h index 0770e13cb..8df02a891 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -1186,6 +1186,8 @@ END_ZEROED_BLOCK; /* End */ int (*have_magnifier) (struct map_session_data *sd); bool (*process_chat_message) (struct map_session_data *sd, const char *message); + int (*wis_message_to_gm) (const char *sender_name, int permission, const char *message); + int (*wis_message_to_gm_sub) (struct map_session_data *sd, va_list va); void (*check_supernovice_call) (struct map_session_data *sd, const char *message); bool (*check_basicskill) (struct map_session_data *sd, int level); bool (*isDeathPenaltyJob) (uint16 job); diff --git a/src/map/script.c b/src/map/script.c index c3e884bb4..4fc47e039 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -11914,12 +11914,12 @@ static BUILDIN(announce) int fontAlign = script_hasdata(st,7) ? script_getnum(st,7) : 0; // default fontAlign int fontY = script_hasdata(st,8) ? script_getnum(st,8) : 0; // default fontY size_t len = strlen(mes); + send_target target = ALL_CLIENT; + struct block_list *bl = NULL; Assert_retr(false, len < INT_MAX); if( flag&(BC_TARGET_MASK|BC_SOURCE_MASK) ) { // Broadcast source or broadcast region defined - send_target target; - struct block_list *bl = NULL; if (flag&BC_NPC) { // If bc_npc flag is set, use NPC as broadcast source bl = map->id2bl(st->oid); @@ -11937,17 +11937,13 @@ static BUILDIN(announce) case BC_SELF: target = SELF; break; default: target = ALL_CLIENT; break; // BC_ALL } - - if (fontColor) - clif->broadcast2(bl, mes, (int)len+1, (unsigned int)strtoul(fontColor, (char **)NULL, 0), fontType, fontSize, fontAlign, fontY, target); - else - clif->broadcast(bl, mes, (int)len+1, flag&BC_COLOR_MASK, target); - } else { - if (fontColor) - intif->broadcast2(mes, (int)len+1, (unsigned int)strtoul(fontColor, (char **)NULL, 0), fontType, fontSize, fontAlign, fontY); - else - intif->broadcast(mes, (int)len+1, flag&BC_COLOR_MASK); } + + if (fontColor) + clif->broadcast2(bl, mes, (int)len+1, (unsigned int)strtoul(fontColor, (char **)NULL, 0), fontType, fontSize, fontAlign, fontY, target); + else + clif->broadcast(bl, mes, (int)len+1, flag&BC_COLOR_MASK, target); + return true; } /*========================================== diff --git a/src/map/trade.c b/src/map/trade.c index 7096d12e4..ff5c04fc3 100644 --- a/src/map/trade.c +++ b/src/map/trade.c @@ -226,9 +226,9 @@ static int impossible_trade_check(struct map_session_data *sd) if (inventory[index].amount < sd->deal.item[i].amount) { // if more than the player have -> hack snprintf(message_to_gm, sizeof(message_to_gm), msg_txt(538), sd->status.name, sd->status.account_id); // Hack on trade: character '%s' (account: %d) try to trade more items that he has. - intif->wis_message_to_gm(map->wisp_server_name, PC_PERM_RECEIVE_HACK_INFO, message_to_gm); + pc->wis_message_to_gm(map->wisp_server_name, PC_PERM_RECEIVE_HACK_INFO, message_to_gm); snprintf(message_to_gm, sizeof(message_to_gm), msg_txt(539), inventory[index].amount, inventory[index].nameid, sd->deal.item[i].amount); // This player has %d of a kind of item (id: %d), and try to trade %d of them. - intif->wis_message_to_gm(map->wisp_server_name, PC_PERM_RECEIVE_HACK_INFO, message_to_gm); + pc->wis_message_to_gm(map->wisp_server_name, PC_PERM_RECEIVE_HACK_INFO, message_to_gm); // if we block people if (battle_config.ban_hack_trade < 0) { chrif->char_ask_name(-1, sd->status.name, CHAR_ASK_NAME_BLOCK, 0, 0, 0, 0, 0, 0); @@ -245,7 +245,7 @@ static int impossible_trade_check(struct map_session_data *sd) // message about the ban safestrncpy(message_to_gm, msg_txt(508), sizeof(message_to_gm)); // This player hasn't been banned (Ban option is disabled). - intif->wis_message_to_gm(map->wisp_server_name, PC_PERM_RECEIVE_HACK_INFO, message_to_gm); + pc->wis_message_to_gm(map->wisp_server_name, PC_PERM_RECEIVE_HACK_INFO, message_to_gm); return 1; } inventory[index].amount -= sd->deal.item[i].amount; // remove item from inventory diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 44323e85c..b218988b6 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -3010,8 +3010,6 @@ typedef int (*HPMHOOK_pre_guild_emblem_changed) (int *len, int *guild_id, int *e typedef int (*HPMHOOK_post_guild_emblem_changed) (int retVal___, int len, int guild_id, int emblem_id, const char *data); typedef int (*HPMHOOK_pre_guild_send_message) (struct map_session_data **sd, const char **mes); typedef int (*HPMHOOK_post_guild_send_message) (int retVal___, struct map_session_data *sd, const char *mes); -typedef int (*HPMHOOK_pre_guild_recv_message) (int *guild_id, int *account_id, const char **mes, int *len); -typedef int (*HPMHOOK_post_guild_recv_message) (int retVal___, int guild_id, int account_id, const char *mes, int len); typedef int (*HPMHOOK_pre_guild_send_dot_remove) (struct map_session_data **sd); typedef int (*HPMHOOK_post_guild_send_dot_remove) (int retVal___, struct map_session_data *sd); typedef int (*HPMHOOK_pre_guild_skillupack) (int *guild_id, uint16 *skill_id, int *account_id); @@ -3430,10 +3428,6 @@ typedef int (*HPMHOOK_pre_inter_init_sql) (const char **file); typedef int (*HPMHOOK_post_inter_init_sql) (int retVal___, const char *file); typedef int (*HPMHOOK_pre_inter_mapif_init) (int *fd); typedef int (*HPMHOOK_post_inter_mapif_init) (int retVal___, int fd); -typedef int (*HPMHOOK_pre_inter_check_ttl_wisdata_sub) (union DBKey *key, struct DBData **data, va_list ap); -typedef int (*HPMHOOK_post_inter_check_ttl_wisdata_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap); -typedef int (*HPMHOOK_pre_inter_check_ttl_wisdata) (void); -typedef int (*HPMHOOK_post_inter_check_ttl_wisdata) (int retVal___); typedef int (*HPMHOOK_pre_inter_check_length) (int *fd, int *length); typedef int (*HPMHOOK_post_inter_check_length) (int retVal___, int fd, int length); typedef int (*HPMHOOK_pre_inter_parse_frommap) (int *fd); @@ -3450,12 +3444,6 @@ typedef void (*HPMHOOK_pre_inter_accinfo) (int *u_fd, int *aid, int *castergroup typedef void (*HPMHOOK_post_inter_accinfo) (int u_fd, int aid, int castergroup, const char *query, int map_fd); typedef void (*HPMHOOK_pre_inter_accinfo2) (bool *success, int *map_fd, int *u_fd, int *u_aid, int *account_id, const char **userid, const char **user_pass, const char **email, const char **last_ip, const char **lastlogin, const char **pin_code, const char **birthdate, int *group_id, int *logincount, int *state); typedef void (*HPMHOOK_post_inter_accinfo2) (bool success, int map_fd, int u_fd, int u_aid, int account_id, const char *userid, const char *user_pass, const char *email, const char *last_ip, const char *lastlogin, const char *pin_code, const char *birthdate, int group_id, int logincount, int state); -typedef struct WisData* (*HPMHOOK_pre_inter_add_wisdata) (int *fd, const unsigned char **src, const unsigned char **dst, const unsigned char **msg, int *msg_len); -typedef struct WisData* (*HPMHOOK_post_inter_add_wisdata) (struct WisData* retVal___, int fd, const unsigned char *src, const unsigned char *dst, const unsigned char *msg, int msg_len); -typedef struct WisData* (*HPMHOOK_pre_inter_get_wisdata) (int *id); -typedef struct WisData* (*HPMHOOK_post_inter_get_wisdata) (struct WisData* retVal___, int id); -typedef void (*HPMHOOK_pre_inter_remove_wisdata) (int *id); -typedef void (*HPMHOOK_post_inter_remove_wisdata) (int id); #endif // CHAR_INTER_H #ifdef CHAR_INT_MAIL_H /* inter_mail */ typedef int (*HPMHOOK_pre_inter_mail_sql_init) (void); @@ -3628,16 +3616,6 @@ typedef int (*HPMHOOK_pre_intif_parse) (int *fd); typedef int (*HPMHOOK_post_intif_parse) (int retVal___, int fd); typedef int (*HPMHOOK_pre_intif_create_pet) (int *account_id, int *char_id, int *pet_type, int *pet_lv, int *pet_egg_id, int *pet_equip, short *intimate, short *hungry, char *rename_flag, char *incubate, char **pet_name); typedef int (*HPMHOOK_post_intif_create_pet) (int retVal___, int account_id, int char_id, int pet_type, int pet_lv, int pet_egg_id, int pet_equip, short intimate, short hungry, char rename_flag, char incubate, char *pet_name); -typedef int (*HPMHOOK_pre_intif_broadcast) (const char **mes, int *len, int *type); -typedef int (*HPMHOOK_post_intif_broadcast) (int retVal___, const char *mes, int len, int type); -typedef int (*HPMHOOK_pre_intif_broadcast2) (const char **mes, int *len, unsigned int *fontColor, short *fontType, short *fontSize, short *fontAlign, short *fontY); -typedef int (*HPMHOOK_post_intif_broadcast2) (int retVal___, const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY); -typedef int (*HPMHOOK_pre_intif_main_message) (struct map_session_data **sd, const char **message); -typedef int (*HPMHOOK_post_intif_main_message) (int retVal___, struct map_session_data *sd, const char *message); -typedef int (*HPMHOOK_pre_intif_wis_message) (struct map_session_data **sd, const char **nick, const char **mes, int *mes_len); -typedef int (*HPMHOOK_post_intif_wis_message) (int retVal___, struct map_session_data *sd, const char *nick, const char *mes, int mes_len); -typedef int (*HPMHOOK_pre_intif_wis_message_to_gm) (char **Wisp_name, int *permission, char **mes); -typedef int (*HPMHOOK_post_intif_wis_message_to_gm) (int retVal___, char *Wisp_name, int permission, char *mes); typedef int (*HPMHOOK_pre_intif_saveregistry) (struct map_session_data **sd); typedef int (*HPMHOOK_post_intif_saveregistry) (int retVal___, struct map_session_data *sd); typedef int (*HPMHOOK_pre_intif_request_registry) (struct map_session_data **sd, int *flag); @@ -3664,8 +3642,6 @@ typedef int (*HPMHOOK_pre_intif_party_changemap) (struct map_session_data **sd, typedef int (*HPMHOOK_post_intif_party_changemap) (int retVal___, struct map_session_data *sd, int online); typedef int (*HPMHOOK_pre_intif_break_party) (int *party_id); typedef int (*HPMHOOK_post_intif_break_party) (int retVal___, int party_id); -typedef int (*HPMHOOK_pre_intif_party_message) (int *party_id, int *account_id, const char **mes, int *len); -typedef int (*HPMHOOK_post_intif_party_message) (int retVal___, int party_id, int account_id, const char *mes, int len); typedef int (*HPMHOOK_pre_intif_party_leaderchange) (int *party_id, int *account_id, int *char_id); typedef int (*HPMHOOK_post_intif_party_leaderchange) (int retVal___, int party_id, int account_id, int char_id); typedef int (*HPMHOOK_pre_intif_guild_create) (const char **name, const struct guild_member **master); @@ -3680,8 +3656,6 @@ typedef int (*HPMHOOK_pre_intif_guild_memberinfoshort) (int *guild_id, int *acco typedef int (*HPMHOOK_post_intif_guild_memberinfoshort) (int retVal___, int guild_id, int account_id, int char_id, int online, int lv, int class); typedef int (*HPMHOOK_pre_intif_guild_break) (int *guild_id); typedef int (*HPMHOOK_post_intif_guild_break) (int retVal___, int guild_id); -typedef int (*HPMHOOK_pre_intif_guild_message) (int *guild_id, int *account_id, const char **mes, int *len); -typedef int (*HPMHOOK_post_intif_guild_message) (int retVal___, int guild_id, int account_id, const char *mes, int len); typedef int (*HPMHOOK_pre_intif_guild_change_gm) (int *guild_id, const char **name, int *len); typedef int (*HPMHOOK_post_intif_guild_change_gm) (int retVal___, int guild_id, const char *name, int len); typedef int (*HPMHOOK_pre_intif_guild_change_basicinfo) (int *guild_id, int *type, const void **data, int *len); @@ -3788,14 +3762,6 @@ typedef void (*HPMHOOK_pre_intif_achievements_request) (struct map_session_data typedef void (*HPMHOOK_post_intif_achievements_request) (struct map_session_data *sd); typedef void (*HPMHOOK_pre_intif_achievements_save) (struct map_session_data **sd); typedef void (*HPMHOOK_post_intif_achievements_save) (struct map_session_data *sd); -typedef void (*HPMHOOK_pre_intif_pWisMessage) (int *fd); -typedef void (*HPMHOOK_post_intif_pWisMessage) (int fd); -typedef void (*HPMHOOK_pre_intif_pWisEnd) (int *fd); -typedef void (*HPMHOOK_post_intif_pWisEnd) (int fd); -typedef int (*HPMHOOK_pre_intif_pWisToGM_sub) (struct map_session_data **sd, va_list va); -typedef int (*HPMHOOK_post_intif_pWisToGM_sub) (int retVal___, struct map_session_data *sd, va_list va); -typedef void (*HPMHOOK_pre_intif_pWisToGM) (int *fd); -typedef void (*HPMHOOK_post_intif_pWisToGM) (int fd); typedef void (*HPMHOOK_pre_intif_pRegisters) (int *fd); typedef void (*HPMHOOK_post_intif_pRegisters) (int fd); typedef void (*HPMHOOK_pre_intif_pAccountStorage) (int *fd); @@ -3824,8 +3790,6 @@ typedef void (*HPMHOOK_pre_intif_pPartyMove) (int *fd); typedef void (*HPMHOOK_post_intif_pPartyMove) (int fd); typedef void (*HPMHOOK_pre_intif_pPartyBroken) (int *fd); typedef void (*HPMHOOK_post_intif_pPartyBroken) (int fd); -typedef void (*HPMHOOK_pre_intif_pPartyMessage) (int *fd); -typedef void (*HPMHOOK_post_intif_pPartyMessage) (int fd); typedef void (*HPMHOOK_pre_intif_pGuildCreated) (int *fd); typedef void (*HPMHOOK_post_intif_pGuildCreated) (int fd); typedef void (*HPMHOOK_pre_intif_pGuildInfo) (int *fd); @@ -3838,8 +3802,6 @@ typedef void (*HPMHOOK_pre_intif_pGuildMemberInfoShort) (int *fd); typedef void (*HPMHOOK_post_intif_pGuildMemberInfoShort) (int fd); typedef void (*HPMHOOK_pre_intif_pGuildBroken) (int *fd); typedef void (*HPMHOOK_post_intif_pGuildBroken) (int fd); -typedef void (*HPMHOOK_pre_intif_pGuildMessage) (int *fd); -typedef void (*HPMHOOK_post_intif_pGuildMessage) (int fd); typedef void (*HPMHOOK_pre_intif_pGuildBasicInfoChanged) (int *fd); typedef void (*HPMHOOK_post_intif_pGuildBasicInfoChanged) (int fd); typedef void (*HPMHOOK_pre_intif_pGuildMemberInfoChanged) (int *fd); @@ -4922,8 +4884,6 @@ typedef int (*HPMHOOK_pre_mapif_guild_memberinfoshort) (struct guild **g, int *i typedef int (*HPMHOOK_post_mapif_guild_memberinfoshort) (int retVal___, struct guild *g, int idx); typedef int (*HPMHOOK_pre_mapif_guild_broken) (int *guild_id, int *flag); typedef int (*HPMHOOK_post_mapif_guild_broken) (int retVal___, int guild_id, int flag); -typedef int (*HPMHOOK_pre_mapif_guild_message) (int *guild_id, int *account_id, const char **mes, int *len, int *sfd); -typedef int (*HPMHOOK_post_mapif_guild_message) (int retVal___, int guild_id, int account_id, const char *mes, int len, int sfd); typedef int (*HPMHOOK_pre_mapif_guild_basicinfochanged) (int *guild_id, int *type, const void **data, int *len); typedef int (*HPMHOOK_post_mapif_guild_basicinfochanged) (int retVal___, int guild_id, int type, const void *data, int len); typedef int (*HPMHOOK_pre_mapif_guild_memberinfochanged) (int *guild_id, int *account_id, int *char_id, int *type, const void **data, int *len); @@ -4954,8 +4914,6 @@ typedef int (*HPMHOOK_pre_mapif_parse_GuildChangeMemberInfoShort) (int *fd, int typedef int (*HPMHOOK_post_mapif_parse_GuildChangeMemberInfoShort) (int retVal___, int fd, int guild_id, int account_id, int char_id, int online, int lv, int class); typedef int (*HPMHOOK_pre_mapif_parse_BreakGuild) (int *fd, int *guild_id); typedef int (*HPMHOOK_post_mapif_parse_BreakGuild) (int retVal___, int fd, int guild_id); -typedef int (*HPMHOOK_pre_mapif_parse_GuildMessage) (int *fd, int *guild_id, int *account_id, const char **mes, int *len); -typedef int (*HPMHOOK_post_mapif_parse_GuildMessage) (int retVal___, int fd, int guild_id, int account_id, const char *mes, int len); typedef int (*HPMHOOK_pre_mapif_parse_GuildBasicInfoChange) (int *fd, int *guild_id, int *type, const void **data, int *len); typedef int (*HPMHOOK_post_mapif_parse_GuildBasicInfoChange) (int retVal___, int fd, int guild_id, int type, const void *data, int len); typedef int (*HPMHOOK_pre_mapif_parse_GuildMemberInfoChange) (int *fd, int *guild_id, int *account_id, int *char_id, int *type, const char **data, int *len); @@ -5050,8 +5008,6 @@ typedef int (*HPMHOOK_pre_mapif_party_membermoved) (struct party **p, int *idx); typedef int (*HPMHOOK_post_mapif_party_membermoved) (int retVal___, struct party *p, int idx); typedef int (*HPMHOOK_pre_mapif_party_broken) (int *party_id, int *flag); typedef int (*HPMHOOK_post_mapif_party_broken) (int retVal___, int party_id, int flag); -typedef int (*HPMHOOK_pre_mapif_party_message) (int *party_id, int *account_id, const char **mes, int *len, int *sfd); -typedef int (*HPMHOOK_post_mapif_party_message) (int retVal___, int party_id, int account_id, const char *mes, int len, int sfd); typedef int (*HPMHOOK_pre_mapif_parse_CreateParty) (int *fd, const char **name, int *item, int *item2, const struct party_member **leader); typedef int (*HPMHOOK_post_mapif_parse_CreateParty) (int retVal___, int fd, const char *name, int item, int item2, const struct party_member *leader); typedef void (*HPMHOOK_pre_mapif_parse_PartyInfo) (int *fd, int *party_id, int *char_id); @@ -5066,8 +5022,6 @@ typedef int (*HPMHOOK_pre_mapif_parse_PartyChangeMap) (int *fd, int *party_id, i typedef int (*HPMHOOK_post_mapif_parse_PartyChangeMap) (int retVal___, int fd, int party_id, int account_id, int char_id, unsigned short map, int online, unsigned int lv); typedef int (*HPMHOOK_pre_mapif_parse_BreakParty) (int *fd, int *party_id); typedef int (*HPMHOOK_post_mapif_parse_BreakParty) (int retVal___, int fd, int party_id); -typedef int (*HPMHOOK_pre_mapif_parse_PartyMessage) (int *fd, int *party_id, int *account_id, const char **mes, int *len); -typedef int (*HPMHOOK_post_mapif_parse_PartyMessage) (int retVal___, int fd, int party_id, int account_id, const char *mes, int len); typedef int (*HPMHOOK_pre_mapif_parse_PartyLeaderChange) (int *fd, int *party_id, int *account_id, int *char_id); typedef int (*HPMHOOK_post_mapif_parse_PartyLeaderChange) (int retVal___, int fd, int party_id, int account_id, int char_id); typedef int (*HPMHOOK_pre_mapif_pet_created) (int *fd, int *account_id, struct s_pet **p); @@ -5144,26 +5098,10 @@ typedef void (*HPMHOOK_pre_mapif_parse_ItemBoundRetrieve) (int *fd); typedef void (*HPMHOOK_post_mapif_parse_ItemBoundRetrieve) (int fd); typedef void (*HPMHOOK_pre_mapif_parse_accinfo) (int *fd); typedef void (*HPMHOOK_post_mapif_parse_accinfo) (int fd); -typedef int (*HPMHOOK_pre_mapif_broadcast) (const unsigned char **mes, int *len, unsigned int *fontColor, short *fontType, short *fontSize, short *fontAlign, short *fontY, int *sfd); -typedef int (*HPMHOOK_post_mapif_broadcast) (int retVal___, const unsigned char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, int sfd); -typedef int (*HPMHOOK_pre_mapif_wis_message) (struct WisData **wd); -typedef int (*HPMHOOK_post_mapif_wis_message) (int retVal___, struct WisData *wd); -typedef void (*HPMHOOK_pre_mapif_wis_response) (int *fd, const unsigned char **src, int *flag); -typedef void (*HPMHOOK_post_mapif_wis_response) (int fd, const unsigned char *src, int flag); -typedef int (*HPMHOOK_pre_mapif_wis_end) (struct WisData **wd, int *flag); -typedef int (*HPMHOOK_post_mapif_wis_end) (int retVal___, struct WisData *wd, int flag); typedef int (*HPMHOOK_pre_mapif_account_reg_reply) (int *fd, int *account_id, int *char_id, int *type); typedef int (*HPMHOOK_post_mapif_account_reg_reply) (int retVal___, int fd, int account_id, int char_id, int type); typedef int (*HPMHOOK_pre_mapif_disconnectplayer) (int *fd, int *account_id, int *char_id, int *reason); typedef int (*HPMHOOK_post_mapif_disconnectplayer) (int retVal___, int fd, int account_id, int char_id, int reason); -typedef int (*HPMHOOK_pre_mapif_parse_broadcast) (int *fd); -typedef int (*HPMHOOK_post_mapif_parse_broadcast) (int retVal___, int fd); -typedef int (*HPMHOOK_pre_mapif_parse_WisRequest) (int *fd); -typedef int (*HPMHOOK_post_mapif_parse_WisRequest) (int retVal___, int fd); -typedef int (*HPMHOOK_pre_mapif_parse_WisReply) (int *fd); -typedef int (*HPMHOOK_post_mapif_parse_WisReply) (int retVal___, int fd); -typedef int (*HPMHOOK_pre_mapif_parse_WisToGM) (int *fd); -typedef int (*HPMHOOK_post_mapif_parse_WisToGM) (int retVal___, int fd); typedef int (*HPMHOOK_pre_mapif_parse_Registry) (int *fd); typedef int (*HPMHOOK_post_mapif_parse_Registry) (int retVal___, int fd); typedef int (*HPMHOOK_pre_mapif_parse_RegistryRequest) (int *fd); @@ -5884,8 +5822,6 @@ typedef int (*HPMHOOK_pre_party_send_logout) (struct map_session_data **sd); typedef int (*HPMHOOK_post_party_send_logout) (int retVal___, struct map_session_data *sd); typedef int (*HPMHOOK_pre_party_send_message) (struct map_session_data **sd, const char **mes); typedef int (*HPMHOOK_post_party_send_message) (int retVal___, struct map_session_data *sd, const char *mes); -typedef int (*HPMHOOK_pre_party_recv_message) (int *party_id, int *account_id, const char **mes, int *len); -typedef int (*HPMHOOK_post_party_recv_message) (int retVal___, int party_id, int account_id, const char *mes, int len); typedef int (*HPMHOOK_pre_party_skill_check) (struct map_session_data **sd, int *party_id, uint16 *skill_id, uint16 *skill_lv); typedef int (*HPMHOOK_post_party_skill_check) (int retVal___, struct map_session_data *sd, int party_id, uint16 skill_id, uint16 skill_lv); typedef int (*HPMHOOK_pre_party_send_xy_clear) (struct party_data **p); @@ -6438,6 +6374,10 @@ typedef int (*HPMHOOK_pre_pc_have_magnifier) (struct map_session_data **sd); typedef int (*HPMHOOK_post_pc_have_magnifier) (int retVal___, struct map_session_data *sd); typedef bool (*HPMHOOK_pre_pc_process_chat_message) (struct map_session_data **sd, const char **message); typedef bool (*HPMHOOK_post_pc_process_chat_message) (bool retVal___, struct map_session_data *sd, const char *message); +typedef int (*HPMHOOK_pre_pc_wis_message_to_gm) (const char **sender_name, int *permission, const char **message); +typedef int (*HPMHOOK_post_pc_wis_message_to_gm) (int retVal___, const char *sender_name, int permission, const char *message); +typedef int (*HPMHOOK_pre_pc_wis_message_to_gm_sub) (struct map_session_data **sd, va_list va); +typedef int (*HPMHOOK_post_pc_wis_message_to_gm_sub) (int retVal___, struct map_session_data *sd, va_list va); typedef void (*HPMHOOK_pre_pc_check_supernovice_call) (struct map_session_data **sd, const char **message); typedef void (*HPMHOOK_post_pc_check_supernovice_call) (struct map_session_data *sd, const char *message); typedef bool (*HPMHOOK_pre_pc_check_basicskill) (struct map_session_data **sd, int *level); diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc index 9302a8d19..a5f65654e 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc @@ -610,10 +610,6 @@ struct { struct HPMHookPoint *HP_inter_init_sql_post; struct HPMHookPoint *HP_inter_mapif_init_pre; struct HPMHookPoint *HP_inter_mapif_init_post; - struct HPMHookPoint *HP_inter_check_ttl_wisdata_sub_pre; - struct HPMHookPoint *HP_inter_check_ttl_wisdata_sub_post; - struct HPMHookPoint *HP_inter_check_ttl_wisdata_pre; - struct HPMHookPoint *HP_inter_check_ttl_wisdata_post; struct HPMHookPoint *HP_inter_check_length_pre; struct HPMHookPoint *HP_inter_check_length_post; struct HPMHookPoint *HP_inter_parse_frommap_pre; @@ -630,12 +626,6 @@ struct { struct HPMHookPoint *HP_inter_accinfo_post; struct HPMHookPoint *HP_inter_accinfo2_pre; struct HPMHookPoint *HP_inter_accinfo2_post; - struct HPMHookPoint *HP_inter_add_wisdata_pre; - struct HPMHookPoint *HP_inter_add_wisdata_post; - struct HPMHookPoint *HP_inter_get_wisdata_pre; - struct HPMHookPoint *HP_inter_get_wisdata_post; - struct HPMHookPoint *HP_inter_remove_wisdata_pre; - struct HPMHookPoint *HP_inter_remove_wisdata_post; struct HPMHookPoint *HP_inter_mail_sql_init_pre; struct HPMHookPoint *HP_inter_mail_sql_init_post; struct HPMHookPoint *HP_inter_mail_sql_final_pre; @@ -1032,8 +1022,6 @@ struct { struct HPMHookPoint *HP_mapif_guild_memberinfoshort_post; struct HPMHookPoint *HP_mapif_guild_broken_pre; struct HPMHookPoint *HP_mapif_guild_broken_post; - struct HPMHookPoint *HP_mapif_guild_message_pre; - struct HPMHookPoint *HP_mapif_guild_message_post; struct HPMHookPoint *HP_mapif_guild_basicinfochanged_pre; struct HPMHookPoint *HP_mapif_guild_basicinfochanged_post; struct HPMHookPoint *HP_mapif_guild_memberinfochanged_pre; @@ -1064,8 +1052,6 @@ struct { struct HPMHookPoint *HP_mapif_parse_GuildChangeMemberInfoShort_post; struct HPMHookPoint *HP_mapif_parse_BreakGuild_pre; struct HPMHookPoint *HP_mapif_parse_BreakGuild_post; - struct HPMHookPoint *HP_mapif_parse_GuildMessage_pre; - struct HPMHookPoint *HP_mapif_parse_GuildMessage_post; struct HPMHookPoint *HP_mapif_parse_GuildBasicInfoChange_pre; struct HPMHookPoint *HP_mapif_parse_GuildBasicInfoChange_post; struct HPMHookPoint *HP_mapif_parse_GuildMemberInfoChange_pre; @@ -1160,8 +1146,6 @@ struct { struct HPMHookPoint *HP_mapif_party_membermoved_post; struct HPMHookPoint *HP_mapif_party_broken_pre; struct HPMHookPoint *HP_mapif_party_broken_post; - struct HPMHookPoint *HP_mapif_party_message_pre; - struct HPMHookPoint *HP_mapif_party_message_post; struct HPMHookPoint *HP_mapif_parse_CreateParty_pre; struct HPMHookPoint *HP_mapif_parse_CreateParty_post; struct HPMHookPoint *HP_mapif_parse_PartyInfo_pre; @@ -1176,8 +1160,6 @@ struct { struct HPMHookPoint *HP_mapif_parse_PartyChangeMap_post; struct HPMHookPoint *HP_mapif_parse_BreakParty_pre; struct HPMHookPoint *HP_mapif_parse_BreakParty_post; - struct HPMHookPoint *HP_mapif_parse_PartyMessage_pre; - struct HPMHookPoint *HP_mapif_parse_PartyMessage_post; struct HPMHookPoint *HP_mapif_parse_PartyLeaderChange_pre; struct HPMHookPoint *HP_mapif_parse_PartyLeaderChange_post; struct HPMHookPoint *HP_mapif_pet_created_pre; @@ -1254,26 +1236,10 @@ struct { struct HPMHookPoint *HP_mapif_parse_ItemBoundRetrieve_post; struct HPMHookPoint *HP_mapif_parse_accinfo_pre; struct HPMHookPoint *HP_mapif_parse_accinfo_post; - struct HPMHookPoint *HP_mapif_broadcast_pre; - struct HPMHookPoint *HP_mapif_broadcast_post; - struct HPMHookPoint *HP_mapif_wis_message_pre; - struct HPMHookPoint *HP_mapif_wis_message_post; - struct HPMHookPoint *HP_mapif_wis_response_pre; - struct HPMHookPoint *HP_mapif_wis_response_post; - struct HPMHookPoint *HP_mapif_wis_end_pre; - struct HPMHookPoint *HP_mapif_wis_end_post; struct HPMHookPoint *HP_mapif_account_reg_reply_pre; struct HPMHookPoint *HP_mapif_account_reg_reply_post; struct HPMHookPoint *HP_mapif_disconnectplayer_pre; struct HPMHookPoint *HP_mapif_disconnectplayer_post; - struct HPMHookPoint *HP_mapif_parse_broadcast_pre; - struct HPMHookPoint *HP_mapif_parse_broadcast_post; - struct HPMHookPoint *HP_mapif_parse_WisRequest_pre; - struct HPMHookPoint *HP_mapif_parse_WisRequest_post; - struct HPMHookPoint *HP_mapif_parse_WisReply_pre; - struct HPMHookPoint *HP_mapif_parse_WisReply_post; - struct HPMHookPoint *HP_mapif_parse_WisToGM_pre; - struct HPMHookPoint *HP_mapif_parse_WisToGM_post; struct HPMHookPoint *HP_mapif_parse_Registry_pre; struct HPMHookPoint *HP_mapif_parse_Registry_post; struct HPMHookPoint *HP_mapif_parse_RegistryRequest_pre; @@ -2257,10 +2223,6 @@ struct { int HP_inter_init_sql_post; int HP_inter_mapif_init_pre; int HP_inter_mapif_init_post; - int HP_inter_check_ttl_wisdata_sub_pre; - int HP_inter_check_ttl_wisdata_sub_post; - int HP_inter_check_ttl_wisdata_pre; - int HP_inter_check_ttl_wisdata_post; int HP_inter_check_length_pre; int HP_inter_check_length_post; int HP_inter_parse_frommap_pre; @@ -2277,12 +2239,6 @@ struct { int HP_inter_accinfo_post; int HP_inter_accinfo2_pre; int HP_inter_accinfo2_post; - int HP_inter_add_wisdata_pre; - int HP_inter_add_wisdata_post; - int HP_inter_get_wisdata_pre; - int HP_inter_get_wisdata_post; - int HP_inter_remove_wisdata_pre; - int HP_inter_remove_wisdata_post; int HP_inter_mail_sql_init_pre; int HP_inter_mail_sql_init_post; int HP_inter_mail_sql_final_pre; @@ -2679,8 +2635,6 @@ struct { int HP_mapif_guild_memberinfoshort_post; int HP_mapif_guild_broken_pre; int HP_mapif_guild_broken_post; - int HP_mapif_guild_message_pre; - int HP_mapif_guild_message_post; int HP_mapif_guild_basicinfochanged_pre; int HP_mapif_guild_basicinfochanged_post; int HP_mapif_guild_memberinfochanged_pre; @@ -2711,8 +2665,6 @@ struct { int HP_mapif_parse_GuildChangeMemberInfoShort_post; int HP_mapif_parse_BreakGuild_pre; int HP_mapif_parse_BreakGuild_post; - int HP_mapif_parse_GuildMessage_pre; - int HP_mapif_parse_GuildMessage_post; int HP_mapif_parse_GuildBasicInfoChange_pre; int HP_mapif_parse_GuildBasicInfoChange_post; int HP_mapif_parse_GuildMemberInfoChange_pre; @@ -2807,8 +2759,6 @@ struct { int HP_mapif_party_membermoved_post; int HP_mapif_party_broken_pre; int HP_mapif_party_broken_post; - int HP_mapif_party_message_pre; - int HP_mapif_party_message_post; int HP_mapif_parse_CreateParty_pre; int HP_mapif_parse_CreateParty_post; int HP_mapif_parse_PartyInfo_pre; @@ -2823,8 +2773,6 @@ struct { int HP_mapif_parse_PartyChangeMap_post; int HP_mapif_parse_BreakParty_pre; int HP_mapif_parse_BreakParty_post; - int HP_mapif_parse_PartyMessage_pre; - int HP_mapif_parse_PartyMessage_post; int HP_mapif_parse_PartyLeaderChange_pre; int HP_mapif_parse_PartyLeaderChange_post; int HP_mapif_pet_created_pre; @@ -2901,26 +2849,10 @@ struct { int HP_mapif_parse_ItemBoundRetrieve_post; int HP_mapif_parse_accinfo_pre; int HP_mapif_parse_accinfo_post; - int HP_mapif_broadcast_pre; - int HP_mapif_broadcast_post; - int HP_mapif_wis_message_pre; - int HP_mapif_wis_message_post; - int HP_mapif_wis_response_pre; - int HP_mapif_wis_response_post; - int HP_mapif_wis_end_pre; - int HP_mapif_wis_end_post; int HP_mapif_account_reg_reply_pre; int HP_mapif_account_reg_reply_post; int HP_mapif_disconnectplayer_pre; int HP_mapif_disconnectplayer_post; - int HP_mapif_parse_broadcast_pre; - int HP_mapif_parse_broadcast_post; - int HP_mapif_parse_WisRequest_pre; - int HP_mapif_parse_WisRequest_post; - int HP_mapif_parse_WisReply_pre; - int HP_mapif_parse_WisReply_post; - int HP_mapif_parse_WisToGM_pre; - int HP_mapif_parse_WisToGM_post; int HP_mapif_parse_Registry_pre; int HP_mapif_parse_Registry_post; int HP_mapif_parse_RegistryRequest_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc index 60162c1a8..efd72b670 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc @@ -333,8 +333,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(inter->vlog, HP_inter_vlog) }, { HP_POP(inter->init_sql, HP_inter_init_sql) }, { HP_POP(inter->mapif_init, HP_inter_mapif_init) }, - { HP_POP(inter->check_ttl_wisdata_sub, HP_inter_check_ttl_wisdata_sub) }, - { HP_POP(inter->check_ttl_wisdata, HP_inter_check_ttl_wisdata) }, { HP_POP(inter->check_length, HP_inter_check_length) }, { HP_POP(inter->parse_frommap, HP_inter_parse_frommap) }, { HP_POP(inter->final, HP_inter_final) }, @@ -343,9 +341,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(inter->config_read_connection, HP_inter_config_read_connection) }, { HP_POP(inter->accinfo, HP_inter_accinfo) }, { HP_POP(inter->accinfo2, HP_inter_accinfo2) }, - { HP_POP(inter->add_wisdata, HP_inter_add_wisdata) }, - { HP_POP(inter->get_wisdata, HP_inter_get_wisdata) }, - { HP_POP(inter->remove_wisdata, HP_inter_remove_wisdata) }, /* inter_mail_interface */ { HP_POP(inter_mail->sql_init, HP_inter_mail_sql_init) }, { HP_POP(inter_mail->sql_final, HP_inter_mail_sql_final) }, @@ -554,7 +549,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mapif->guild_withdraw, HP_mapif_guild_withdraw) }, { HP_POP(mapif->guild_memberinfoshort, HP_mapif_guild_memberinfoshort) }, { HP_POP(mapif->guild_broken, HP_mapif_guild_broken) }, - { HP_POP(mapif->guild_message, HP_mapif_guild_message) }, { HP_POP(mapif->guild_basicinfochanged, HP_mapif_guild_basicinfochanged) }, { HP_POP(mapif->guild_memberinfochanged, HP_mapif_guild_memberinfochanged) }, { HP_POP(mapif->guild_skillupack, HP_mapif_guild_skillupack) }, @@ -570,7 +564,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mapif->parse_GuildLeave, HP_mapif_parse_GuildLeave) }, { HP_POP(mapif->parse_GuildChangeMemberInfoShort, HP_mapif_parse_GuildChangeMemberInfoShort) }, { HP_POP(mapif->parse_BreakGuild, HP_mapif_parse_BreakGuild) }, - { HP_POP(mapif->parse_GuildMessage, HP_mapif_parse_GuildMessage) }, { HP_POP(mapif->parse_GuildBasicInfoChange, HP_mapif_parse_GuildBasicInfoChange) }, { HP_POP(mapif->parse_GuildMemberInfoChange, HP_mapif_parse_GuildMemberInfoChange) }, { HP_POP(mapif->parse_GuildPosition, HP_mapif_parse_GuildPosition) }, @@ -618,7 +611,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mapif->party_withdraw, HP_mapif_party_withdraw) }, { HP_POP(mapif->party_membermoved, HP_mapif_party_membermoved) }, { HP_POP(mapif->party_broken, HP_mapif_party_broken) }, - { HP_POP(mapif->party_message, HP_mapif_party_message) }, { HP_POP(mapif->parse_CreateParty, HP_mapif_parse_CreateParty) }, { HP_POP(mapif->parse_PartyInfo, HP_mapif_parse_PartyInfo) }, { HP_POP(mapif->parse_PartyAddMember, HP_mapif_parse_PartyAddMember) }, @@ -626,7 +618,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mapif->parse_PartyLeave, HP_mapif_parse_PartyLeave) }, { HP_POP(mapif->parse_PartyChangeMap, HP_mapif_parse_PartyChangeMap) }, { HP_POP(mapif->parse_BreakParty, HP_mapif_parse_BreakParty) }, - { HP_POP(mapif->parse_PartyMessage, HP_mapif_parse_PartyMessage) }, { HP_POP(mapif->parse_PartyLeaderChange, HP_mapif_parse_PartyLeaderChange) }, { HP_POP(mapif->pet_created, HP_mapif_pet_created) }, { HP_POP(mapif->pet_info, HP_mapif_pet_info) }, @@ -665,16 +656,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mapif->itembound_ack, HP_mapif_itembound_ack) }, { HP_POP(mapif->parse_ItemBoundRetrieve, HP_mapif_parse_ItemBoundRetrieve) }, { HP_POP(mapif->parse_accinfo, HP_mapif_parse_accinfo) }, - { HP_POP(mapif->broadcast, HP_mapif_broadcast) }, - { HP_POP(mapif->wis_message, HP_mapif_wis_message) }, - { HP_POP(mapif->wis_response, HP_mapif_wis_response) }, - { HP_POP(mapif->wis_end, HP_mapif_wis_end) }, { HP_POP(mapif->account_reg_reply, HP_mapif_account_reg_reply) }, { HP_POP(mapif->disconnectplayer, HP_mapif_disconnectplayer) }, - { HP_POP(mapif->parse_broadcast, HP_mapif_parse_broadcast) }, - { HP_POP(mapif->parse_WisRequest, HP_mapif_parse_WisRequest) }, - { HP_POP(mapif->parse_WisReply, HP_mapif_parse_WisReply) }, - { HP_POP(mapif->parse_WisToGM, HP_mapif_parse_WisToGM) }, { HP_POP(mapif->parse_Registry, HP_mapif_parse_Registry) }, { HP_POP(mapif->parse_RegistryRequest, HP_mapif_parse_RegistryRequest) }, { HP_POP(mapif->namechange_ack, HP_mapif_namechange_ack) }, diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc index 2b7e25e5d..7ce54d288 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc @@ -7851,66 +7851,6 @@ int HP_inter_mapif_init(int fd) { } return retVal___; } -int HP_inter_check_ttl_wisdata_sub(union DBKey key, struct DBData *data, va_list ap) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_inter_check_ttl_wisdata_sub_pre > 0) { - int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_check_ttl_wisdata_sub_pre; hIndex++) { - va_list ap___copy; va_copy(ap___copy, ap); - preHookFunc = HPMHooks.list.HP_inter_check_ttl_wisdata_sub_pre[hIndex].func; - retVal___ = preHookFunc(&key, &data, 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.inter.check_ttl_wisdata_sub(key, data, ap___copy); - va_end(ap___copy); - } - if (HPMHooks.count.HP_inter_check_ttl_wisdata_sub_post > 0) { - int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap); - for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_check_ttl_wisdata_sub_post; hIndex++) { - va_list ap___copy; va_copy(ap___copy, ap); - postHookFunc = HPMHooks.list.HP_inter_check_ttl_wisdata_sub_post[hIndex].func; - retVal___ = postHookFunc(retVal___, key, data, ap___copy); - va_end(ap___copy); - } - } - return retVal___; -} -int HP_inter_check_ttl_wisdata(void) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_inter_check_ttl_wisdata_pre > 0) { - int (*preHookFunc) (void); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_check_ttl_wisdata_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_inter_check_ttl_wisdata_pre[hIndex].func; - retVal___ = preHookFunc(); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.inter.check_ttl_wisdata(); - } - if (HPMHooks.count.HP_inter_check_ttl_wisdata_post > 0) { - int (*postHookFunc) (int retVal___); - for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_check_ttl_wisdata_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_inter_check_ttl_wisdata_post[hIndex].func; - retVal___ = postHookFunc(retVal___); - } - } - return retVal___; -} int HP_inter_check_length(int fd, int length) { int hIndex = 0; int retVal___ = 0; @@ -8124,86 +8064,6 @@ void HP_inter_accinfo2(bool success, int map_fd, int u_fd, int u_aid, int accoun } return; } -struct WisData* HP_inter_add_wisdata(int fd, const unsigned char *src, const unsigned char *dst, const unsigned char *msg, int msg_len) { - int hIndex = 0; - struct WisData* retVal___ = NULL; - if (HPMHooks.count.HP_inter_add_wisdata_pre > 0) { - struct WisData* (*preHookFunc) (int *fd, const unsigned char **src, const unsigned char **dst, const unsigned char **msg, int *msg_len); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_add_wisdata_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_inter_add_wisdata_pre[hIndex].func; - retVal___ = preHookFunc(&fd, &src, &dst, &msg, &msg_len); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.inter.add_wisdata(fd, src, dst, msg, msg_len); - } - if (HPMHooks.count.HP_inter_add_wisdata_post > 0) { - struct WisData* (*postHookFunc) (struct WisData* retVal___, int fd, const unsigned char *src, const unsigned char *dst, const unsigned char *msg, int msg_len); - for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_add_wisdata_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_inter_add_wisdata_post[hIndex].func; - retVal___ = postHookFunc(retVal___, fd, src, dst, msg, msg_len); - } - } - return retVal___; -} -struct WisData* HP_inter_get_wisdata(int id) { - int hIndex = 0; - struct WisData* retVal___ = NULL; - if (HPMHooks.count.HP_inter_get_wisdata_pre > 0) { - struct WisData* (*preHookFunc) (int *id); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_get_wisdata_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_inter_get_wisdata_pre[hIndex].func; - retVal___ = preHookFunc(&id); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.inter.get_wisdata(id); - } - if (HPMHooks.count.HP_inter_get_wisdata_post > 0) { - struct WisData* (*postHookFunc) (struct WisData* retVal___, int id); - for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_get_wisdata_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_inter_get_wisdata_post[hIndex].func; - retVal___ = postHookFunc(retVal___, id); - } - } - return retVal___; -} -void HP_inter_remove_wisdata(int id) { - int hIndex = 0; - if (HPMHooks.count.HP_inter_remove_wisdata_pre > 0) { - void (*preHookFunc) (int *id); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_remove_wisdata_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_inter_remove_wisdata_pre[hIndex].func; - preHookFunc(&id); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.inter.remove_wisdata(id); - } - if (HPMHooks.count.HP_inter_remove_wisdata_post > 0) { - void (*postHookFunc) (int id); - for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_remove_wisdata_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_inter_remove_wisdata_post[hIndex].func; - postHookFunc(id); - } - } - return; -} /* inter_mail_interface */ int HP_inter_mail_sql_init(void) { int hIndex = 0; @@ -13498,33 +13358,6 @@ int HP_mapif_guild_broken(int guild_id, int flag) { } return retVal___; } -int HP_mapif_guild_message(int guild_id, int account_id, const char *mes, int len, int sfd) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_guild_message_pre > 0) { - int (*preHookFunc) (int *guild_id, int *account_id, const char **mes, int *len, int *sfd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_message_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_guild_message_pre[hIndex].func; - retVal___ = preHookFunc(&guild_id, &account_id, &mes, &len, &sfd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.guild_message(guild_id, account_id, mes, len, sfd); - } - if (HPMHooks.count.HP_mapif_guild_message_post > 0) { - int (*postHookFunc) (int retVal___, int guild_id, int account_id, const char *mes, int len, int sfd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_message_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_guild_message_post[hIndex].func; - retVal___ = postHookFunc(retVal___, guild_id, account_id, mes, len, sfd); - } - } - return retVal___; -} int HP_mapif_guild_basicinfochanged(int guild_id, int type, const void *data, int len) { int hIndex = 0; int retVal___ = 0; @@ -13930,33 +13763,6 @@ int HP_mapif_parse_BreakGuild(int fd, int guild_id) { } return retVal___; } -int HP_mapif_parse_GuildMessage(int fd, int guild_id, int account_id, const char *mes, int len) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_parse_GuildMessage_pre > 0) { - int (*preHookFunc) (int *fd, int *guild_id, int *account_id, const char **mes, int *len); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildMessage_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_parse_GuildMessage_pre[hIndex].func; - retVal___ = preHookFunc(&fd, &guild_id, &account_id, &mes, &len); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.parse_GuildMessage(fd, guild_id, account_id, mes, len); - } - if (HPMHooks.count.HP_mapif_parse_GuildMessage_post > 0) { - int (*postHookFunc) (int retVal___, int fd, int guild_id, int account_id, const char *mes, int len); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildMessage_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_parse_GuildMessage_post[hIndex].func; - retVal___ = postHookFunc(retVal___, fd, guild_id, account_id, mes, len); - } - } - return retVal___; -} int HP_mapif_parse_GuildBasicInfoChange(int fd, int guild_id, int type, const void *data, int len) { int hIndex = 0; int retVal___ = 0; @@ -15195,33 +15001,6 @@ int HP_mapif_party_broken(int party_id, int flag) { } return retVal___; } -int HP_mapif_party_message(int party_id, int account_id, const char *mes, int len, int sfd) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_party_message_pre > 0) { - int (*preHookFunc) (int *party_id, int *account_id, const char **mes, int *len, int *sfd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_message_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_party_message_pre[hIndex].func; - retVal___ = preHookFunc(&party_id, &account_id, &mes, &len, &sfd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.party_message(party_id, account_id, mes, len, sfd); - } - if (HPMHooks.count.HP_mapif_party_message_post > 0) { - int (*postHookFunc) (int retVal___, int party_id, int account_id, const char *mes, int len, int sfd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_message_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_party_message_post[hIndex].func; - retVal___ = postHookFunc(retVal___, party_id, account_id, mes, len, sfd); - } - } - return retVal___; -} int HP_mapif_parse_CreateParty(int fd, const char *name, int item, int item2, const struct party_member *leader) { int hIndex = 0; int retVal___ = 0; @@ -15410,33 +15189,6 @@ int HP_mapif_parse_BreakParty(int fd, int party_id) { } return retVal___; } -int HP_mapif_parse_PartyMessage(int fd, int party_id, int account_id, const char *mes, int len) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_parse_PartyMessage_pre > 0) { - int (*preHookFunc) (int *fd, int *party_id, int *account_id, const char **mes, int *len); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyMessage_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_parse_PartyMessage_pre[hIndex].func; - retVal___ = preHookFunc(&fd, &party_id, &account_id, &mes, &len); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.parse_PartyMessage(fd, party_id, account_id, mes, len); - } - if (HPMHooks.count.HP_mapif_parse_PartyMessage_post > 0) { - int (*postHookFunc) (int retVal___, int fd, int party_id, int account_id, const char *mes, int len); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyMessage_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_parse_PartyMessage_post[hIndex].func; - retVal___ = postHookFunc(retVal___, fd, party_id, account_id, mes, len); - } - } - return retVal___; -} int HP_mapif_parse_PartyLeaderChange(int fd, int party_id, int account_id, int char_id) { int hIndex = 0; int retVal___ = 0; @@ -16447,113 +16199,6 @@ void HP_mapif_parse_accinfo(int fd) { } return; } -int HP_mapif_broadcast(const unsigned char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, int sfd) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_broadcast_pre > 0) { - int (*preHookFunc) (const unsigned char **mes, int *len, unsigned int *fontColor, short *fontType, short *fontSize, short *fontAlign, short *fontY, int *sfd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_broadcast_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_broadcast_pre[hIndex].func; - retVal___ = preHookFunc(&mes, &len, &fontColor, &fontType, &fontSize, &fontAlign, &fontY, &sfd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.broadcast(mes, len, fontColor, fontType, fontSize, fontAlign, fontY, sfd); - } - if (HPMHooks.count.HP_mapif_broadcast_post > 0) { - int (*postHookFunc) (int retVal___, const unsigned char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, int sfd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_broadcast_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_broadcast_post[hIndex].func; - retVal___ = postHookFunc(retVal___, mes, len, fontColor, fontType, fontSize, fontAlign, fontY, sfd); - } - } - return retVal___; -} -int HP_mapif_wis_message(struct WisData *wd) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_wis_message_pre > 0) { - int (*preHookFunc) (struct WisData **wd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_message_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_wis_message_pre[hIndex].func; - retVal___ = preHookFunc(&wd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.wis_message(wd); - } - if (HPMHooks.count.HP_mapif_wis_message_post > 0) { - int (*postHookFunc) (int retVal___, struct WisData *wd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_message_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_wis_message_post[hIndex].func; - retVal___ = postHookFunc(retVal___, wd); - } - } - return retVal___; -} -void HP_mapif_wis_response(int fd, const unsigned char *src, int flag) { - int hIndex = 0; - if (HPMHooks.count.HP_mapif_wis_response_pre > 0) { - void (*preHookFunc) (int *fd, const unsigned char **src, int *flag); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_response_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_wis_response_pre[hIndex].func; - preHookFunc(&fd, &src, &flag); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.mapif.wis_response(fd, src, flag); - } - if (HPMHooks.count.HP_mapif_wis_response_post > 0) { - void (*postHookFunc) (int fd, const unsigned char *src, int flag); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_response_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_wis_response_post[hIndex].func; - postHookFunc(fd, src, flag); - } - } - return; -} -int HP_mapif_wis_end(struct WisData *wd, int flag) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_wis_end_pre > 0) { - int (*preHookFunc) (struct WisData **wd, int *flag); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_end_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_wis_end_pre[hIndex].func; - retVal___ = preHookFunc(&wd, &flag); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.wis_end(wd, flag); - } - if (HPMHooks.count.HP_mapif_wis_end_post > 0) { - int (*postHookFunc) (int retVal___, struct WisData *wd, int flag); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_end_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_wis_end_post[hIndex].func; - retVal___ = postHookFunc(retVal___, wd, flag); - } - } - return retVal___; -} int HP_mapif_account_reg_reply(int fd, int account_id, int char_id, int type) { int hIndex = 0; int retVal___ = 0; @@ -16608,114 +16253,6 @@ int HP_mapif_disconnectplayer(int fd, int account_id, int char_id, int reason) { } return retVal___; } -int HP_mapif_parse_broadcast(int fd) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_parse_broadcast_pre > 0) { - int (*preHookFunc) (int *fd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_broadcast_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_parse_broadcast_pre[hIndex].func; - retVal___ = preHookFunc(&fd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.parse_broadcast(fd); - } - if (HPMHooks.count.HP_mapif_parse_broadcast_post > 0) { - int (*postHookFunc) (int retVal___, int fd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_broadcast_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_parse_broadcast_post[hIndex].func; - retVal___ = postHookFunc(retVal___, fd); - } - } - return retVal___; -} -int HP_mapif_parse_WisRequest(int fd) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_parse_WisRequest_pre > 0) { - int (*preHookFunc) (int *fd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisRequest_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_parse_WisRequest_pre[hIndex].func; - retVal___ = preHookFunc(&fd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.parse_WisRequest(fd); - } - if (HPMHooks.count.HP_mapif_parse_WisRequest_post > 0) { - int (*postHookFunc) (int retVal___, int fd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisRequest_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_parse_WisRequest_post[hIndex].func; - retVal___ = postHookFunc(retVal___, fd); - } - } - return retVal___; -} -int HP_mapif_parse_WisReply(int fd) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_parse_WisReply_pre > 0) { - int (*preHookFunc) (int *fd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisReply_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_parse_WisReply_pre[hIndex].func; - retVal___ = preHookFunc(&fd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.parse_WisReply(fd); - } - if (HPMHooks.count.HP_mapif_parse_WisReply_post > 0) { - int (*postHookFunc) (int retVal___, int fd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisReply_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_parse_WisReply_post[hIndex].func; - retVal___ = postHookFunc(retVal___, fd); - } - } - return retVal___; -} -int HP_mapif_parse_WisToGM(int fd) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_mapif_parse_WisToGM_pre > 0) { - int (*preHookFunc) (int *fd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisToGM_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapif_parse_WisToGM_pre[hIndex].func; - retVal___ = preHookFunc(&fd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mapif.parse_WisToGM(fd); - } - if (HPMHooks.count.HP_mapif_parse_WisToGM_post > 0) { - int (*postHookFunc) (int retVal___, int fd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisToGM_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapif_parse_WisToGM_post[hIndex].func; - retVal___ = postHookFunc(retVal___, fd); - } - } - return retVal___; -} int HP_mapif_parse_Registry(int fd) { int hIndex = 0; int retVal___ = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index c87729dee..2faafacc5 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -2574,8 +2574,6 @@ struct { struct HPMHookPoint *HP_guild_emblem_changed_post; struct HPMHookPoint *HP_guild_send_message_pre; struct HPMHookPoint *HP_guild_send_message_post; - struct HPMHookPoint *HP_guild_recv_message_pre; - struct HPMHookPoint *HP_guild_recv_message_post; struct HPMHookPoint *HP_guild_send_dot_remove_pre; struct HPMHookPoint *HP_guild_send_dot_remove_post; struct HPMHookPoint *HP_guild_skillupack_pre; @@ -2818,16 +2816,6 @@ struct { struct HPMHookPoint *HP_intif_parse_post; struct HPMHookPoint *HP_intif_create_pet_pre; struct HPMHookPoint *HP_intif_create_pet_post; - struct HPMHookPoint *HP_intif_broadcast_pre; - struct HPMHookPoint *HP_intif_broadcast_post; - struct HPMHookPoint *HP_intif_broadcast2_pre; - struct HPMHookPoint *HP_intif_broadcast2_post; - struct HPMHookPoint *HP_intif_main_message_pre; - struct HPMHookPoint *HP_intif_main_message_post; - struct HPMHookPoint *HP_intif_wis_message_pre; - struct HPMHookPoint *HP_intif_wis_message_post; - struct HPMHookPoint *HP_intif_wis_message_to_gm_pre; - struct HPMHookPoint *HP_intif_wis_message_to_gm_post; struct HPMHookPoint *HP_intif_saveregistry_pre; struct HPMHookPoint *HP_intif_saveregistry_post; struct HPMHookPoint *HP_intif_request_registry_pre; @@ -2854,8 +2842,6 @@ struct { struct HPMHookPoint *HP_intif_party_changemap_post; struct HPMHookPoint *HP_intif_break_party_pre; struct HPMHookPoint *HP_intif_break_party_post; - struct HPMHookPoint *HP_intif_party_message_pre; - struct HPMHookPoint *HP_intif_party_message_post; struct HPMHookPoint *HP_intif_party_leaderchange_pre; struct HPMHookPoint *HP_intif_party_leaderchange_post; struct HPMHookPoint *HP_intif_guild_create_pre; @@ -2870,8 +2856,6 @@ struct { struct HPMHookPoint *HP_intif_guild_memberinfoshort_post; struct HPMHookPoint *HP_intif_guild_break_pre; struct HPMHookPoint *HP_intif_guild_break_post; - struct HPMHookPoint *HP_intif_guild_message_pre; - struct HPMHookPoint *HP_intif_guild_message_post; struct HPMHookPoint *HP_intif_guild_change_gm_pre; struct HPMHookPoint *HP_intif_guild_change_gm_post; struct HPMHookPoint *HP_intif_guild_change_basicinfo_pre; @@ -2978,14 +2962,6 @@ struct { struct HPMHookPoint *HP_intif_achievements_request_post; struct HPMHookPoint *HP_intif_achievements_save_pre; struct HPMHookPoint *HP_intif_achievements_save_post; - struct HPMHookPoint *HP_intif_pWisMessage_pre; - struct HPMHookPoint *HP_intif_pWisMessage_post; - struct HPMHookPoint *HP_intif_pWisEnd_pre; - struct HPMHookPoint *HP_intif_pWisEnd_post; - struct HPMHookPoint *HP_intif_pWisToGM_sub_pre; - struct HPMHookPoint *HP_intif_pWisToGM_sub_post; - struct HPMHookPoint *HP_intif_pWisToGM_pre; - struct HPMHookPoint *HP_intif_pWisToGM_post; struct HPMHookPoint *HP_intif_pRegisters_pre; struct HPMHookPoint *HP_intif_pRegisters_post; struct HPMHookPoint *HP_intif_pAccountStorage_pre; @@ -3014,8 +2990,6 @@ struct { struct HPMHookPoint *HP_intif_pPartyMove_post; struct HPMHookPoint *HP_intif_pPartyBroken_pre; struct HPMHookPoint *HP_intif_pPartyBroken_post; - struct HPMHookPoint *HP_intif_pPartyMessage_pre; - struct HPMHookPoint *HP_intif_pPartyMessage_post; struct HPMHookPoint *HP_intif_pGuildCreated_pre; struct HPMHookPoint *HP_intif_pGuildCreated_post; struct HPMHookPoint *HP_intif_pGuildInfo_pre; @@ -3028,8 +3002,6 @@ struct { struct HPMHookPoint *HP_intif_pGuildMemberInfoShort_post; struct HPMHookPoint *HP_intif_pGuildBroken_pre; struct HPMHookPoint *HP_intif_pGuildBroken_post; - struct HPMHookPoint *HP_intif_pGuildMessage_pre; - struct HPMHookPoint *HP_intif_pGuildMessage_post; struct HPMHookPoint *HP_intif_pGuildBasicInfoChanged_pre; struct HPMHookPoint *HP_intif_pGuildBasicInfoChanged_post; struct HPMHookPoint *HP_intif_pGuildMemberInfoChanged_pre; @@ -4440,8 +4412,6 @@ struct { struct HPMHookPoint *HP_party_send_logout_post; struct HPMHookPoint *HP_party_send_message_pre; struct HPMHookPoint *HP_party_send_message_post; - struct HPMHookPoint *HP_party_recv_message_pre; - struct HPMHookPoint *HP_party_recv_message_post; struct HPMHookPoint *HP_party_skill_check_pre; struct HPMHookPoint *HP_party_skill_check_post; struct HPMHookPoint *HP_party_send_xy_clear_pre; @@ -4988,6 +4958,10 @@ struct { struct HPMHookPoint *HP_pc_have_magnifier_post; struct HPMHookPoint *HP_pc_process_chat_message_pre; struct HPMHookPoint *HP_pc_process_chat_message_post; + struct HPMHookPoint *HP_pc_wis_message_to_gm_pre; + struct HPMHookPoint *HP_pc_wis_message_to_gm_post; + struct HPMHookPoint *HP_pc_wis_message_to_gm_sub_pre; + struct HPMHookPoint *HP_pc_wis_message_to_gm_sub_post; struct HPMHookPoint *HP_pc_check_supernovice_call_pre; struct HPMHookPoint *HP_pc_check_supernovice_call_post; struct HPMHookPoint *HP_pc_check_basicskill_pre; @@ -9371,8 +9345,6 @@ struct { int HP_guild_emblem_changed_post; int HP_guild_send_message_pre; int HP_guild_send_message_post; - int HP_guild_recv_message_pre; - int HP_guild_recv_message_post; int HP_guild_send_dot_remove_pre; int HP_guild_send_dot_remove_post; int HP_guild_skillupack_pre; @@ -9615,16 +9587,6 @@ struct { int HP_intif_parse_post; int HP_intif_create_pet_pre; int HP_intif_create_pet_post; - int HP_intif_broadcast_pre; - int HP_intif_broadcast_post; - int HP_intif_broadcast2_pre; - int HP_intif_broadcast2_post; - int HP_intif_main_message_pre; - int HP_intif_main_message_post; - int HP_intif_wis_message_pre; - int HP_intif_wis_message_post; - int HP_intif_wis_message_to_gm_pre; - int HP_intif_wis_message_to_gm_post; int HP_intif_saveregistry_pre; int HP_intif_saveregistry_post; int HP_intif_request_registry_pre; @@ -9651,8 +9613,6 @@ struct { int HP_intif_party_changemap_post; int HP_intif_break_party_pre; int HP_intif_break_party_post; - int HP_intif_party_message_pre; - int HP_intif_party_message_post; int HP_intif_party_leaderchange_pre; int HP_intif_party_leaderchange_post; int HP_intif_guild_create_pre; @@ -9667,8 +9627,6 @@ struct { int HP_intif_guild_memberinfoshort_post; int HP_intif_guild_break_pre; int HP_intif_guild_break_post; - int HP_intif_guild_message_pre; - int HP_intif_guild_message_post; int HP_intif_guild_change_gm_pre; int HP_intif_guild_change_gm_post; int HP_intif_guild_change_basicinfo_pre; @@ -9775,14 +9733,6 @@ struct { int HP_intif_achievements_request_post; int HP_intif_achievements_save_pre; int HP_intif_achievements_save_post; - int HP_intif_pWisMessage_pre; - int HP_intif_pWisMessage_post; - int HP_intif_pWisEnd_pre; - int HP_intif_pWisEnd_post; - int HP_intif_pWisToGM_sub_pre; - int HP_intif_pWisToGM_sub_post; - int HP_intif_pWisToGM_pre; - int HP_intif_pWisToGM_post; int HP_intif_pRegisters_pre; int HP_intif_pRegisters_post; int HP_intif_pAccountStorage_pre; @@ -9811,8 +9761,6 @@ struct { int HP_intif_pPartyMove_post; int HP_intif_pPartyBroken_pre; int HP_intif_pPartyBroken_post; - int HP_intif_pPartyMessage_pre; - int HP_intif_pPartyMessage_post; int HP_intif_pGuildCreated_pre; int HP_intif_pGuildCreated_post; int HP_intif_pGuildInfo_pre; @@ -9825,8 +9773,6 @@ struct { int HP_intif_pGuildMemberInfoShort_post; int HP_intif_pGuildBroken_pre; int HP_intif_pGuildBroken_post; - int HP_intif_pGuildMessage_pre; - int HP_intif_pGuildMessage_post; int HP_intif_pGuildBasicInfoChanged_pre; int HP_intif_pGuildBasicInfoChanged_post; int HP_intif_pGuildMemberInfoChanged_pre; @@ -11237,8 +11183,6 @@ struct { int HP_party_send_logout_post; int HP_party_send_message_pre; int HP_party_send_message_post; - int HP_party_recv_message_pre; - int HP_party_recv_message_post; int HP_party_skill_check_pre; int HP_party_skill_check_post; int HP_party_send_xy_clear_pre; @@ -11785,6 +11729,10 @@ struct { int HP_pc_have_magnifier_post; int HP_pc_process_chat_message_pre; int HP_pc_process_chat_message_post; + int HP_pc_wis_message_to_gm_pre; + int HP_pc_wis_message_to_gm_post; + int HP_pc_wis_message_to_gm_sub_pre; + int HP_pc_wis_message_to_gm_sub_post; int HP_pc_check_supernovice_call_pre; int HP_pc_check_supernovice_call_post; int HP_pc_check_basicskill_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 656cc7737..cfc6984dc 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1320,7 +1320,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(guild->change_emblem, HP_guild_change_emblem) }, { HP_POP(guild->emblem_changed, HP_guild_emblem_changed) }, { HP_POP(guild->send_message, HP_guild_send_message) }, - { HP_POP(guild->recv_message, HP_guild_recv_message) }, { HP_POP(guild->send_dot_remove, HP_guild_send_dot_remove) }, { HP_POP(guild->skillupack, HP_guild_skillupack) }, { HP_POP(guild->dobreak, HP_guild_dobreak) }, @@ -1446,11 +1445,6 @@ struct HookingPointData HookingPoints[] = { /* intif_interface */ { HP_POP(intif->parse, HP_intif_parse) }, { HP_POP(intif->create_pet, HP_intif_create_pet) }, - { HP_POP(intif->broadcast, HP_intif_broadcast) }, - { HP_POP(intif->broadcast2, HP_intif_broadcast2) }, - { HP_POP(intif->main_message, HP_intif_main_message) }, - { HP_POP(intif->wis_message, HP_intif_wis_message) }, - { HP_POP(intif->wis_message_to_gm, HP_intif_wis_message_to_gm) }, { HP_POP(intif->saveregistry, HP_intif_saveregistry) }, { HP_POP(intif->request_registry, HP_intif_request_registry) }, { HP_POP(intif->request_account_storage, HP_intif_request_account_storage) }, @@ -1464,7 +1458,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(intif->party_leave, HP_intif_party_leave) }, { HP_POP(intif->party_changemap, HP_intif_party_changemap) }, { HP_POP(intif->break_party, HP_intif_break_party) }, - { HP_POP(intif->party_message, HP_intif_party_message) }, { HP_POP(intif->party_leaderchange, HP_intif_party_leaderchange) }, { HP_POP(intif->guild_create, HP_intif_guild_create) }, { HP_POP(intif->guild_request_info, HP_intif_guild_request_info) }, @@ -1472,7 +1465,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(intif->guild_leave, HP_intif_guild_leave) }, { HP_POP(intif->guild_memberinfoshort, HP_intif_guild_memberinfoshort) }, { HP_POP(intif->guild_break, HP_intif_guild_break) }, - { HP_POP(intif->guild_message, HP_intif_guild_message) }, { HP_POP(intif->guild_change_gm, HP_intif_guild_change_gm) }, { HP_POP(intif->guild_change_basicinfo, HP_intif_guild_change_basicinfo) }, { HP_POP(intif->guild_change_memberinfo, HP_intif_guild_change_memberinfo) }, @@ -1526,10 +1518,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(intif->CheckForCharServer, HP_intif_CheckForCharServer) }, { HP_POP(intif->achievements_request, HP_intif_achievements_request) }, { HP_POP(intif->achievements_save, HP_intif_achievements_save) }, - { HP_POP(intif->pWisMessage, HP_intif_pWisMessage) }, - { HP_POP(intif->pWisEnd, HP_intif_pWisEnd) }, - { HP_POP(intif->pWisToGM_sub, HP_intif_pWisToGM_sub) }, - { HP_POP(intif->pWisToGM, HP_intif_pWisToGM) }, { HP_POP(intif->pRegisters, HP_intif_pRegisters) }, { HP_POP(intif->pAccountStorage, HP_intif_pAccountStorage) }, { HP_POP(intif->pChangeNameOk, HP_intif_pChangeNameOk) }, @@ -1544,14 +1532,12 @@ struct HookingPointData HookingPoints[] = { { HP_POP(intif->pPartyMemberWithdraw, HP_intif_pPartyMemberWithdraw) }, { HP_POP(intif->pPartyMove, HP_intif_pPartyMove) }, { HP_POP(intif->pPartyBroken, HP_intif_pPartyBroken) }, - { HP_POP(intif->pPartyMessage, HP_intif_pPartyMessage) }, { HP_POP(intif->pGuildCreated, HP_intif_pGuildCreated) }, { HP_POP(intif->pGuildInfo, HP_intif_pGuildInfo) }, { HP_POP(intif->pGuildMemberAdded, HP_intif_pGuildMemberAdded) }, { HP_POP(intif->pGuildMemberWithdraw, HP_intif_pGuildMemberWithdraw) }, { HP_POP(intif->pGuildMemberInfoShort, HP_intif_pGuildMemberInfoShort) }, { HP_POP(intif->pGuildBroken, HP_intif_pGuildBroken) }, - { HP_POP(intif->pGuildMessage, HP_intif_pGuildMessage) }, { HP_POP(intif->pGuildBasicInfoChanged, HP_intif_pGuildBasicInfoChanged) }, { HP_POP(intif->pGuildMemberInfoChanged, HP_intif_pGuildMemberInfoChanged) }, { HP_POP(intif->pGuildPosition, HP_intif_pGuildPosition) }, @@ -2275,7 +2261,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(party->send_levelup, HP_party_send_levelup) }, { HP_POP(party->send_logout, HP_party_send_logout) }, { HP_POP(party->send_message, HP_party_send_message) }, - { HP_POP(party->recv_message, HP_party_recv_message) }, { HP_POP(party->skill_check, HP_party_skill_check) }, { HP_POP(party->send_xy_clear, HP_party_send_xy_clear) }, { HP_POP(party->exp_share, HP_party_exp_share) }, @@ -2552,6 +2537,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pc->update_idle_time, HP_pc_update_idle_time) }, { HP_POP(pc->have_magnifier, HP_pc_have_magnifier) }, { HP_POP(pc->process_chat_message, HP_pc_process_chat_message) }, + { HP_POP(pc->wis_message_to_gm, HP_pc_wis_message_to_gm) }, + { HP_POP(pc->wis_message_to_gm_sub, HP_pc_wis_message_to_gm_sub) }, { HP_POP(pc->check_supernovice_call, HP_pc_check_supernovice_call) }, { HP_POP(pc->check_basicskill, HP_pc_check_basicskill) }, { HP_POP(pc->isDeathPenaltyJob, HP_pc_isDeathPenaltyJob) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 85d8d8b95..f74e08187 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -33667,33 +33667,6 @@ int HP_guild_send_message(struct map_session_data *sd, const char *mes) { } return retVal___; } -int HP_guild_recv_message(int guild_id, int account_id, const char *mes, int len) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_guild_recv_message_pre > 0) { - int (*preHookFunc) (int *guild_id, int *account_id, const char **mes, int *len); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_message_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_guild_recv_message_pre[hIndex].func; - retVal___ = preHookFunc(&guild_id, &account_id, &mes, &len); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.guild.recv_message(guild_id, account_id, mes, len); - } - if (HPMHooks.count.HP_guild_recv_message_post > 0) { - int (*postHookFunc) (int retVal___, int guild_id, int account_id, const char *mes, int len); - for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_message_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_guild_recv_message_post[hIndex].func; - retVal___ = postHookFunc(retVal___, guild_id, account_id, mes, len); - } - } - return retVal___; -} int HP_guild_send_dot_remove(struct map_session_data *sd) { int hIndex = 0; int retVal___ = 0; @@ -36995,141 +36968,6 @@ int HP_intif_create_pet(int account_id, int char_id, int pet_type, int pet_lv, i } return retVal___; } -int HP_intif_broadcast(const char *mes, int len, int type) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_intif_broadcast_pre > 0) { - int (*preHookFunc) (const char **mes, int *len, int *type); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_broadcast_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_broadcast_pre[hIndex].func; - retVal___ = preHookFunc(&mes, &len, &type); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.intif.broadcast(mes, len, type); - } - if (HPMHooks.count.HP_intif_broadcast_post > 0) { - int (*postHookFunc) (int retVal___, const char *mes, int len, int type); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_broadcast_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_broadcast_post[hIndex].func; - retVal___ = postHookFunc(retVal___, mes, len, type); - } - } - return retVal___; -} -int HP_intif_broadcast2(const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_intif_broadcast2_pre > 0) { - int (*preHookFunc) (const char **mes, int *len, unsigned int *fontColor, short *fontType, short *fontSize, short *fontAlign, short *fontY); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_broadcast2_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_broadcast2_pre[hIndex].func; - retVal___ = preHookFunc(&mes, &len, &fontColor, &fontType, &fontSize, &fontAlign, &fontY); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.intif.broadcast2(mes, len, fontColor, fontType, fontSize, fontAlign, fontY); - } - if (HPMHooks.count.HP_intif_broadcast2_post > 0) { - int (*postHookFunc) (int retVal___, const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_broadcast2_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_broadcast2_post[hIndex].func; - retVal___ = postHookFunc(retVal___, mes, len, fontColor, fontType, fontSize, fontAlign, fontY); - } - } - return retVal___; -} -int HP_intif_main_message(struct map_session_data *sd, const char *message) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_intif_main_message_pre > 0) { - int (*preHookFunc) (struct map_session_data **sd, const char **message); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_main_message_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_main_message_pre[hIndex].func; - retVal___ = preHookFunc(&sd, &message); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.intif.main_message(sd, message); - } - if (HPMHooks.count.HP_intif_main_message_post > 0) { - int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *message); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_main_message_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_main_message_post[hIndex].func; - retVal___ = postHookFunc(retVal___, sd, message); - } - } - return retVal___; -} -int HP_intif_wis_message(struct map_session_data *sd, const char *nick, const char *mes, int mes_len) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_intif_wis_message_pre > 0) { - int (*preHookFunc) (struct map_session_data **sd, const char **nick, const char **mes, int *mes_len); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_wis_message_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_wis_message_pre[hIndex].func; - retVal___ = preHookFunc(&sd, &nick, &mes, &mes_len); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.intif.wis_message(sd, nick, mes, mes_len); - } - if (HPMHooks.count.HP_intif_wis_message_post > 0) { - int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *nick, const char *mes, int mes_len); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_wis_message_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_wis_message_post[hIndex].func; - retVal___ = postHookFunc(retVal___, sd, nick, mes, mes_len); - } - } - return retVal___; -} -int HP_intif_wis_message_to_gm(char *Wisp_name, int permission, char *mes) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_intif_wis_message_to_gm_pre > 0) { - int (*preHookFunc) (char **Wisp_name, int *permission, char **mes); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_wis_message_to_gm_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_wis_message_to_gm_pre[hIndex].func; - retVal___ = preHookFunc(&Wisp_name, &permission, &mes); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.intif.wis_message_to_gm(Wisp_name, permission, mes); - } - if (HPMHooks.count.HP_intif_wis_message_to_gm_post > 0) { - int (*postHookFunc) (int retVal___, char *Wisp_name, int permission, char *mes); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_wis_message_to_gm_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_wis_message_to_gm_post[hIndex].func; - retVal___ = postHookFunc(retVal___, Wisp_name, permission, mes); - } - } - return retVal___; -} int HP_intif_saveregistry(struct map_session_data *sd) { int hIndex = 0; int retVal___ = 0; @@ -37479,33 +37317,6 @@ int HP_intif_break_party(int party_id) { } return retVal___; } -int HP_intif_party_message(int party_id, int account_id, const char *mes, int len) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_intif_party_message_pre > 0) { - int (*preHookFunc) (int *party_id, int *account_id, const char **mes, int *len); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_message_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_party_message_pre[hIndex].func; - retVal___ = preHookFunc(&party_id, &account_id, &mes, &len); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.intif.party_message(party_id, account_id, mes, len); - } - if (HPMHooks.count.HP_intif_party_message_post > 0) { - int (*postHookFunc) (int retVal___, int party_id, int account_id, const char *mes, int len); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_message_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_party_message_post[hIndex].func; - retVal___ = postHookFunc(retVal___, party_id, account_id, mes, len); - } - } - return retVal___; -} int HP_intif_party_leaderchange(int party_id, int account_id, int char_id) { int hIndex = 0; int retVal___ = 0; @@ -37695,33 +37506,6 @@ int HP_intif_guild_break(int guild_id) { } return retVal___; } -int HP_intif_guild_message(int guild_id, int account_id, const char *mes, int len) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_intif_guild_message_pre > 0) { - int (*preHookFunc) (int *guild_id, int *account_id, const char **mes, int *len); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_message_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_guild_message_pre[hIndex].func; - retVal___ = preHookFunc(&guild_id, &account_id, &mes, &len); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.intif.guild_message(guild_id, account_id, mes, len); - } - if (HPMHooks.count.HP_intif_guild_message_post > 0) { - int (*postHookFunc) (int retVal___, int guild_id, int account_id, const char *mes, int len); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_message_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_guild_message_post[hIndex].func; - retVal___ = postHookFunc(retVal___, guild_id, account_id, mes, len); - } - } - return retVal___; -} int HP_intif_guild_change_gm(int guild_id, const char *name, int len) { int hIndex = 0; int retVal___ = 0; @@ -39146,117 +38930,6 @@ void HP_intif_achievements_save(struct map_session_data *sd) { } return; } -void HP_intif_pWisMessage(int fd) { - int hIndex = 0; - if (HPMHooks.count.HP_intif_pWisMessage_pre > 0) { - void (*preHookFunc) (int *fd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisMessage_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_pWisMessage_pre[hIndex].func; - preHookFunc(&fd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.intif.pWisMessage(fd); - } - if (HPMHooks.count.HP_intif_pWisMessage_post > 0) { - void (*postHookFunc) (int fd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisMessage_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_pWisMessage_post[hIndex].func; - postHookFunc(fd); - } - } - return; -} -void HP_intif_pWisEnd(int fd) { - int hIndex = 0; - if (HPMHooks.count.HP_intif_pWisEnd_pre > 0) { - void (*preHookFunc) (int *fd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisEnd_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_pWisEnd_pre[hIndex].func; - preHookFunc(&fd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.intif.pWisEnd(fd); - } - if (HPMHooks.count.HP_intif_pWisEnd_post > 0) { - void (*postHookFunc) (int fd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisEnd_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_pWisEnd_post[hIndex].func; - postHookFunc(fd); - } - } - return; -} -int HP_intif_pWisToGM_sub(struct map_session_data *sd, va_list va) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_intif_pWisToGM_sub_pre > 0) { - int (*preHookFunc) (struct map_session_data **sd, va_list va); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisToGM_sub_pre; hIndex++) { - va_list va___copy; va_copy(va___copy, va); - preHookFunc = HPMHooks.list.HP_intif_pWisToGM_sub_pre[hIndex].func; - retVal___ = preHookFunc(&sd, va___copy); - va_end(va___copy); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - va_list va___copy; va_copy(va___copy, va); - retVal___ = HPMHooks.source.intif.pWisToGM_sub(sd, va___copy); - va_end(va___copy); - } - if (HPMHooks.count.HP_intif_pWisToGM_sub_post > 0) { - int (*postHookFunc) (int retVal___, struct map_session_data *sd, va_list va); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisToGM_sub_post; hIndex++) { - va_list va___copy; va_copy(va___copy, va); - postHookFunc = HPMHooks.list.HP_intif_pWisToGM_sub_post[hIndex].func; - retVal___ = postHookFunc(retVal___, sd, va___copy); - va_end(va___copy); - } - } - return retVal___; -} -void HP_intif_pWisToGM(int fd) { - int hIndex = 0; - if (HPMHooks.count.HP_intif_pWisToGM_pre > 0) { - void (*preHookFunc) (int *fd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisToGM_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_pWisToGM_pre[hIndex].func; - preHookFunc(&fd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.intif.pWisToGM(fd); - } - if (HPMHooks.count.HP_intif_pWisToGM_post > 0) { - void (*postHookFunc) (int fd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisToGM_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_pWisToGM_post[hIndex].func; - postHookFunc(fd); - } - } - return; -} void HP_intif_pRegisters(int fd) { int hIndex = 0; if (HPMHooks.count.HP_intif_pRegisters_pre > 0) { @@ -39621,32 +39294,6 @@ void HP_intif_pPartyBroken(int fd) { } return; } -void HP_intif_pPartyMessage(int fd) { - int hIndex = 0; - if (HPMHooks.count.HP_intif_pPartyMessage_pre > 0) { - void (*preHookFunc) (int *fd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyMessage_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_pPartyMessage_pre[hIndex].func; - preHookFunc(&fd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.intif.pPartyMessage(fd); - } - if (HPMHooks.count.HP_intif_pPartyMessage_post > 0) { - void (*postHookFunc) (int fd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyMessage_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_pPartyMessage_post[hIndex].func; - postHookFunc(fd); - } - } - return; -} void HP_intif_pGuildCreated(int fd) { int hIndex = 0; if (HPMHooks.count.HP_intif_pGuildCreated_pre > 0) { @@ -39803,32 +39450,6 @@ void HP_intif_pGuildBroken(int fd) { } return; } -void HP_intif_pGuildMessage(int fd) { - int hIndex = 0; - if (HPMHooks.count.HP_intif_pGuildMessage_pre > 0) { - void (*preHookFunc) (int *fd); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMessage_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_intif_pGuildMessage_pre[hIndex].func; - preHookFunc(&fd); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.intif.pGuildMessage(fd); - } - if (HPMHooks.count.HP_intif_pGuildMessage_post > 0) { - void (*postHookFunc) (int fd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMessage_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_intif_pGuildMessage_post[hIndex].func; - postHookFunc(fd); - } - } - return; -} void HP_intif_pGuildBasicInfoChanged(int fd) { int hIndex = 0; if (HPMHooks.count.HP_intif_pGuildBasicInfoChanged_pre > 0) { @@ -58998,33 +58619,6 @@ int HP_party_send_message(struct map_session_data *sd, const char *mes) { } return retVal___; } -int HP_party_recv_message(int party_id, int account_id, const char *mes, int len) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_party_recv_message_pre > 0) { - int (*preHookFunc) (int *party_id, int *account_id, const char **mes, int *len); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_party_recv_message_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_party_recv_message_pre[hIndex].func; - retVal___ = preHookFunc(&party_id, &account_id, &mes, &len); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.party.recv_message(party_id, account_id, mes, len); - } - if (HPMHooks.count.HP_party_recv_message_post > 0) { - int (*postHookFunc) (int retVal___, int party_id, int account_id, const char *mes, int len); - for (hIndex = 0; hIndex < HPMHooks.count.HP_party_recv_message_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_party_recv_message_post[hIndex].func; - retVal___ = postHookFunc(retVal___, party_id, account_id, mes, len); - } - } - return retVal___; -} int HP_party_skill_check(struct map_session_data *sd, int party_id, uint16 skill_id, uint16 skill_lv) { int hIndex = 0; int retVal___ = 0; @@ -66390,6 +65984,66 @@ bool HP_pc_process_chat_message(struct map_session_data *sd, const char *message } return retVal___; } +int HP_pc_wis_message_to_gm(const char *sender_name, int permission, const char *message) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_pc_wis_message_to_gm_pre > 0) { + int (*preHookFunc) (const char **sender_name, int *permission, const char **message); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_wis_message_to_gm_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_pc_wis_message_to_gm_pre[hIndex].func; + retVal___ = preHookFunc(&sender_name, &permission, &message); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pc.wis_message_to_gm(sender_name, permission, message); + } + if (HPMHooks.count.HP_pc_wis_message_to_gm_post > 0) { + int (*postHookFunc) (int retVal___, const char *sender_name, int permission, const char *message); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_wis_message_to_gm_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_pc_wis_message_to_gm_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sender_name, permission, message); + } + } + return retVal___; +} +int HP_pc_wis_message_to_gm_sub(struct map_session_data *sd, va_list va) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_pc_wis_message_to_gm_sub_pre > 0) { + int (*preHookFunc) (struct map_session_data **sd, va_list va); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_wis_message_to_gm_sub_pre; hIndex++) { + va_list va___copy; va_copy(va___copy, va); + preHookFunc = HPMHooks.list.HP_pc_wis_message_to_gm_sub_pre[hIndex].func; + retVal___ = preHookFunc(&sd, va___copy); + va_end(va___copy); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + va_list va___copy; va_copy(va___copy, va); + retVal___ = HPMHooks.source.pc.wis_message_to_gm_sub(sd, va___copy); + va_end(va___copy); + } + if (HPMHooks.count.HP_pc_wis_message_to_gm_sub_post > 0) { + int (*postHookFunc) (int retVal___, struct map_session_data *sd, va_list va); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_wis_message_to_gm_sub_post; hIndex++) { + va_list va___copy; va_copy(va___copy, va); + postHookFunc = HPMHooks.list.HP_pc_wis_message_to_gm_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, va___copy); + va_end(va___copy); + } + } + return retVal___; +} void HP_pc_check_supernovice_call(struct map_session_data *sd, const char *message) { int hIndex = 0; if (HPMHooks.count.HP_pc_check_supernovice_call_pre > 0) { |