diff options
author | Haru <haru@dotalux.com> | 2019-08-25 17:34:19 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2019-08-25 21:04:08 +0200 |
commit | 2af8281a53ea7bdc02a9750388aebbae1fa73f4e (patch) | |
tree | 3c05ffa4d39410b114a4987f4cf5e981ca951b0c /src/map | |
parent | 0edf2360b185f0e1c68bb6ddbbbe3720af5651b3 (diff) | |
download | hercules-2af8281a53ea7bdc02a9750388aebbae1fa73f4e.tar.gz hercules-2af8281a53ea7bdc02a9750388aebbae1fa73f4e.tar.bz2 hercules-2af8281a53ea7bdc02a9750388aebbae1fa73f4e.tar.xz hercules-2af8281a53ea7bdc02a9750388aebbae1fa73f4e.zip |
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 <haru@dotalux.com>
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 8 | ||||
-rw-r--r-- | src/map/intif.c | 105 | ||||
-rw-r--r-- | src/map/intif.h | 3 |
3 files changed, 3 insertions, 113 deletions
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); |