From df68a8cecdb52de34a348ba63f27862678a446a7 Mon Sep 17 00:00:00 2001 From: Haru Date: Fri, 11 Oct 2013 02:03:52 +0200 Subject: Fixed the 'Received unsupported packet' message when using obfuscation - Now it reports the correctly decoded packet instead of 0x0000 - Follow-up to 38b8bf02b69f3841fd496f8d628bf71040c99709, thanks to Ind for bringing this up Signed-off-by: Haru --- src/map/clif.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index d1f416146..823a44956 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -17825,10 +17825,6 @@ unsigned short clif_decrypt_cmd( int cmd, struct map_session_data *sd ) { unsigned short clif_parse_cmd_normal( int fd, struct map_session_data *sd ) { unsigned short cmd = RFIFOW(fd,0); - // filter out invalid / unsupported packets - if( cmd > MAX_PACKET_DB || cmd < MIN_PACKET_DB || packet_db[cmd].len == 0 ) - return 0; - return cmd; } unsigned short clif_parse_cmd_decrypt( int fd, struct map_session_data *sd ) { @@ -17836,10 +17832,6 @@ unsigned short clif_parse_cmd_decrypt( int fd, struct map_session_data *sd ) { cmd = clif->decrypt_cmd(cmd, sd); - // filter out invalid / unsupported packets - if( cmd > MAX_PACKET_DB || cmd < MIN_PACKET_DB || packet_db[cmd].len == 0 ) - return 0; - return cmd; } unsigned short clif_parse_cmd_optional( int fd, struct map_session_data *sd ) { @@ -17914,7 +17906,10 @@ int clif_parse(int fd) { else parse_cmd_func = clif->parse_cmd; - if( !( cmd = parse_cmd_func(fd,sd) ) ) { + cmd = parse_cmd_func(fd,sd); + + // filter out invalid / unsupported packets + if( cmd > MAX_PACKET_DB || cmd < MIN_PACKET_DB || packet_db[cmd].len == 0 ) { ShowWarning("clif_parse: Received unsupported packet (packet 0x%04x (0x%04x), %d bytes received), disconnecting session #%d.\n", cmd, RFIFOW(fd,0), RFIFOREST(fd), fd); #ifdef DUMP_INVALID_PACKET ShowDump(RFIFOP(fd,0), RFIFOREST(fd)); -- cgit v1.2.3-70-g09d2