summaryrefslogtreecommitdiff
path: root/src/net
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
parentbd6ced98dfbe93fce5c143cdcd6fa6e8c3f4f6a8 (diff)
downloadplus-0e3549dd92ac1eac1916b3f5110036ab59fe2fec.tar.gz
plus-0e3549dd92ac1eac1916b3f5110036ab59fe2fec.tar.bz2
plus-0e3549dd92ac1eac1916b3f5110036ab59fe2fec.tar.xz
plus-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')
-rw-r--r--src/net/ea/beinghandler.cpp3
-rw-r--r--src/net/ea/beinghandler.h2
-rw-r--r--src/net/ea/beingrecv.cpp3
-rw-r--r--src/net/eathena/beinghandler.cpp4
-rw-r--r--src/net/eathena/beinghandler.h2
-rw-r--r--src/net/eathena/generalhandler.cpp2
-rw-r--r--src/net/messagein.cpp27
-rw-r--r--src/net/tmwa/beinghandler.cpp4
-rw-r--r--src/net/tmwa/beinghandler.h2
-rw-r--r--src/net/tmwa/generalhandler.cpp2
10 files changed, 26 insertions, 25 deletions
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index 2870bc85b..511154fd5 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -29,10 +29,9 @@
namespace Ea
{
-BeingHandler::BeingHandler(const bool enableSync) :
+BeingHandler::BeingHandler() :
Net::BeingHandler()
{
- BeingRecv::mSync = enableSync;
BeingRecv::mSpawnId = BeingId_zero;
}
diff --git a/src/net/ea/beinghandler.h b/src/net/ea/beinghandler.h
index a151601bc..8c90dbf01 100644
--- a/src/net/ea/beinghandler.h
+++ b/src/net/ea/beinghandler.h
@@ -34,7 +34,7 @@ class BeingHandler notfinal : public Net::BeingHandler
A_DELETE_COPY(BeingHandler)
protected:
- explicit BeingHandler(const bool enableSync);
+ explicit BeingHandler();
};
} // namespace Ea
diff --git a/src/net/ea/beingrecv.cpp b/src/net/ea/beingrecv.cpp
index 4ac1f90eb..ed6e031b6 100644
--- a/src/net/ea/beingrecv.cpp
+++ b/src/net/ea/beingrecv.cpp
@@ -54,7 +54,6 @@ namespace Ea
namespace BeingRecv
{
- bool mSync = false;
BeingId mSpawnId = BeingId_zero;
} // namespace BeingRecv
@@ -345,7 +344,7 @@ void BeingRecv::processPlayerStop(Net::MessageIn &msg)
const BeingId id = msg.readBeingId("account id");
- if (mSync || id != localPlayer->getId())
+// if (mSync || id != localPlayer->getId())
{
Being *const dstBeing = actorManager->findBeing(id);
if (dstBeing != nullptr)
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp
index 7e8dc43e2..c132609e3 100644
--- a/src/net/eathena/beinghandler.cpp
+++ b/src/net/eathena/beinghandler.cpp
@@ -34,8 +34,8 @@ extern int serverVersion;
namespace EAthena
{
-BeingHandler::BeingHandler(const bool enableSync) :
- Ea::BeingHandler(enableSync)
+BeingHandler::BeingHandler() :
+ Ea::BeingHandler()
{
beingHandler = this;
}
diff --git a/src/net/eathena/beinghandler.h b/src/net/eathena/beinghandler.h
index 6372ea336..41dafb6aa 100644
--- a/src/net/eathena/beinghandler.h
+++ b/src/net/eathena/beinghandler.h
@@ -31,7 +31,7 @@ namespace EAthena
class BeingHandler final : public Ea::BeingHandler
{
public:
- explicit BeingHandler(const bool enableSync);
+ explicit BeingHandler();
A_DELETE_COPY(BeingHandler)
diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp
index ff420092d..1226e03f9 100644
--- a/src/net/eathena/generalhandler.cpp
+++ b/src/net/eathena/generalhandler.cpp
@@ -83,7 +83,7 @@ namespace EAthena
GeneralHandler::GeneralHandler() :
mAdminHandler(new AdminHandler),
- mBeingHandler(new BeingHandler(config.getBoolValue("EnableSync"))),
+ mBeingHandler(new BeingHandler),
mBuySellHandler(new BuySellHandler),
mCharServerHandler(new CharServerHandler),
mChatHandler(new ChatHandler),
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);
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index e944fa835..f3d3acdf8 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -31,8 +31,8 @@
namespace TmwAthena
{
-BeingHandler::BeingHandler(const bool enableSync) :
- Ea::BeingHandler(enableSync)
+BeingHandler::BeingHandler() :
+ Ea::BeingHandler()
{
beingHandler = this;
}
diff --git a/src/net/tmwa/beinghandler.h b/src/net/tmwa/beinghandler.h
index ed486c9ee..32e01db1f 100644
--- a/src/net/tmwa/beinghandler.h
+++ b/src/net/tmwa/beinghandler.h
@@ -31,7 +31,7 @@ namespace TmwAthena
class BeingHandler final : public Ea::BeingHandler
{
public:
- explicit BeingHandler(const bool enableSync);
+ explicit BeingHandler();
A_DELETE_COPY(BeingHandler)
diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp
index 994be2ce7..7e5eb70de 100644
--- a/src/net/tmwa/generalhandler.cpp
+++ b/src/net/tmwa/generalhandler.cpp
@@ -82,7 +82,7 @@ namespace TmwAthena
GeneralHandler::GeneralHandler() :
mAdminHandler(new AdminHandler),
- mBeingHandler(new BeingHandler(config.getBoolValue("EnableSync"))),
+ mBeingHandler(new BeingHandler),
mBuySellHandler(new BuySellHandler),
mCharServerHandler(new CharServerHandler),
mChatHandler(new ChatHandler),