private async Task ReceiveLogon(NetworkMessage messsage) { CMsgClientLogonResponse response = messsage.Deserialize <CMsgClientLogonResponse>(); if (response.eresult != 1) { await NetLog.InfoAsync($"Logon denied: {(Result)response.eresult}. Expect to disconnect").ConfigureAwait(false); } if (response.eresult == 1) { CellId = response.cell_id; var id = (messsage.Header as ClientHeader).SteamId; InstanceId = (long)response.client_instance_id; await NetLog.InfoAsync($"Logged in to Steam with session Id {SessionId} and steam ID {SteamId}").ConfigureAwait(false); _heartbeatCancel = new CancellationTokenSource(); _heartBeatTask = RunHeartbeatAsync(response.out_of_game_heartbeat_seconds * 1000, _heartbeatCancel.Token); await LoggedOn.TimedInvokeAsync(this, EventArgs.Empty, TaskTimeout, NetLog).ConfigureAwait(false); } else { await LoginRejected.InvokeAsync(this, new LoginRejectedEventArgs(response.client_supplied_steamid, (Result)response.eresult, (Result)response.eresult_extended, response.email_domain)).ConfigureAwait(false); } }
internal LoggedOnCallback(CMsgClientLogonResponse resp) { this.Result = ( EResult )resp.eresult; this.ExtendedResult = ( EResult )resp.eresult_extended; this.OutOfGameSecsPerHeartbeat = resp.out_of_game_heartbeat_seconds; this.InGameSecsPerHeartbeat = resp.in_game_heartbeat_seconds; this.PublicIP = NetHelpers.GetIPAddress(resp.public_ip); this.ServerTime = DateUtils.DateTimeFromUnixTime(resp.rtime32_server_time); this.AccountFlags = ( EAccountFlags )resp.account_flags; this.ClientSteamID = new SteamID(resp.client_supplied_steamid); this.EmailDomain = resp.email_domain; this.CellID = resp.cell_id; this.CellIDPingThreshold = resp.cell_id_ping_threshold; this.Steam2Ticket = resp.steam2_ticket; this.IPCountryCode = resp.ip_country_code; this.WebAPIUserNonce = resp.webapi_authenticate_user_nonce; this.UsePICS = resp.use_pics; this.VanityURL = resp.vanity_url; this.NumLoginFailuresToMigrate = resp.count_loginfailures_to_migrate; this.NumDisconnectsToMigrate = resp.count_disconnects_to_migrate; }
internal LoggedOnCallback(CMsgClientLogonResponse resp) #endif { this.Result = ( EResult )resp.eresult; this.ExtendedResult = ( EResult )resp.eresult_extended; this.OutOfGameSecsPerHeartbeat = resp.out_of_game_heartbeat_seconds; this.InGameSecsPerHeartbeat = resp.in_game_heartbeat_seconds; this.PublicIP = NetHelpers.GetIPAddress(resp.public_ip); this.ServerTime = Utils.DateTimeFromUnixTime(resp.rtime32_server_time); this.AccountFlags = ( EAccountFlags )resp.account_flags; this.ClientSteamID = new SteamID(resp.client_supplied_steamid); this.EmailDomain = resp.email_domain; this.CellID = resp.cell_id; if (resp.steam2_ticket != null) { this.Steam2Ticket = new Steam2Ticket(resp.steam2_ticket); } }
private async Task AutoLoginToFriends(CMsgClientLogonResponse response) { if (response.eresult == 1 && GetConfig <SteamNetworkConfig>().AutoLoginFriends&& SteamId.FromCommunityId(response.client_supplied_steamid).IsIndividualAccount) { await NetLog.InfoAsync("Logging into friends").ConfigureAwait(false); await SetPersonaStateAsync(PersonaState.Online).ConfigureAwait(false); } }
internal LoggedOnCallback(CMsgClientLogonResponse resp) { this.Result = ( EResult )resp.eresult; this.ExtendedResult = ( EResult )resp.eresult_extended; this.OutOfGameSecsPerHeartbeat = resp.legacy_out_of_game_heartbeat_seconds; this.InGameSecsPerHeartbeat = resp.heartbeat_seconds; this.PublicIP = resp.public_ip?.GetIPAddress(); this.ServerTime = DateUtils.DateTimeFromUnixTime(resp.rtime32_server_time); this.AccountFlags = ( EAccountFlags )resp.account_flags; this.ClientSteamID = new SteamID(resp.client_supplied_steamid); this.EmailDomain = resp.email_domain; this.CellID = resp.cell_id; this.CellIDPingThreshold = resp.cell_id_ping_threshold; this.Steam2Ticket = resp.steam2_ticket; this.IPCountryCode = resp.ip_country_code; this.WebAPIUserNonce = resp.webapi_authenticate_user_nonce; this.VanityURL = resp.vanity_url; this.NumLoginFailuresToMigrate = resp.count_loginfailures_to_migrate; this.NumDisconnectsToMigrate = resp.count_disconnects_to_migrate; if (resp.parental_settings != null) { using (var ms = new MemoryStream(resp.parental_settings)) { this.ParentalSettings = Serializer.Deserialize <ParentalSettings>(ms); } } }
internal LoggedOnCallback(SteamClient client, CMsgClientLogonResponse resp) : base(client)