void ParseGameState(NetBuffer msg)
{
clc.connectPacketCount = 0;
// wipe local client state
ClearState();
// a gamestate always marks a server command sequence
clc.serverCommandSequence = msg.ReadInt32();
// parse all the configstrings and baselines
while (true)
{
int cmd = msg.ReadByte();
if (cmd == (int)svc_ops_e.svc_EOF)
break;
if (cmd == (int)svc_ops_e.svc_configstring)
{
int index = msg.ReadInt16();
string s = msg.ReadString();
cl.gamestate.data.Add(index, s);
}
else if (cmd == (int)svc_ops_e.svc_baseline)
{
int newnum = msg.ReadInt32();
if (newnum < 0 || newnum >= 1024)
{
Common.Instance.Error("ParseGameState: Baseline number out of range: " + newnum);
}
Common.entityState_t nullstate = new Common.entityState_t();
Net.Instance.MSG_ReadDeltaEntity(msg, ref nullstate, ref cl.entityBaselines[newnum], newnum);
}
else
{
Common.Instance.Error("ParseGameState: bad command byte");
}
}
clc.clientNum = msg.ReadInt32();
// parse useful values out of CS_SERVERINFO
//ParseServerInfo();
// parse serverId and other cvars
SystemInfoChanged();
InitDownloads();
}