From 2af8281a53ea7bdc02a9750388aebbae1fa73f4e Mon Sep 17 00:00:00 2001 From: Haru Date: Sun, 25 Aug 2019 17:34:19 +0200 Subject: Remove whisper dispatch code from the inter server The code was currently not in use (assuming the only officially supported case of a single-zone server) Signed-off-by: Haru --- src/map/clif.c | 8 ++--- src/map/intif.c | 105 +------------------------------------------------------- src/map/intif.h | 3 -- 3 files changed, 3 insertions(+), 113 deletions(-) (limited to 'src/map') diff --git a/src/map/clif.c b/src/map/clif.c index 3b7691ae4..62c621324 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11581,12 +11581,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/intif.c b/src/map/intif.c index e25f56b63..a250b22a9 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -234,52 +234,6 @@ static int intif_main_message(struct map_session_data *sd, const char *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) { @@ -1166,58 +1120,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); @@ -2921,8 +2823,6 @@ static int intif_parse(int fd) 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; @@ -3028,7 +2928,7 @@ 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 + -1, 0, 0,-1, -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 @@ -3051,7 +2951,6 @@ void intif_defaults(void) 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; @@ -3138,8 +3037,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; diff --git a/src/map/intif.h b/src/map/intif.h index 8df669217..8aab653c2 100644 --- a/src/map/intif.h +++ b/src/map/intif.h @@ -63,7 +63,6 @@ struct intif_interface { 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); @@ -151,8 +150,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); -- cgit v1.2.3-70-g09d2 From 0ca24c219b8a5a7cd4beb15d8384380f7e6fa9b5 Mon Sep 17 00:00:00 2001 From: Haru Date: Sun, 25 Aug 2019 17:44:10 +0200 Subject: Remove round-trip to the inter-server for the whisper-to-gm messages Signed-off-by: Haru --- src/char/inter.c | 3 +-- src/char/mapif.c | 13 ---------- src/char/mapif.h | 1 - src/map/atcommand.c | 2 +- src/map/clif.c | 4 +-- src/map/intif.c | 71 +---------------------------------------------------- src/map/intif.h | 3 --- src/map/pc.c | 50 +++++++++++++++++++++++++++++++++++++ src/map/pc.h | 2 ++ src/map/trade.c | 6 ++--- 10 files changed, 60 insertions(+), 95 deletions(-) (limited to 'src/map') diff --git a/src/char/inter.c b/src/char/inter.c index 53bcd6de1..4f49dab7d 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -67,7 +67,7 @@ int party_share_level = 10; // recv. packet list static int inter_recv_packet_length[] = { - -1, 0, 0,-1, -1,13,36, (2 + 4 + 4 + 4 + NAME_LENGTH), 0, 0, 0, 0, 0, 0, 0, 0, // 3000- + -1, 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- @@ -1036,7 +1036,6 @@ static int inter_parse_frommap(int fd) switch(cmd) { case 0x3000: mapif->parse_broadcast(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; diff --git a/src/char/mapif.c b/src/char/mapif.c index 89cd358ec..7e29727c7 100644 --- a/src/char/mapif.c +++ b/src/char/mapif.c @@ -2093,18 +2093,6 @@ static int mapif_parse_broadcast(int fd) 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 .w .24B .w .?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) { @@ -2544,7 +2532,6 @@ void mapif_defaults(void) mapif->account_reg_reply = mapif_account_reg_reply; mapif->disconnectplayer = mapif_disconnectplayer; mapif->parse_broadcast = mapif_parse_broadcast; - 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 7cb7e4f3f..1b83243eb 100644 --- a/src/char/mapif.h +++ b/src/char/mapif.h @@ -185,7 +185,6 @@ struct mapif_interface { 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_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/map/atcommand.c b/src/map/atcommand.c index 2fac5b4a4..3bdc43875 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -8263,7 +8263,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 62c621324..976ba6530 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11087,13 +11087,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 diff --git a/src/map/intif.c b/src/map/intif.c index a250b22a9..cb9dd465f 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -234,31 +234,6 @@ static int intif_main_message(struct map_session_data *sd, const char *message) 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) { @@ -1120,46 +1095,6 @@ static int intif_homunculus_requestdelete(int homun_id) //----------------------------------------------------------------- // Packets receive from inter server -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 .w .24B .l .?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) { @@ -2823,7 +2758,6 @@ static int intif_parse(int fd) 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 0x3803: intif->pWisToGM(fd); break; case 0x3804: intif->pRegisters(fd); break; case 0x3805: intif->pAccountStorage(fd); break; case 0x3806: intif->pChangeNameOk(fd); break; @@ -2928,7 +2862,7 @@ static int intif_parse(int fd) void intif_defaults(void) { const int packet_len_table [INTIF_PACKET_LEN_TABLE_SIZE] = { - -1, 0, 0,-1, -1,-1,37,-1, 7, 0, 0, 0, 0, 0, 0, 0, //0x3800-0x380f + -1, 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 @@ -2951,7 +2885,6 @@ void intif_defaults(void) intif->broadcast = intif_broadcast; intif->broadcast2 = intif_broadcast2; intif->main_message = intif_main_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; @@ -3037,8 +2970,6 @@ void intif_defaults(void) intif->achievements_request = intif_achievements_request; intif->achievements_save = intif_achievements_save; /* parse functions */ - 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; diff --git a/src/map/intif.h b/src/map/intif.h index 8aab653c2..043facb53 100644 --- a/src/map/intif.h +++ b/src/map/intif.h @@ -63,7 +63,6 @@ struct intif_interface { 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_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); @@ -150,8 +149,6 @@ struct intif_interface { void(*achievements_request) (struct map_session_data *sd); void(*achievements_save) (struct map_session_data *sd); /* */ - 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); diff --git a/src/map/pc.c b/src/map/pc.c index 84d49e1db..827619be8 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -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 7c89f7f32..3a95981a6 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -1185,6 +1185,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/trade.c b/src/map/trade.c index cef14ffe6..b71c3ecc8 100644 --- a/src/map/trade.c +++ b/src/map/trade.c @@ -223,9 +223,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); @@ -242,7 +242,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 -- cgit v1.2.3-70-g09d2 From ab2b8254e88ea098b34b9127f1571a14ad0e692a Mon Sep 17 00:00:00 2001 From: Haru Date: Sun, 25 Aug 2019 17:48:45 +0200 Subject: Remove unused function intif_main_message() Signed-off-by: Haru --- src/map/intif.c | 23 ----------------------- src/map/intif.h | 1 - 2 files changed, 24 deletions(-) (limited to 'src/map') diff --git a/src/map/intif.c b/src/map/intif.c index cb9dd465f..7a87d3639 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -212,28 +212,6 @@ static int intif_broadcast2(const char *mes, int len, unsigned int fontColor, sh return 0; } -/// send a message using the main chat system -/// the source of 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; -} - //Request for saving registry values. static int intif_saveregistry(struct map_session_data *sd) { @@ -2884,7 +2862,6 @@ void intif_defaults(void) intif->create_pet = intif_create_pet; intif->broadcast = intif_broadcast; intif->broadcast2 = intif_broadcast2; - intif->main_message = intif_main_message; intif->saveregistry = intif_saveregistry; intif->request_registry = intif_request_registry; intif->request_account_storage = intif_request_account_storage; diff --git a/src/map/intif.h b/src/map/intif.h index 043facb53..8f8cefbee 100644 --- a/src/map/intif.h +++ b/src/map/intif.h @@ -62,7 +62,6 @@ struct intif_interface { 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 (*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); -- cgit v1.2.3-70-g09d2 From 0ef788e46f678e546ec28b602dcfeeb359d0417c Mon Sep 17 00:00:00 2001 From: Haru Date: Sun, 25 Aug 2019 17:55:31 +0200 Subject: Remove round-trip to the inter-server for the broadcast messages Signed-off-by: Haru --- src/char/inter.c | 3 +-- src/char/mapif.c | 30 ----------------------- src/char/mapif.h | 2 -- src/map/atcommand.c | 8 ++++--- src/map/intif.c | 69 +---------------------------------------------------- src/map/intif.h | 2 -- src/map/pc.c | 4 ++-- src/map/script.c | 20 +++++++--------- 8 files changed, 17 insertions(+), 121 deletions(-) (limited to 'src/map') diff --git a/src/char/inter.c b/src/char/inter.c index 4f49dab7d..a70a81eb0 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -67,7 +67,7 @@ int party_share_level = 10; // recv. packet list static int inter_recv_packet_length[] = { - -1, 0, 0, 0, -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- @@ -1035,7 +1035,6 @@ static int inter_parse_frommap(int fd) return 2; switch(cmd) { - case 0x3000: mapif->parse_broadcast(fd); break; case 0x3004: mapif->parse_Registry(fd); break; case 0x3005: mapif->parse_RegistryRequest(fd); break; case 0x3006: mapif->parse_NameChangeRequest(fd); break; diff --git a/src/char/mapif.c b/src/char/mapif.c index 7e29727c7..a2e7499d9 100644 --- a/src/char/mapif.c +++ b/src/char/mapif.c @@ -2034,27 +2034,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; -} - #if 0 // Account registry transfer to map-server static void mapif_account_reg(int fd, unsigned char *src) @@ -2086,13 +2065,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; -} - // Save account_reg into sql (type=2) static int mapif_parse_Registry(int fd) { @@ -2528,10 +2500,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->account_reg_reply = mapif_account_reg_reply; mapif->disconnectplayer = mapif_disconnectplayer; - mapif->parse_broadcast = mapif_parse_broadcast; 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 1b83243eb..284be6a19 100644 --- a/src/char/mapif.h +++ b/src/char/mapif.h @@ -181,10 +181,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 (*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_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/map/atcommand.c b/src/map/atcommand.c index 3bdc43875..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 ). @@ -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; } diff --git a/src/map/intif.c b/src/map/intif.c index 7a87d3639..ba79a024b 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -153,65 +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; -} - //Request for saving registry values. static int intif_saveregistry(struct map_session_data *sd) { @@ -2730,12 +2671,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 0x3804: intif->pRegisters(fd); break; case 0x3805: intif->pAccountStorage(fd); break; case 0x3806: intif->pChangeNameOk(fd); break; @@ -2840,7 +2775,7 @@ static int intif_parse(int fd) void intif_defaults(void) { const int packet_len_table [INTIF_PACKET_LEN_TABLE_SIZE] = { - -1, 0, 0, 0, -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 @@ -2860,8 +2795,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->saveregistry = intif_saveregistry; intif->request_registry = intif_request_registry; intif->request_account_storage = intif_request_account_storage; diff --git a/src/map/intif.h b/src/map/intif.h index 8f8cefbee..134c7a97e 100644 --- a/src/map/intif.h +++ b/src/map/intif.h @@ -60,8 +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 (*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); diff --git a/src/map/pc.c b/src/map/pc.c index 827619be8..8c7663d54 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; } diff --git a/src/map/script.c b/src/map/script.c index f515d4403..20fb7ae27 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -11912,12 +11912,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); @@ -11935,17 +11935,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; } /*========================================== -- cgit v1.2.3-70-g09d2 From 79432202ba48e041c102b32b2675988690a754ef Mon Sep 17 00:00:00 2001 From: Haru Date: Sun, 25 Aug 2019 18:00:23 +0200 Subject: Remove round-trip to the inter-server for the party messages Signed-off-by: Haru --- src/char/int_party.c | 1 - src/char/inter.c | 2 +- src/char/mapif.c | 22 ---------------------- src/char/mapif.h | 2 -- src/map/intif.c | 32 +------------------------------- src/map/intif.h | 2 -- src/map/party.c | 25 +++++++++---------------- src/map/party.h | 1 - 8 files changed, 11 insertions(+), 76 deletions(-) (limited to 'src/map') 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 a70a81eb0..d6b96f020 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -69,7 +69,7 @@ int party_share_level = 10; static int inter_recv_packet_length[] = { 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,10,-1,14, 14,19, 6, 0, 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, 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] diff --git a/src/char/mapif.c b/src/char/mapif.c index a2e7499d9..1f27c1c60 100644 --- a/src/char/mapif.c +++ b/src/char/mapif.c @@ -1319,20 +1319,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 +1394,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)) @@ -2452,7 +2432,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; @@ -2460,7 +2439,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; diff --git a/src/char/mapif.h b/src/char/mapif.h index 284be6a19..f61b5a9d7 100644 --- a/src/char/mapif.h +++ b/src/char/mapif.h @@ -134,7 +134,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); @@ -142,7 +141,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); diff --git a/src/map/intif.c b/src/map/intif.c index ba79a024b..412cd78f8 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -562,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) { @@ -1220,12 +1199,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) { @@ -2686,7 +2659,6 @@ 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; @@ -2777,7 +2749,7 @@ void intif_defaults(void) const int packet_len_table [INTIF_PACKET_LEN_TABLE_SIZE] = { 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 + 39,-1,15,15, 14,19, 7, 0, 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 -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] @@ -2808,7 +2780,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; @@ -2894,7 +2865,6 @@ 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; diff --git a/src/map/intif.h b/src/map/intif.h index 134c7a97e..f5f013db9 100644 --- a/src/map/intif.h +++ b/src/map/intif.h @@ -73,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); @@ -160,7 +159,6 @@ 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); 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); -- cgit v1.2.3-70-g09d2 From 470ed75a471c428e1ffe44523a9fa46ebc089469 Mon Sep 17 00:00:00 2001 From: Haru Date: Sun, 25 Aug 2019 18:03:01 +0200 Subject: Remove round-trip to the inter-server for the guild chat messages Signed-off-by: Haru --- src/char/int_guild.c | 1 - src/char/inter.c | 2 +- src/char/mapif.c | 24 ------------------------ src/char/mapif.h | 2 -- src/map/guild.c | 22 +++++----------------- src/map/guild.h | 1 - src/map/intif.c | 33 +-------------------------------- src/map/intif.h | 2 -- 8 files changed, 7 insertions(+), 80 deletions(-) (limited to 'src/map') 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/inter.c b/src/char/inter.c index d6b96f020..264327289 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -70,7 +70,7 @@ static int inter_recv_packet_length[] = { 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, 0, 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, 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] diff --git a/src/char/mapif.c b/src/char/mapif.c index 1f27c1c60..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 @@ -2368,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; @@ -2384,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; diff --git a/src/char/mapif.h b/src/char/mapif.h index f61b5a9d7..f5b54b6b7 100644 --- a/src/char/mapif.h +++ b/src/char/mapif.h @@ -70,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); @@ -86,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); 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); @@ -1151,18 +1152,6 @@ static int guild_send_message(struct map_session_data *sd, const char *mes) return 0; } -/*==================================================== - * 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 *---------------------------------------------------*/ @@ -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 412cd78f8..5a62f9644 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -758,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 @@ -1348,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) { @@ -2665,7 +2637,6 @@ static int intif_parse(int fd) 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; @@ -2750,7 +2721,7 @@ void intif_defaults(void) 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, 0, 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 + 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] @@ -2787,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; @@ -2871,7 +2841,6 @@ void intif_defaults(void) 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 f5f013db9..ffac4a1c9 100644 --- a/src/map/intif.h +++ b/src/map/intif.h @@ -80,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); @@ -165,7 +164,6 @@ struct intif_interface { 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); -- cgit v1.2.3-70-g09d2