summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-10-11 02:03:52 +0200
committerHaru <haru@dotalux.com>2013-10-11 02:03:52 +0200
commitdf68a8cecdb52de34a348ba63f27862678a446a7 (patch)
tree92e64244818e82b3277df21f1bf04efe759716f6 /src/map
parentb1c82364e9097ee98dc0f850bdb37f2b3e945d61 (diff)
downloadhercules-df68a8cecdb52de34a348ba63f27862678a446a7.tar.gz
hercules-df68a8cecdb52de34a348ba63f27862678a446a7.tar.bz2
hercules-df68a8cecdb52de34a348ba63f27862678a446a7.tar.xz
hercules-df68a8cecdb52de34a348ba63f27862678a446a7.zip
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 <haru@dotalux.com>
Diffstat (limited to 'src/map')
-rw-r--r--src/map/clif.c13
1 files 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));