From c1dca647670c1b55bcd66c82958fcd8180115fac Mon Sep 17 00:00:00 2001 From: Haru Date: Mon, 5 Aug 2013 11:21:27 +0200 Subject: Improved reliability of the packet obfuscation key update function Follow-up to 38b8bf0 Solves some edge cases where, depending on key and packet combination, the key may not be correctly updated and leads to a forced disconnection. Signed-off-by: Haru --- src/map/clif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/map') diff --git a/src/map/clif.c b/src/map/clif.c index f9ea6e2c1..44df5b607 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -17657,7 +17657,7 @@ int clif_parse(int fd) { if ((int)RFIFOREST(fd) < packet_len) return 0; // not enough data received to form the packet - if( cmd != RFIFOW(fd, 0) ) { + if( battle_config.packet_obfuscation == 2 || cmd != RFIFOW(fd, 0) || (sd && sd->parse_cmd_func == clif_parse_cmd_decrypt) ) { RFIFOW(fd, 0) = cmd; if( sd ) { sd->cryptKey = (( sd->cryptKey * clif->cryptKey[1] ) + clif->cryptKey[2]) & 0xFFFFFFFF; // Update key for the next packet -- cgit v1.2.3-70-g09d2