summaryrefslogtreecommitdiff
path: root/src/net/messagein.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2019-03-20 22:14:01 +0300
committerAndrei Karas <akaras@inbox.ru>2019-03-21 01:36:40 +0300
commit0e3549dd92ac1eac1916b3f5110036ab59fe2fec (patch)
tree85011f9be2576f4daeaae9513be24d50a5dae93a /src/net/messagein.cpp
parentbd6ced98dfbe93fce5c143cdcd6fa6e8c3f4f6a8 (diff)
downloadmanaverse-0e3549dd92ac1eac1916b3f5110036ab59fe2fec.tar.gz
manaverse-0e3549dd92ac1eac1916b3f5110036ab59fe2fec.tar.bz2
manaverse-0e3549dd92ac1eac1916b3f5110036ab59fe2fec.tar.xz
manaverse-0e3549dd92ac1eac1916b3f5110036ab59fe2fec.zip
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.
Diffstat (limited to 'src/net/messagein.cpp')
-rw-r--r--src/net/messagein.cpp27
1 files changed, 15 insertions, 12 deletions
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);