public void LogOn( LogOnDetails details )
{
if ( details == null )
{
throw new ArgumentNullException( "details" );
}
if ( string.IsNullOrEmpty( details.Username ) || string.IsNullOrEmpty( details.Password ) )
{
throw new ArgumentException( "LogOn requires a username and password to be set in 'details'." );
}
var logon = new ClientMsgProtobuf<CMsgClientLogon>( EMsg.ClientLogon );
SteamID steamId = new SteamID( 0, details.AccountInstance, Client.ConnectedUniverse, EAccountType.Individual );
uint localIp = NetHelpers.GetIPAddress( this.Client.LocalIP );
logon.ProtoHeader.client_sessionid = 0;
logon.ProtoHeader.steamid = steamId.ConvertToUInt64();
logon.Body.obfustucated_private_ip = localIp ^ MsgClientLogon.ObfuscationMask;
logon.Body.account_name = details.Username;
logon.Body.password = details.Password;
logon.Body.protocol_version = MsgClientLogon.CurrentProtocol;
logon.Body.client_os_type = ( uint )Utils.GetOSType();
logon.Body.client_language = "english";
logon.Body.steam2_ticket_request = details.RequestSteam2Ticket;
// we're now using the latest steamclient package version, this is required to get a proper sentry file for steam guard
logon.Body.client_package_version = 1771; // todo: determine if this is still required
// this is not a proper machine id that Steam accepts
// but it's good enough for identifying a machine
logon.Body.machine_id = Utils.GenerateMachineID();
// steam guard
logon.Body.auth_code = details.AuthCode;
logon.Body.sha_sentryfile = details.SentryFileHash;
logon.Body.eresult_sentryfile = ( int )( details.SentryFileHash != null ? EResult.OK : EResult.FileNotFound );
this.Client.Send( logon );
}
/// <summary>