Core/Battle.net

* Updated game account flags
* Fixed infinite loop in ReadFourCC if value in packet was 0
* Corrected ClosingReason enum in ConnectionClosing
This commit is contained in:
Shauren
2015-10-04 00:26:38 +02:00
parent 8ebb105498
commit 705e5ea5d9
6 changed files with 38 additions and 37 deletions

View File

@@ -32,25 +32,26 @@ enum GameAccountFlags
GAMEACCOUNT_FLAG_EU_FORBID_ELV = 0x00000100,
GAMEACCOUNT_FLAG_EU_FORBID_BILLING = 0x00000200,
GAMEACCOUNT_FLAG_WOW_RESTRICTED = 0x00000400,
GAMEACCOUNT_FLAG_REFERRAL = 0x00000800,
GAMEACCOUNT_FLAG_BLIZZARD = 0x00001000,
GAMEACCOUNT_FLAG_RECURRING_BILLING = 0x00002000,
GAMEACCOUNT_FLAG_NOELECTUP = 0x00004000,
GAMEACCOUNT_FLAG_KR_CERTIFICATE = 0x00008000,
GAMEACCOUNT_FLAG_EXPANSION_COLLECTOR = 0x00010000,
GAMEACCOUNT_FLAG_DISABLE_VOICE = 0x00020000,
GAMEACCOUNT_FLAG_DISABLE_VOICE_SPEAK = 0x00040000,
GAMEACCOUNT_FLAG_REFERRAL_RESURRECT = 0x00080000,
GAMEACCOUNT_FLAG_EU_FORBID_CC = 0x00100000,
GAMEACCOUNT_FLAG_OPENBETA_DELL = 0x00200000,
GAMEACCOUNT_FLAG_PROPASS = 0x00400000,
GAMEACCOUNT_FLAG_PROPASS_LOCK = 0x00800000,
GAMEACCOUNT_FLAG_PENDING_UPGRADE = 0x01000000,
GAMEACCOUNT_FLAG_RETAIL_FROM_TRIAL = 0x02000000,
GAMEACCOUNT_FLAG_EXPANSION2_COLLECTOR = 0x04000000,
GAMEACCOUNT_FLAG_OVERMIND_LINKED = 0x08000000,
GAMEACCOUNT_FLAG_DEMOS = 0x10000000,
GAMEACCOUNT_FLAG_DEATH_KNIGHT_OK = 0x20000000,
GAMEACCOUNT_FLAG_PARENTAL_CONTROL = 0x00000800,
GAMEACCOUNT_FLAG_REFERRAL = 0x00001000,
GAMEACCOUNT_FLAG_BLIZZARD = 0x00002000,
GAMEACCOUNT_FLAG_RECURRING_BILLING = 0x00004000,
GAMEACCOUNT_FLAG_NOELECTUP = 0x00008000,
GAMEACCOUNT_FLAG_KR_CERTIFICATE = 0x00010000,
GAMEACCOUNT_FLAG_EXPANSION_COLLECTOR = 0x00020000,
GAMEACCOUNT_FLAG_DISABLE_VOICE = 0x00040000,
GAMEACCOUNT_FLAG_DISABLE_VOICE_SPEAK = 0x00080000,
GAMEACCOUNT_FLAG_REFERRAL_RESURRECT = 0x00100000,
GAMEACCOUNT_FLAG_EU_FORBID_CC = 0x00200000,
GAMEACCOUNT_FLAG_OPENBETA_DELL = 0x00400000,
GAMEACCOUNT_FLAG_PROPASS = 0x00800000,
GAMEACCOUNT_FLAG_PROPASS_LOCK = 0x01000000,
GAMEACCOUNT_FLAG_PENDING_UPGRADE = 0x02000000,
GAMEACCOUNT_FLAG_RETAIL_FROM_TRIAL = 0x04000000,
GAMEACCOUNT_FLAG_EXPANSION2_COLLECTOR = 0x08000000,
GAMEACCOUNT_FLAG_OVERMIND_LINKED = 0x10000000,
GAMEACCOUNT_FLAG_DEMOS = 0x20000000,
GAMEACCOUNT_FLAG_DEATH_KNIGHT_OK = 0x40000000,
};
namespace Battlenet

View File

@@ -35,7 +35,7 @@ void Battlenet::Authentication::ResumeRequest::Read()
}
Login = _stream.ReadString(9, 3);
Region = _stream.Read<uint8>(8);
GameAccountRegion = _stream.Read<uint8>(8);
GameAccountName = _stream.ReadString(5, 1);
}
@@ -47,7 +47,7 @@ std::string Battlenet::Authentication::ResumeRequest::ToString() const
stream << std::endl << "Battlenet::Component Program: " << component.Program << ", Platform: " << component.Platform << ", Build: " << component.Build;
stream << std::endl << "Login: " << Login;
stream << std::endl << "Region: " << uint32(Region);
stream << std::endl << "GameAccountRegion: " << uint32(GameAccountRegion);
stream << std::endl << "GameAccountName: " << GameAccountName;
return stream.str();

View File

@@ -60,7 +60,7 @@ namespace Battlenet
std::string Locale;
std::vector<Component> Components;
std::string Login;
uint8 Region = 0;
uint8 GameAccountRegion = 0;
std::string GameAccountName;
};

View File

@@ -123,7 +123,7 @@ namespace Battlenet
uint32 fcc = Read<uint32>(32);
EndianConvertReverse(fcc);
size_t len = 4;
while (!(fcc & 0xFF))
while (!(fcc & 0xFF) && len)
{
fcc >>= 8;
--len;

View File

@@ -100,19 +100,19 @@ namespace Battlenet
public:
enum ClosingReason
{
PACKET_TOO_LARGE,
PACKET_CORRUPT,
PACKET_INVALID,
PACKET_INCORRECT,
HEADER_CORRUPT,
HEADER_IGNORED,
HEADER_INCORRECT,
PACKET_REJECTED,
CHANNEL_UNHANDLED,
COMMAND_UNHANDLED,
COMMAND_BAD_PERMISSIONS,
DIRECT_CALL,
TIMEOUT,
PACKET_TOO_LARGE = 1,
PACKET_CORRUPT = 2,
PACKET_INVALID = 3,
PACKET_INCORRECT = 4,
HEADER_CORRUPT = 5,
HEADER_IGNORED = 6,
HEADER_INCORRECT = 7,
PACKET_REJECTED = 8,
CHANNEL_UNHANDLED = 9,
COMMAND_UNHANDLED = 10,
COMMAND_BAD_PERMISSIONS = 11,
DIRECT_CALL = 12,
TIMEOUT = 13,
};
struct PacketInfo

View File

@@ -978,7 +978,7 @@ bool Battlenet::Session::HandleRiskFingerprintModule(BitStream* dataStream, Serv
{
logonResponse->AccountId = _accountInfo->Id;
logonResponse->GameAccountName = _gameAccountInfo->Name;
logonResponse->GameAccountFlags = GAMEACCOUNT_FLAG_PROPASS_LOCK;
logonResponse->GameAccountFlags = GAMEACCOUNT_FLAG_PROPASS;
logonResponse->FailedLogins = _accountInfo->FailedLogins;
SQLTransaction trans = LoginDatabase.BeginTransaction();