mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
Updated to PTR build 11655.
This commit is contained in:
parent
e73c5d3b79
commit
768772b14b
12 changed files with 23 additions and 21 deletions
|
|
@ -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'",
|
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());
|
m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ, GetGUIDLow());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1093,6 +1093,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||||
// Played Time Stuff
|
// Played Time Stuff
|
||||||
time_t m_logintime;
|
time_t m_logintime;
|
||||||
time_t m_Last_tick;
|
time_t m_Last_tick;
|
||||||
|
|
||||||
uint32 m_Played_time[MAX_PLAYED_TIME_INDEX];
|
uint32 m_Played_time[MAX_PLAYED_TIME_INDEX];
|
||||||
uint32 GetTotalPlayedTime() { return m_Played_time[PLAYED_TIME_TOTAL]; }
|
uint32 GetTotalPlayedTime() { return m_Played_time[PLAYED_TIME_TOTAL]; }
|
||||||
uint32 GetLevelPlayedTime() { return m_Played_time[PLAYED_TIME_LEVEL]; }
|
uint32 GetLevelPlayedTime() { return m_Played_time[PLAYED_TIME_LEVEL]; }
|
||||||
|
|
|
||||||
|
|
@ -2661,9 +2661,9 @@ enum TotemSlot
|
||||||
|
|
||||||
// we need to stick to 1 version or half of the stuff will work for someone
|
// we need to stick to 1 version or half of the stuff will work for someone
|
||||||
// others will not and opposite
|
// 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
|
// max supported expansion level in mangosd
|
||||||
// NOTE: not set it more that supported by targeted client version with all expansions installed
|
// NOTE: not set it more that supported by targeted client version with all expansions installed
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
#ifndef _UPDATEFIELDS_AUTO_H
|
#ifndef _UPDATEFIELDS_AUTO_H
|
||||||
#define _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
|
enum EObjectFields
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ enum eAuthResults
|
||||||
|
|
||||||
#define EXPECTED_REALMD_CLIENT_BUILD \
|
#define EXPECTED_REALMD_CLIENT_BUILD \
|
||||||
{ \
|
{ \
|
||||||
11643, /* 3.3.3 and higher */ \
|
11655, /* 3.3.3 and higher */ \
|
||||||
11159, /* 3.3.0a */ \
|
11159, /* 3.3.0a */ \
|
||||||
10505, /* 3.2.2a */ \
|
10505, /* 3.2.2a */ \
|
||||||
8606, /* 2.4.3 */ \
|
8606, /* 2.4.3 */ \
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "BigNumber.h"
|
#include "BigNumber.h"
|
||||||
|
|
||||||
AuthCrypt::AuthCrypt()
|
AuthCrypt::AuthCrypt() : _clientDecrypt(SHA_DIGEST_LENGTH), _serverEncrypt(SHA_DIGEST_LENGTH)
|
||||||
{
|
{
|
||||||
_initialized = false;
|
_initialized = false;
|
||||||
}
|
}
|
||||||
|
|
@ -33,13 +33,11 @@ AuthCrypt::~AuthCrypt()
|
||||||
|
|
||||||
void AuthCrypt::Init(BigNumber *K)
|
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 };
|
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);
|
HmacHash serverEncryptHmac(SEED_KEY_SIZE, (uint8*)ServerEncryptionKey);
|
||||||
uint8 *encryptHash = serverEncryptHmac.ComputeHash(K);
|
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 };
|
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);
|
HmacHash clientDecryptHmac(SEED_KEY_SIZE, (uint8*)ServerDecryptionKey);
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ bool BigNumber::isZero() const
|
||||||
return BN_is_zero(_bn)!=0;
|
return BN_is_zero(_bn)!=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 *BigNumber::AsByteArray(int minSize)
|
uint8 *BigNumber::AsByteArray(int minSize, bool reverse)
|
||||||
{
|
{
|
||||||
int length = (minSize >= GetNumBytes()) ? minSize : GetNumBytes();
|
int length = (minSize >= GetNumBytes()) ? minSize : GetNumBytes();
|
||||||
|
|
||||||
|
|
@ -181,7 +181,8 @@ uint8 *BigNumber::AsByteArray(int minSize)
|
||||||
|
|
||||||
BN_bn2bin(_bn, (unsigned char *)_array);
|
BN_bn2bin(_bn, (unsigned char *)_array);
|
||||||
|
|
||||||
std::reverse(_array, _array + length);
|
if (reverse)
|
||||||
|
std::reverse(_array, _array + length);
|
||||||
|
|
||||||
return _array;
|
return _array;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ class BigNumber
|
||||||
struct bignum_st *BN() { return _bn; }
|
struct bignum_st *BN() { return _bn; }
|
||||||
|
|
||||||
uint32 AsDword();
|
uint32 AsDword();
|
||||||
uint8* AsByteArray(int minSize = 0);
|
uint8* AsByteArray(int minSize = 0, bool reverse = true);
|
||||||
|
|
||||||
const char *AsHexStr();
|
const char *AsHexStr();
|
||||||
const char *AsDecStr();
|
const char *AsDecStr();
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,8 @@
|
||||||
|
|
||||||
HmacHash::HmacHash(uint32 len, uint8 *seed)
|
HmacHash::HmacHash(uint32 len, uint8 *seed)
|
||||||
{
|
{
|
||||||
ASSERT(len == SEED_KEY_SIZE);
|
|
||||||
|
|
||||||
HMAC_CTX_init(&m_ctx);
|
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()
|
HmacHash::~HmacHash()
|
||||||
|
|
@ -42,6 +40,11 @@ void HmacHash::UpdateData(const uint8 *data, int length)
|
||||||
HMAC_Update(&m_ctx, data, 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()
|
void HmacHash::Finalize()
|
||||||
{
|
{
|
||||||
uint32 length = 0;
|
uint32 length = 0;
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ class HmacHash
|
||||||
~HmacHash();
|
~HmacHash();
|
||||||
void UpdateBigNumber(BigNumber *bn);
|
void UpdateBigNumber(BigNumber *bn);
|
||||||
void UpdateData(const uint8 *data, int length);
|
void UpdateData(const uint8 *data, int length);
|
||||||
|
void UpdateData(const std::string &str);
|
||||||
void Finalize();
|
void Finalize();
|
||||||
uint8 *ComputeHash(BigNumber *bn);
|
uint8 *ComputeHash(BigNumber *bn);
|
||||||
uint8 *GetDigest() { return (uint8*)m_digest; }
|
uint8 *GetDigest() { return (uint8*)m_digest; }
|
||||||
|
|
|
||||||
|
|
@ -19,18 +19,18 @@
|
||||||
#include "Auth/SARC4.h"
|
#include "Auth/SARC4.h"
|
||||||
#include <openssl/sha.h>
|
#include <openssl/sha.h>
|
||||||
|
|
||||||
SARC4::SARC4()
|
SARC4::SARC4(uint8 len)
|
||||||
{
|
{
|
||||||
EVP_CIPHER_CTX_init(&m_ctx);
|
EVP_CIPHER_CTX_init(&m_ctx);
|
||||||
EVP_EncryptInit_ex(&m_ctx, EVP_rc4(), NULL, NULL, NULL);
|
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_CIPHER_CTX_init(&m_ctx);
|
||||||
EVP_EncryptInit_ex(&m_ctx, EVP_rc4(), NULL, NULL, NULL);
|
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);
|
EVP_EncryptInit_ex(&m_ctx, NULL, NULL, seed, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@
|
||||||
class SARC4
|
class SARC4
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SARC4();
|
SARC4(uint8 len);
|
||||||
SARC4(uint8 *seed);
|
SARC4(uint8 *seed, uint8 len);
|
||||||
~SARC4();
|
~SARC4();
|
||||||
void Init(uint8 *seed);
|
void Init(uint8 *seed);
|
||||||
void UpdateData(int len, uint8 *data);
|
void UpdateData(int len, uint8 *data);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue