2015-05-15 03:36:57 +02:00
|
|
|
|
|
|
|
#include "svc_voicedata.h"
|
2021-05-01 18:38:37 +02:00
|
|
|
#include "svc_voiceinit.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_VoiceData_BitRead_Internal(BitRead& bitbuf, SourceGameContext& context, NetMsg::SVC_VoiceData* data)
|
2015-05-15 03:36:57 +02:00
|
|
|
{
|
|
|
|
data->fromClientIndex = bitbuf.ReadByte();
|
|
|
|
data->proximity = !!bitbuf.ReadByte();
|
|
|
|
data->dataLengthInBits = bitbuf.ReadWord();
|
|
|
|
data->data.reset(new uint8_t[math::BitsToBytes(data->dataLengthInBits)]);
|
|
|
|
bitbuf.ReadBits(data->data.get(), data->dataLengthInBits);
|
|
|
|
return !bitbuf.IsOverflowed();
|
|
|
|
}
|
|
|
|
}
|