First set of fixes

This commit is contained in:
JustArchi
2016-12-04 05:50:11 +01:00
parent 2147aed1d4
commit 2165818e25
6 changed files with 9 additions and 7 deletions

View File

@@ -56,12 +56,13 @@ namespace ArchiSteamFarm {
internal readonly ArchiWebHandler ArchiWebHandler;
internal readonly string BotName;
internal bool HasMobileAuthenticator => BotDatabase.MobileAuthenticator != null;
internal bool IsConnectedAndLoggedOn => SteamClient.IsConnected && (SteamClient.SteamID != null);
internal bool HasMobileAuthenticator => BotDatabase?.MobileAuthenticator != null;
internal bool HasValidApiKey => !string.IsNullOrEmpty(BotConfig?.SteamApiKey) && (BotConfig.SteamApiKey.Length == 32);
internal bool IsConnectedAndLoggedOn => (SteamClient?.IsConnected == true) && (SteamClient.SteamID != null);
internal bool IsPlayingPossible => !PlayingBlocked && (LibraryLockedBySteamID == 0);
[JsonProperty]
internal ulong SteamID => SteamClient.SteamID ?? 0;
internal ulong SteamID => SteamClient?.SteamID ?? 0;
private readonly BotDatabase BotDatabase;
private readonly CallbackManager CallbackManager;
@@ -1713,7 +1714,7 @@ namespace ArchiSteamFarm {
}
Dictionary<uint, string> ownedGames;
if (!string.IsNullOrEmpty(BotConfig.SteamApiKey)) {
if (HasValidApiKey) {
ownedGames = ArchiWebHandler.GetOwnedGames(SteamClient.SteamID);
} else {
ownedGames = await ArchiWebHandler.GetOwnedGames().ConfigureAwait(false);