diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 2d69ca2e0..c827a9287 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -21705,5 +21705,3 @@ void Player::SetHomebindToLocation(WorldLocation const& loc, uint32 area_id) CharacterDatabase.PExecute("UPDATE character_homebind SET map = '%u', zone = '%u', position_x = '%f', position_y = '%f', position_z = '%f' WHERE guid = '%u'", m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ, GetGUIDLow()); } - - diff --git a/src/game/Player.h b/src/game/Player.h index 7aed9eed7..27222522a 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1093,6 +1093,7 @@ class MANGOS_DLL_SPEC Player : public Unit // Played Time Stuff time_t m_logintime; time_t m_Last_tick; + uint32 m_Played_time[MAX_PLAYED_TIME_INDEX]; uint32 GetTotalPlayedTime() { return m_Played_time[PLAYED_TIME_TOTAL]; } uint32 GetLevelPlayedTime() { return m_Played_time[PLAYED_TIME_LEVEL]; } diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index a2749bfac..b08c31648 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -2661,9 +2661,9 @@ enum TotemSlot // we need to stick to 1 version or half of the stuff will work for someone // others will not and opposite -// will only support WoW, WoW:TBC and WoW:WotLK 3.3.3 client build 11643... +// will only support WoW, WoW:TBC and WoW:WotLK 3.3.3 client build 11655... -#define EXPECTED_MANGOSD_CLIENT_BUILD {11643, 0} +#define EXPECTED_MANGOSD_CLIENT_BUILD {11655, 0} // max supported expansion level in mangosd // NOTE: not set it more that supported by targeted client version with all expansions installed diff --git a/src/game/UpdateFields.h b/src/game/UpdateFields.h index c9ddbb90e..e5a1bbbbc 100644 --- a/src/game/UpdateFields.h +++ b/src/game/UpdateFields.h @@ -19,7 +19,7 @@ #ifndef _UPDATEFIELDS_AUTO_H #define _UPDATEFIELDS_AUTO_H -// Auto generated for version 0, 3, 3, 11643 +// Auto generated for version 0, 3, 3, 11655 enum EObjectFields { diff --git a/src/realmd/AuthCodes.h b/src/realmd/AuthCodes.h index 9a75f5935..5add133cd 100644 --- a/src/realmd/AuthCodes.h +++ b/src/realmd/AuthCodes.h @@ -49,7 +49,7 @@ enum eAuthResults #define EXPECTED_REALMD_CLIENT_BUILD \ { \ - 11643, /* 3.3.3 and higher */ \ + 11655, /* 3.3.3 and higher */ \ 11159, /* 3.3.0a */ \ 10505, /* 3.2.2a */ \ 8606, /* 2.4.3 */ \ diff --git a/src/shared/Auth/AuthCrypt.cpp b/src/shared/Auth/AuthCrypt.cpp index f718b104b..960a5deef 100644 --- a/src/shared/Auth/AuthCrypt.cpp +++ b/src/shared/Auth/AuthCrypt.cpp @@ -21,7 +21,7 @@ #include "Log.h" #include "BigNumber.h" -AuthCrypt::AuthCrypt() +AuthCrypt::AuthCrypt() : _clientDecrypt(SHA_DIGEST_LENGTH), _serverEncrypt(SHA_DIGEST_LENGTH) { _initialized = false; } @@ -33,13 +33,11 @@ AuthCrypt::~AuthCrypt() void AuthCrypt::Init(BigNumber *K) { - //uint8 ServerEncryptionKey[SEED_KEY_SIZE] = { 0x22, 0xBE, 0xE5, 0xCF, 0xBB, 0x07, 0x64, 0xD9, 0x00, 0x45, 0x1B, 0xD0, 0x24, 0xB8, 0xD5, 0x45 }; uint8 ServerEncryptionKey[SEED_KEY_SIZE] = { 0xCC, 0x98, 0xAE, 0x04, 0xE8, 0x97, 0xEA, 0xCA, 0x12, 0xDD, 0xC0, 0x93, 0x42, 0x91, 0x53, 0x57 }; HmacHash serverEncryptHmac(SEED_KEY_SIZE, (uint8*)ServerEncryptionKey); uint8 *encryptHash = serverEncryptHmac.ComputeHash(K); - //uint8 ServerDecryptionKey[SEED_KEY_SIZE] = { 0xF4, 0x66, 0x31, 0x59, 0xFC, 0x83, 0x6E, 0x31, 0x31, 0x02, 0x51, 0xD5, 0x44, 0x31, 0x67, 0x98 }; uint8 ServerDecryptionKey[SEED_KEY_SIZE] = { 0xC2, 0xB3, 0x72, 0x3C, 0xC6, 0xAE, 0xD9, 0xB5, 0x34, 0x3C, 0x53, 0xEE, 0x2F, 0x43, 0x67, 0xCE }; HmacHash clientDecryptHmac(SEED_KEY_SIZE, (uint8*)ServerDecryptionKey); diff --git a/src/shared/Auth/BigNumber.cpp b/src/shared/Auth/BigNumber.cpp index 929abaaf3..3bd1957d9 100644 --- a/src/shared/Auth/BigNumber.cpp +++ b/src/shared/Auth/BigNumber.cpp @@ -164,7 +164,7 @@ bool BigNumber::isZero() const return BN_is_zero(_bn)!=0; } -uint8 *BigNumber::AsByteArray(int minSize) +uint8 *BigNumber::AsByteArray(int minSize, bool reverse) { int length = (minSize >= GetNumBytes()) ? minSize : GetNumBytes(); @@ -181,7 +181,8 @@ uint8 *BigNumber::AsByteArray(int minSize) BN_bn2bin(_bn, (unsigned char *)_array); - std::reverse(_array, _array + length); + if (reverse) + std::reverse(_array, _array + length); return _array; } diff --git a/src/shared/Auth/BigNumber.h b/src/shared/Auth/BigNumber.h index 611fe7d06..3654f8870 100644 --- a/src/shared/Auth/BigNumber.h +++ b/src/shared/Auth/BigNumber.h @@ -81,7 +81,7 @@ class BigNumber struct bignum_st *BN() { return _bn; } uint32 AsDword(); - uint8* AsByteArray(int minSize = 0); + uint8* AsByteArray(int minSize = 0, bool reverse = true); const char *AsHexStr(); const char *AsDecStr(); diff --git a/src/shared/Auth/Hmac.cpp b/src/shared/Auth/Hmac.cpp index e93f24362..ce5d1f100 100644 --- a/src/shared/Auth/Hmac.cpp +++ b/src/shared/Auth/Hmac.cpp @@ -21,10 +21,8 @@ HmacHash::HmacHash(uint32 len, uint8 *seed) { - ASSERT(len == SEED_KEY_SIZE); - HMAC_CTX_init(&m_ctx); - HMAC_Init_ex(&m_ctx, seed, SEED_KEY_SIZE, EVP_sha1(), NULL); + HMAC_Init_ex(&m_ctx, seed, len, EVP_sha1(), NULL); } HmacHash::~HmacHash() @@ -42,6 +40,11 @@ void HmacHash::UpdateData(const uint8 *data, int length) HMAC_Update(&m_ctx, data, length); } +void HmacHash::UpdateData(const std::string &str) +{ + UpdateData((uint8 const*)str.c_str(), str.length()); +} + void HmacHash::Finalize() { uint32 length = 0; diff --git a/src/shared/Auth/Hmac.h b/src/shared/Auth/Hmac.h index 687f8e842..761b98366 100644 --- a/src/shared/Auth/Hmac.h +++ b/src/shared/Auth/Hmac.h @@ -34,6 +34,7 @@ class HmacHash ~HmacHash(); void UpdateBigNumber(BigNumber *bn); void UpdateData(const uint8 *data, int length); + void UpdateData(const std::string &str); void Finalize(); uint8 *ComputeHash(BigNumber *bn); uint8 *GetDigest() { return (uint8*)m_digest; } diff --git a/src/shared/Auth/SARC4.cpp b/src/shared/Auth/SARC4.cpp index eba3ae8c1..4984f9fda 100644 --- a/src/shared/Auth/SARC4.cpp +++ b/src/shared/Auth/SARC4.cpp @@ -19,18 +19,18 @@ #include "Auth/SARC4.h" #include -SARC4::SARC4() +SARC4::SARC4(uint8 len) { EVP_CIPHER_CTX_init(&m_ctx); EVP_EncryptInit_ex(&m_ctx, EVP_rc4(), NULL, NULL, NULL); - EVP_CIPHER_CTX_set_key_length(&m_ctx, SHA_DIGEST_LENGTH); + EVP_CIPHER_CTX_set_key_length(&m_ctx, len); } -SARC4::SARC4(uint8 *seed) +SARC4::SARC4(uint8 *seed, uint8 len) { EVP_CIPHER_CTX_init(&m_ctx); EVP_EncryptInit_ex(&m_ctx, EVP_rc4(), NULL, NULL, NULL); - EVP_CIPHER_CTX_set_key_length(&m_ctx, SHA_DIGEST_LENGTH); + EVP_CIPHER_CTX_set_key_length(&m_ctx, len); EVP_EncryptInit_ex(&m_ctx, NULL, NULL, seed, NULL); } diff --git a/src/shared/Auth/SARC4.h b/src/shared/Auth/SARC4.h index 9805f10c9..d80ce62bb 100644 --- a/src/shared/Auth/SARC4.h +++ b/src/shared/Auth/SARC4.h @@ -25,8 +25,8 @@ class SARC4 { public: - SARC4(); - SARC4(uint8 *seed); + SARC4(uint8 len); + SARC4(uint8 *seed, uint8 len); ~SARC4(); void Init(uint8 *seed); void UpdateData(int len, uint8 *data);