From 0e3549dd92ac1eac1916b3f5110036ab59fe2fec Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 20 Mar 2019 22:14:01 +0300 Subject: Possible fix for desync in moving Handle player stop packet always. Check desync always if tile changed client side. Check desync always if server move response packet received. Removed unused configuration option. --- src/net/messagein.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'src/net/messagein.cpp') diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp index bdac098c5..22d0510ce 100644 --- a/src/net/messagein.cpp +++ b/src/net/messagein.cpp @@ -473,20 +473,23 @@ unsigned char *MessageIn::readBytes(int length, const char *const dstr) mPos += length; #ifdef ENABLEDEBUGLOG - std::string str; - for (int f = 0; f < length; f ++) - str.append(strprintf("%02x", CAST_U32(buf[f]))); - str += " "; - for (int f = 0; f < length; f ++) + if (!mIgnore) { - if (buf[f] != 0U) - str.append(strprintf("%c", buf[f])); - else - str.append("_"); + std::string str; + for (int f = 0; f < length; f ++) + str.append(strprintf("%02x", CAST_U32(buf[f]))); + str += " "; + for (int f = 0; f < length; f ++) + { + if (buf[f] != 0U) + str.append(strprintf("%c", buf[f])); + else + str.append("_"); + } + if (dstr != nullptr) + logger->dlog(dstr); + logger->dlog("ReadBytes: " + str); } - if (dstr != nullptr) - logger->dlog(dstr); - logger->dlog("ReadBytes: " + str); #endif // ENABLEDEBUGLOG PacketCounters::incInBytes(length); -- cgit v1.2.3-60-g2f50