Core/Battle.net

* Fixed infinite loop in ReadFourCC if value in packet was 0
* Corrected ClosingReason enum in ConnectionClosing
This commit is contained in:
Shauren
2020-04-13 21:00:29 +02:00
committed by Ovahlord
parent 1f93a67e04
commit e0be0caadd
5 changed files with 18 additions and 18 deletions

View File

@@ -72,7 +72,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);
}
@@ -84,7 +84,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 << "Region: " << uint32(GameAccountRegion);
stream << std::endl << "GameAccountName: " << GameAccountName;
return stream.str();

View File

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

View File

@@ -111,7 +111,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

@@ -966,7 +966,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();