From 1f272b7abacbe10457382b413ee36c5620f2b646 Mon Sep 17 00:00:00 2001 From: BenDol Date: Sun, 3 Aug 2014 23:22:06 +1200 Subject: [PATCH] Added preview state packet. --- modules/gamelib/game.lua | 3 +-- src/client/protocolgamesend.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/gamelib/game.lua b/modules/gamelib/game.lua index 23083f41..58b53969 100644 --- a/modules/gamelib/game.lua +++ b/modules/gamelib/game.lua @@ -98,8 +98,7 @@ function g_game.getClientProtocolVersion(client) [985] = 977, [986] = 978, [1001] = 979, - [1002] = 980, - [1051] = 1000 -- no idea what protocol version is required (1051 doesn't work) + [1002] = 980 } return clients[client] or client end diff --git a/src/client/protocolgamesend.cpp b/src/client/protocolgamesend.cpp index 03c40602..5d1223a4 100644 --- a/src/client/protocolgamesend.cpp +++ b/src/client/protocolgamesend.cpp @@ -56,9 +56,14 @@ void ProtocolGame::sendLoginPacket(uint challengeTimestamp, uint8 challengeRando msg->addU16(g_game.getOs()); msg->addU16(g_game.getProtocolVersion()); - if(g_game.getProtocolVersion() >= 971) { + // This may only be required by the flash client + if(g_game.getClientVersion() >= 980) { msg->addU32(g_game.getClientVersion()); - msg->addU8(0); // clientType + msg->addU8(0); // client type + } + + if(g_game.getClientVersion() >= 1050) { + msg->addU8(0); // preview state } int offset = msg->getMessageSize();