2015-05-15 03:36:57 +02:00
|
|
|
|
|
|
|
#include "svc_sendtable.h"
|
2015-06-25 05:59:39 +02:00
|
|
|
#include "base/bitfile.h"
|
2015-05-15 03:36:57 +02:00
|
|
|
#include "netmath.h"
|
|
|
|
|
|
|
|
namespace NetHandlers
|
|
|
|
{
|
2015-06-19 02:23:26 +02:00
|
|
|
bool SVC_SendTable_BitRead_Internal(BitRead& bitbuf, SourceGameContext& context, NetMsg::SVC_SendTable* data)
|
2015-05-15 03:36:57 +02:00
|
|
|
{
|
|
|
|
data->needsDecoder = bitbuf.ReadOneBit() != 0;
|
|
|
|
data->dataLengthInBits = bitbuf.ReadShort();
|
|
|
|
data->data.reset(new uint8_t[math::BitsToBytes(data->dataLengthInBits)]);
|
|
|
|
bitbuf.ReadBits(data->data.get(), data->dataLengthInBits);
|
|
|
|
return !bitbuf.IsOverflowed();
|
|
|
|
}
|
|
|
|
}
|