From a94f1032a7eee07e25664738cb75aca4d90ca2db Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 5 Jan 2018 19:52:46 +0300 Subject: Add support for packets type flag. For now supported flags for renewal and zero packets. --- src/net/eathena/loginrecv.cpp | 15 +++++++++++++++ src/progs/dyecmd/client.cpp | 4 ++++ src/progs/manaplus/client.cpp | 4 ++++ 3 files changed, 23 insertions(+) (limited to 'src') diff --git a/src/net/eathena/loginrecv.cpp b/src/net/eathena/loginrecv.cpp index 138881315..502e2d247 100644 --- a/src/net/eathena/loginrecv.cpp +++ b/src/net/eathena/loginrecv.cpp @@ -45,6 +45,10 @@ #include "debug.h" extern int packetVersion; +extern int packetsType; +extern bool packets_main; +extern bool packets_re; +extern bool packets_zero; extern int evolPacketOffset; namespace EAthena @@ -172,6 +176,17 @@ void LoginRecv::processServerVersion(Net::MessageIn &msg) { evolPacketOffset = msg.readInt16("evol packet offset"); } + if (serverVersion >= 20 && len >= 20) + { + packetsType = msg.readInt16("server packets type"); + packets_re = (packetsType & 1) ? true : false; + packets_zero = (packetsType & 2) ? true : false; + if (packets_re == false && + packets_zero == false) + { + packets_main = true; + } + } } else { diff --git a/src/progs/dyecmd/client.cpp b/src/progs/dyecmd/client.cpp index d4e93eb7f..27109753d 100644 --- a/src/progs/dyecmd/client.cpp +++ b/src/progs/dyecmd/client.cpp @@ -118,6 +118,10 @@ volatile bool runCounters; bool isSafeMode = false; int serverVersion = 0; int packetVersion = 0; +int packetsType = 0; +bool packets_main = true; +bool packets_re = false; +bool packets_zero = false; unsigned int tmwServerVersion = 0; time_t start_time; unsigned int mLastHost = 0; diff --git a/src/progs/manaplus/client.cpp b/src/progs/manaplus/client.cpp index b03a16ef6..5946f01d5 100644 --- a/src/progs/manaplus/client.cpp +++ b/src/progs/manaplus/client.cpp @@ -189,6 +189,10 @@ volatile bool runCounters; bool isSafeMode = false; int serverVersion = 0; int packetVersion = 0; +int packetsType = 0; +bool packets_main = true; +bool packets_re = false; +bool packets_zero = false; unsigned int tmwServerVersion = 0; time_t start_time; unsigned int mLastHost = 0; -- cgit v1.2.3-70-g09d2