From 23a9bf91fc75a208b62e8c8a3ce8e5e5bb42ef36 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 16 Aug 2017 19:41:24 +0300 Subject: Load evol packet offset from first packet from server. --- src/client.cpp | 2 ++ src/net/eathena/loginrecv.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/client.cpp b/src/client.cpp index ef0e5af31..d67b58dce 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -180,6 +180,7 @@ LoginData loginData; Client *client = nullptr; extern FPSmanager fpsManager; +extern int evolPacketOffset; volatile bool runCounters; bool isSafeMode = false; @@ -1961,6 +1962,7 @@ void Client::unloadData() serverVersion = 0; packetVersion = 0; tmwServerVersion = 0; + evolPacketOffset = 0; } void Client::runValidate() diff --git a/src/net/eathena/loginrecv.cpp b/src/net/eathena/loginrecv.cpp index b9abf20aa..555d1a2c1 100644 --- a/src/net/eathena/loginrecv.cpp +++ b/src/net/eathena/loginrecv.cpp @@ -45,6 +45,7 @@ #include "debug.h" extern int packetVersion; +extern int evolPacketOffset; namespace EAthena { @@ -153,7 +154,7 @@ void LoginRecv::processUpdateHost2(Net::MessageIn &msg) void LoginRecv::processServerVersion(Net::MessageIn &msg) { - msg.readInt16("len"); + const int len = msg.readInt16("len"); msg.readInt32("unused"); serverVersion = msg.readInt32("server version"); if (serverVersion > 0) @@ -167,6 +168,10 @@ void LoginRecv::processServerVersion(Net::MessageIn &msg) logger->log("autofix Hercules packet version to: %d", packetVersion); } + if (serverVersion >= 16 && len >= 18) + { + evolPacketOffset = msg.readInt16("evol packet offset"); + } } else { -- cgit v1.2.3-70-g09d2