mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/PacketIO: Updated auction packets to newer build
This commit is contained in:
@@ -427,23 +427,24 @@ class TC_SHARED_API ByteBuffer
|
||||
_rpos += skip;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template <typename T, typename Underlying = T>
|
||||
T read()
|
||||
{
|
||||
ResetBitPos();
|
||||
T r = read<T>(_rpos);
|
||||
_rpos += sizeof(T);
|
||||
T r = read<T, Underlying>(_rpos);
|
||||
_rpos += sizeof(Underlying);
|
||||
return r;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template <typename T, typename Underlying = T>
|
||||
T read(size_t pos) const
|
||||
{
|
||||
if (pos + sizeof(T) > size())
|
||||
throw ByteBufferPositionException(pos, sizeof(T), size());
|
||||
T val = *((T const*)&_storage[pos]);
|
||||
if (pos + sizeof(Underlying) > size())
|
||||
throw ByteBufferPositionException(pos, sizeof(Underlying), size());
|
||||
Underlying val;
|
||||
std::memcpy(&val, &_storage[pos], sizeof(Underlying));
|
||||
EndianConvert(val);
|
||||
return val;
|
||||
return static_cast<T>(val);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
||||
Reference in New Issue
Block a user