support for protocol854

master
Eduardo Bart 12 years ago
parent 5a47e9d8a9
commit 5584bfdd99

@ -35,6 +35,7 @@ select characters in lineedits
scrolling multiline edit scrolling multiline edit
mouse wheel lineedits mouse wheel lineedits
onMapKnown event onMapKnown event
save different account/pasword/server for each otclient protocol version
== OPTIMIZATIONS AND REWORKS == OPTIMIZATIONS AND REWORKS
* game * game

@ -50,7 +50,7 @@ struct ThingType
IsStackable, IsStackable,
IsForceUse, IsForceUse,
IsMultiUse, IsMultiUse,
#if PROTOCOL<=810 #if PROTOCOL<=854
IsRune, IsRune,
#endif #endif
IsWritable, IsWritable,

@ -25,7 +25,12 @@
#include <otclient/global.h> #include <otclient/global.h>
#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" #error "the supplied protocol version is not supported"
#endif #endif
@ -47,10 +52,10 @@ namespace Proto {
constexpr int ClientVersion = PROTOCOL; constexpr int ClientVersion = PROTOCOL;
constexpr int PicSignature = 0x4E119CBF; constexpr int PicSignature = 0x4E119CBF;
#if PROTOCOL>=861 #if PROTOCOL>=860
constexpr int NumViolationReasons = 19;
#elif PROTOCOL>=860
constexpr int NumViolationReasons = 20; constexpr int NumViolationReasons = 20;
#elif PROTOCOL>=854
constexpr int NumViolationReasons = 19;
#elif PROTOCOL>=810 #elif PROTOCOL>=810
constexpr int NumViolationReasons = 32; constexpr int NumViolationReasons = 32;
#endif #endif
@ -247,7 +252,7 @@ namespace Proto {
ServerSpeakRVRAnswer, ServerSpeakRVRAnswer,
ServerSpeakRVRContinue, ServerSpeakRVRContinue,
ServerSpeakChannelRed2 ServerSpeakChannelRed2
#elif PROTOCOL>=860 #elif PROTOCOL>=854
ServerSpeakSay = 1, ServerSpeakSay = 1,
ServerSpeakWhisper, ServerSpeakWhisper,
ServerSpeakYell, ServerSpeakYell,
@ -263,7 +268,9 @@ namespace Proto {
ServerSpeakChannelRed, ServerSpeakChannelRed,
ServerSpeakPrivateRed, ServerSpeakPrivateRed,
ServerSpeakChannelOrange, ServerSpeakChannelOrange,
// 16 ??
ServerSpeakChannelRed2 = 17, ServerSpeakChannelRed2 = 17,
// 18 ??
ServerSpeakMonsterSay = 19, ServerSpeakMonsterSay = 19,
ServerSpeakMonsterYell ServerSpeakMonsterYell
#elif PROTOCOL>=810 #elif PROTOCOL>=810
@ -304,7 +311,7 @@ namespace Proto {
MessageStatusSmall, MessageStatusSmall,
MessageConsoleBlue, MessageConsoleBlue,
MessageConsoleRed MessageConsoleRed
#elif PROTOCOL>=860 #elif PROTOCOL>=854
MessageConsoleRed = 18, MessageConsoleRed = 18,
MessageConsoleOrange, MessageConsoleOrange,
MessageConsoleOrange2, MessageConsoleOrange2,

@ -43,7 +43,7 @@ void ProtocolGame::onConnect()
{ {
recv(); recv();
#if PROTOCOL>=860 #if PROTOCOL>=854
m_waitingLoginPacket = true; m_waitingLoginPacket = true;
#else #else
sendLoginPacket(0, 0); sendLoginPacket(0, 0);

@ -398,7 +398,7 @@ void ProtocolGame::parseTileAddThing(InputMessage& msg)
Position pos = parsePosition(msg); Position pos = parsePosition(msg);
int stackPos = -1; int stackPos = -1;
#if PROTOCOL>=860 #if PROTOCOL>=854
stackPos = msg.getU8(); stackPos = msg.getU8();
#endif #endif
@ -762,7 +762,7 @@ void ProtocolGame::parsePlayerStats(InputMessage& msg)
{ {
double health = msg.getU16(); double health = msg.getU16();
double maxHealth = msg.getU16(); double maxHealth = msg.getU16();
#if PROTOCOL>=860 #if PROTOCOL>=854
double freeCapacity = msg.getU32() / 100.0; double freeCapacity = msg.getU32() / 100.0;
#else #else
double freeCapacity = msg.getU16() / 100.0; double freeCapacity = msg.getU16() / 100.0;
@ -1272,7 +1272,7 @@ ThingPtr ProtocolGame::internalGetThing(InputMessage& msg)
int emblem = -1; int emblem = -1;
bool passable = false; bool passable = false;
#if PROTOCOL>=860 #if PROTOCOL>=854
if(thingId == 0x0061) if(thingId == 0x0061)
emblem = msg.getU8(); emblem = msg.getU8();

@ -50,7 +50,7 @@ void ProtocolGame::sendLoginPacket(uint timestamp, uint8 unknown)
msg.addU8(0); // is gm set? msg.addU8(0); // is gm set?
paddingBytes -= 17; paddingBytes -= 17;
#if PROTOCOL>=860 #if PROTOCOL>=854
enableChecksum(); enableChecksum();
msg.addString(m_accountName); msg.addString(m_accountName);
@ -60,7 +60,7 @@ void ProtocolGame::sendLoginPacket(uint timestamp, uint8 unknown)
msg.addU32(timestamp); msg.addU32(timestamp);
msg.addU8(unknown); msg.addU8(unknown);
paddingBytes -= 11 + m_accountName.length() + m_characterName.length() + m_accountPassword.length(); paddingBytes -= 11 + m_accountName.length() + m_characterName.length() + m_accountPassword.length();
#elif PROTOCOL>=810 #else // PROTOCOL>=810
msg.addU32(Fw::fromstring<uint32>(m_accountName)); msg.addU32(Fw::fromstring<uint32>(m_accountName));
msg.addString(m_characterName); msg.addString(m_characterName);
msg.addString(m_accountPassword); msg.addString(m_accountPassword);

@ -110,7 +110,7 @@ void ProtocolLogin::sendLoginPacket()
msg.addU32(m_xteaKey[3]); msg.addU32(m_xteaKey[3]);
paddingBytes -= 16; paddingBytes -= 16;
#if PROTOCOL>=860 #if PROTOCOL>=854
enableChecksum(); enableChecksum();
msg.addString(m_accountName); msg.addString(m_accountName);

Loading…
Cancel
Save