2015-05-15 03:36:57 +02:00
|
|
|
|
|
|
|
#include "svc_serverinfo.h"
|
2015-06-25 05:59:39 +02:00
|
|
|
#include "base/bitfile.h"
|
2016-04-28 04:31:33 +02:00
|
|
|
#include "game/sourcecontext.h"
|
2015-05-15 03:36:57 +02:00
|
|
|
|
|
|
|
namespace NetHandlers
|
|
|
|
{
|
2015-06-19 02:23:26 +02:00
|
|
|
bool SVC_ServerInfo_BitRead_Internal(BitRead& bitbuf, SourceGameContext& context, NetMsg::SVC_ServerInfo* data)
|
2015-05-15 03:36:57 +02:00
|
|
|
{
|
|
|
|
data->protocol = bitbuf.ReadShort();
|
|
|
|
data->serverCount = bitbuf.ReadLong();
|
|
|
|
data->isHLTV = bitbuf.ReadOneBit() != 0;
|
|
|
|
data->isDedicated = bitbuf.ReadOneBit() != 0;
|
|
|
|
data->clientCRC = bitbuf.ReadLong();
|
|
|
|
data->maxClasses = bitbuf.ReadWord();
|
|
|
|
if (context.protocol <= 17)
|
|
|
|
{
|
|
|
|
data->mapCRC = bitbuf.ReadLong();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-05-01 18:38:37 +02:00
|
|
|
bitbuf.ReadBytes(data->mapMD5, sizeof(data->mapMD5));
|
2015-05-15 03:36:57 +02:00
|
|
|
}
|
|
|
|
data->playerSlot = bitbuf.ReadByte();
|
|
|
|
data->maxClients = bitbuf.ReadByte();
|
|
|
|
data->tickInterval = bitbuf.ReadFloat();
|
|
|
|
data->os = bitbuf.ReadChar();
|
|
|
|
bitbuf.ReadString(data->gameDir, sizeof(data->gameDir));
|
|
|
|
bitbuf.ReadString(data->mapName, sizeof(data->mapName));
|
|
|
|
bitbuf.ReadString(data->skyName, sizeof(data->skyName));
|
|
|
|
bitbuf.ReadString(data->hostName, sizeof(data->hostName));
|
|
|
|
if (context.protocol > 15)
|
|
|
|
{
|
2021-05-01 18:38:37 +02:00
|
|
|
data->isReplay = bitbuf.ReadOneBit() != 0;
|
2015-05-15 03:36:57 +02:00
|
|
|
}
|
|
|
|
return !bitbuf.IsOverflowed();
|
|
|
|
}
|
|
|
|
}
|