Fixed svc_prefetch parsing
This commit is contained in:
parent
6ec0224848
commit
9a0956e8f2
@ -31,7 +31,9 @@ enum constants
|
|||||||
|
|
||||||
DELTASIZE_BITS = 20, // must be: 2^DELTASIZE_BITS > (NET_MAX_PAYLOAD * 8)
|
DELTASIZE_BITS = 20, // must be: 2^DELTASIZE_BITS > (NET_MAX_PAYLOAD * 8)
|
||||||
EVENT_INDEX_BITS = 8,
|
EVENT_INDEX_BITS = 8,
|
||||||
MAX_SOUND_INDEX_BITS = 13,
|
|
||||||
|
MAX_SOUND_INDEX_BITS_OLD = 13,
|
||||||
|
MAX_SOUND_INDEX_BITS = 14,
|
||||||
|
|
||||||
MAX_USER_MSG_DATA = 255,
|
MAX_USER_MSG_DATA = 255,
|
||||||
|
|
||||||
|
@ -8,13 +8,27 @@ namespace NetHandlers
|
|||||||
bool SVC_Prefetch_BitRead_Internal(bf_read& bitbuf, SourceGameContext& context, NetMsg::SVC_Prefetch* data)
|
bool SVC_Prefetch_BitRead_Internal(bf_read& bitbuf, SourceGameContext& context, NetMsg::SVC_Prefetch* data)
|
||||||
{
|
{
|
||||||
data->type = NetMsg::SVC_Prefetch::SOUND;
|
data->type = NetMsg::SVC_Prefetch::SOUND;
|
||||||
|
if (context.protocol > 23)
|
||||||
|
{
|
||||||
data->soundIndex = bitbuf.ReadUBitLong(MAX_SOUND_INDEX_BITS);
|
data->soundIndex = bitbuf.ReadUBitLong(MAX_SOUND_INDEX_BITS);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
data->soundIndex = bitbuf.ReadUBitLong(MAX_SOUND_INDEX_BITS_OLD);
|
||||||
|
}
|
||||||
return !bitbuf.IsOverflowed();
|
return !bitbuf.IsOverflowed();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SVC_Prefetch_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_Prefetch* data)
|
bool SVC_Prefetch_BitWrite_Internal(bf_write& bitbuf, SourceGameContext& context, NetMsg::SVC_Prefetch* data)
|
||||||
|
{
|
||||||
|
if (context.protocol > 23)
|
||||||
{
|
{
|
||||||
bitbuf.WriteUBitLong(data->soundIndex, MAX_SOUND_INDEX_BITS);
|
bitbuf.WriteUBitLong(data->soundIndex, MAX_SOUND_INDEX_BITS);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bitbuf.WriteUBitLong(data->soundIndex, MAX_SOUND_INDEX_BITS_OLD);
|
||||||
|
}
|
||||||
return !bitbuf.IsOverflowed();
|
return !bitbuf.IsOverflowed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user