diff options
| author | Shauren <shauren.trinity@gmail.com> | 2014-10-04 15:45:33 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2014-10-04 15:45:33 +0200 |
| commit | 8427e879f1cdda3005031d70fb15ab0b32322df1 (patch) | |
| tree | cf84a564d0f38240594549f26bc0ccccf34a3775 /src/server/authserver/Server/BattlenetBitStream.h | |
| parent | a73cee97e298c251c71774f3507997df40b5f957 (diff) | |
Core/Authserver
* Reorganized packet classes, moved each channel to separate namespace and file
* Added all opcode names for channels: auth, connection and wowrealm
* Documented more fields in LogonResponse
Diffstat (limited to 'src/server/authserver/Server/BattlenetBitStream.h')
| -rw-r--r-- | src/server/authserver/Server/BattlenetBitStream.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/server/authserver/Server/BattlenetBitStream.h b/src/server/authserver/Server/BattlenetBitStream.h index 6a5e366ede5..3601c3b0b0c 100644 --- a/src/server/authserver/Server/BattlenetBitStream.h +++ b/src/server/authserver/Server/BattlenetBitStream.h @@ -125,7 +125,7 @@ namespace Battlenet { static_assert(std::is_integral<T>::value || std::is_enum<T>::value, "T must be an integer type"); - if (_readPos + bitCount >= _writePos) + if (_readPos + bitCount > _writePos) throw BitStreamPositionException(true, bitCount, _readPos, _writePos); uint64 ret = 0; @@ -188,7 +188,7 @@ namespace Battlenet { static_assert(std::is_integral<T>::value || std::is_enum<T>::value, "T must be an integer type"); - if (_writePos + bitCount >= 8 * MaxSize) + if (_writePos + bitCount > 8 * MaxSize) throw BitStreamPositionException(false, bitCount, _writePos, MaxSize * 8); while (bitCount != 0) @@ -214,7 +214,7 @@ namespace Battlenet void SetReadPos(uint32 bits) { - if (bits >= _writePos) + if (bits > _writePos) throw BitStreamPositionException(true, bits, 0, _writePos); _readPos = bits; @@ -235,6 +235,9 @@ namespace Battlenet template<> bool BitStream::Read<bool>(uint32 bitCount); + + template<> + void BitStream::Write<bool>(bool value, uint32 bitCount); } #endif // __BATTLENETBITSTREAM_H__ |
