diff --git a/TODO b/TODO index e89d4983..89e7d821 100644 --- a/TODO +++ b/TODO @@ -35,6 +35,7 @@ select characters in lineedits scrolling multiline edit mouse wheel lineedits onMapKnown event +save different account/pasword/server for each otclient protocol version == OPTIMIZATIONS AND REWORKS * game diff --git a/src/otclient/core/thingtype.h b/src/otclient/core/thingtype.h index f4c6c9f4..f4561dcc 100644 --- a/src/otclient/core/thingtype.h +++ b/src/otclient/core/thingtype.h @@ -50,7 +50,7 @@ struct ThingType IsStackable, IsForceUse, IsMultiUse, -#if PROTOCOL<=810 +#if PROTOCOL<=854 IsRune, #endif IsWritable, diff --git a/src/otclient/net/protocolcodes.h b/src/otclient/net/protocolcodes.h index da89d2d9..2a87b721 100644 --- a/src/otclient/net/protocolcodes.h +++ b/src/otclient/net/protocolcodes.h @@ -25,7 +25,12 @@ #include -#if PROTOCOL != 860 && PROTOCOL != 861 && PROTOCOL != 862 && PROTOCOL != 870 && PROTOCOL != 810 +#if PROTOCOL != 810 && \ + PROTOCOL != 854 && \ + PROTOCOL != 860 && \ + PROTOCOL != 861 && \ + PROTOCOL != 862 && \ + PROTOCOL != 870 #error "the supplied protocol version is not supported" #endif @@ -47,10 +52,10 @@ namespace Proto { constexpr int ClientVersion = PROTOCOL; constexpr int PicSignature = 0x4E119CBF; -#if PROTOCOL>=861 - constexpr int NumViolationReasons = 19; -#elif PROTOCOL>=860 +#if PROTOCOL>=860 constexpr int NumViolationReasons = 20; +#elif PROTOCOL>=854 + constexpr int NumViolationReasons = 19; #elif PROTOCOL>=810 constexpr int NumViolationReasons = 32; #endif @@ -247,7 +252,7 @@ namespace Proto { ServerSpeakRVRAnswer, ServerSpeakRVRContinue, ServerSpeakChannelRed2 -#elif PROTOCOL>=860 +#elif PROTOCOL>=854 ServerSpeakSay = 1, ServerSpeakWhisper, ServerSpeakYell, @@ -263,7 +268,9 @@ namespace Proto { ServerSpeakChannelRed, ServerSpeakPrivateRed, ServerSpeakChannelOrange, + // 16 ?? ServerSpeakChannelRed2 = 17, + // 18 ?? ServerSpeakMonsterSay = 19, ServerSpeakMonsterYell #elif PROTOCOL>=810 @@ -304,7 +311,7 @@ namespace Proto { MessageStatusSmall, MessageConsoleBlue, MessageConsoleRed -#elif PROTOCOL>=860 +#elif PROTOCOL>=854 MessageConsoleRed = 18, MessageConsoleOrange, MessageConsoleOrange2, diff --git a/src/otclient/net/protocolgame.cpp b/src/otclient/net/protocolgame.cpp index 69d180ee..19cc47cd 100644 --- a/src/otclient/net/protocolgame.cpp +++ b/src/otclient/net/protocolgame.cpp @@ -43,7 +43,7 @@ void ProtocolGame::onConnect() { recv(); -#if PROTOCOL>=860 +#if PROTOCOL>=854 m_waitingLoginPacket = true; #else sendLoginPacket(0, 0); diff --git a/src/otclient/net/protocolgameparse.cpp b/src/otclient/net/protocolgameparse.cpp index 0d586083..6038ab33 100644 --- a/src/otclient/net/protocolgameparse.cpp +++ b/src/otclient/net/protocolgameparse.cpp @@ -398,7 +398,7 @@ void ProtocolGame::parseTileAddThing(InputMessage& msg) Position pos = parsePosition(msg); int stackPos = -1; -#if PROTOCOL>=860 +#if PROTOCOL>=854 stackPos = msg.getU8(); #endif @@ -762,7 +762,7 @@ void ProtocolGame::parsePlayerStats(InputMessage& msg) { double health = msg.getU16(); double maxHealth = msg.getU16(); -#if PROTOCOL>=860 +#if PROTOCOL>=854 double freeCapacity = msg.getU32() / 100.0; #else double freeCapacity = msg.getU16() / 100.0; @@ -1272,7 +1272,7 @@ ThingPtr ProtocolGame::internalGetThing(InputMessage& msg) int emblem = -1; bool passable = false; -#if PROTOCOL>=860 +#if PROTOCOL>=854 if(thingId == 0x0061) emblem = msg.getU8(); diff --git a/src/otclient/net/protocolgamesend.cpp b/src/otclient/net/protocolgamesend.cpp index 79fbbf0d..dadcad31 100644 --- a/src/otclient/net/protocolgamesend.cpp +++ b/src/otclient/net/protocolgamesend.cpp @@ -50,7 +50,7 @@ void ProtocolGame::sendLoginPacket(uint timestamp, uint8 unknown) msg.addU8(0); // is gm set? paddingBytes -= 17; -#if PROTOCOL>=860 +#if PROTOCOL>=854 enableChecksum(); msg.addString(m_accountName); @@ -60,7 +60,7 @@ void ProtocolGame::sendLoginPacket(uint timestamp, uint8 unknown) msg.addU32(timestamp); msg.addU8(unknown); paddingBytes -= 11 + m_accountName.length() + m_characterName.length() + m_accountPassword.length(); -#elif PROTOCOL>=810 +#else // PROTOCOL>=810 msg.addU32(Fw::fromstring(m_accountName)); msg.addString(m_characterName); msg.addString(m_accountPassword); diff --git a/src/otclient/net/protocollogin.cpp b/src/otclient/net/protocollogin.cpp index be1d4ca6..f0a2b9f2 100644 --- a/src/otclient/net/protocollogin.cpp +++ b/src/otclient/net/protocollogin.cpp @@ -110,7 +110,7 @@ void ProtocolLogin::sendLoginPacket() msg.addU32(m_xteaKey[3]); paddingBytes -= 16; -#if PROTOCOL>=860 +#if PROTOCOL>=854 enableChecksum(); msg.addString(m_accountName);