public void EnterNew() { var ci = new CCLCMsg_ClientInfo(); ci.server_count = client.ServerCount; var ciMessage = Connection.ConvertProtoToMessage<CCLCMsg_ClientInfo>( (uint) CLC_Messages.clc_ClientInfo, ci); var ss = new CNETMsg_SignonState(); ss.signon_state = (uint) SIGNONSTATE.SIGNONSTATE_NEW; ss.spawn_count = client.ServerCount; ss.num_server_players = 0; var ssMessage = Connection.ConvertProtoToMessage<CNETMsg_SignonState>( (uint) NET_Messages.net_SignonState, ss); var scv = new CNETMsg_SetConVar(); scv.convars = new CMsg_CVars(); var cvar = new CMsg_CVars.CVar(); cvar.name = "steamworks_sessionid_client"; cvar.value = client.SteamworksSessionId.ToString(); client.CVars["steamworks_sessionid_client"] = client.SteamworksSessionId.ToString(); scv.convars.cvars.Add(cvar); var scvMessage = Connection.ConvertProtoToMessage<CNETMsg_SetConVar>( (uint) NET_Messages.net_SetConVar, scv); connection.SendReliably(ciMessage, ssMessage, scvMessage); }
public CMsg_CVars ExposeCVars() { CMsg_CVars exposed = new CMsg_CVars(); exposed.cvars.AddRange(CVars.Select(kv => { var var = new CMsg_CVars.CVar(); var.name = kv.Key; var.value = kv.Value; return var; })); return exposed; }