Core/Battle.net
* Extended AuthResult enum * Implemented WriteString in BitStream * Fixed HexStrToByteArray in reverse mode
This commit is contained in:
@@ -75,6 +75,8 @@ namespace Battlenet
|
||||
enum AuthResult
|
||||
{
|
||||
AUTH_OK = 0,
|
||||
AUTH_INTERNAL_ERROR = 100,
|
||||
AUTH_CORRUPTED_MODULE = 102,
|
||||
AUTH_BAD_SERVER_PROOF = 103,
|
||||
AUTH_UNKNOWN_ACCOUNT = 104,
|
||||
AUTH_CLOSED = 105,
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace Battlenet
|
||||
_writePos = (_writePos + 7) & ~7;
|
||||
}
|
||||
|
||||
std::string ReadString(uint32 bitCount, uint32 baseLength = 0)
|
||||
std::string ReadString(uint32 bitCount, int32 baseLength = 0)
|
||||
{
|
||||
uint32 len = Read<uint32>(bitCount) + baseLength;
|
||||
AlignToNextByte();
|
||||
@@ -120,7 +120,11 @@ namespace Battlenet
|
||||
return ret;
|
||||
}
|
||||
|
||||
//WriteString
|
||||
void WriteString(std::string const& str, uint32 bitCount, int32 baseLength = 0)
|
||||
{
|
||||
Write(str.length() + baseLength, bitCount);
|
||||
WriteBytes(str.c_str(), str.length());
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void WriteBytes(T* data, uint32 count)
|
||||
|
||||
@@ -561,7 +561,7 @@ void HexStrToByteArray(std::string const& str, uint8* out, bool reverse /*= fals
|
||||
if (reverse)
|
||||
{
|
||||
init = str.length() - 2;
|
||||
end = -1;
|
||||
end = -2;
|
||||
op = -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user