From 853a9577560c4bd18b30f2cbc7ff0b311c608074 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Thu, 27 Sep 2018 17:35:20 +0200 Subject: [PATCH] Playtime goes before friends --- ArchiSteamFarm/Commands.cs | 20 ++++++++++---------- ArchiSteamFarm/Json/Steam.cs | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ArchiSteamFarm/Commands.cs b/ArchiSteamFarm/Commands.cs index 1f8c2f9d9..9780be06e 100644 --- a/ArchiSteamFarm/Commands.cs +++ b/ArchiSteamFarm/Commands.cs @@ -1586,8 +1586,8 @@ namespace ArchiSteamFarm { Steam.UserPrivacy.PrivacySettings.EPrivacySetting profile = Steam.UserPrivacy.PrivacySettings.EPrivacySetting.Private; Steam.UserPrivacy.PrivacySettings.EPrivacySetting ownedGames = Steam.UserPrivacy.PrivacySettings.EPrivacySetting.Private; - Steam.UserPrivacy.PrivacySettings.EPrivacySetting friendsList = Steam.UserPrivacy.PrivacySettings.EPrivacySetting.Private; Steam.UserPrivacy.PrivacySettings.EPrivacySetting playtime = Steam.UserPrivacy.PrivacySettings.EPrivacySetting.Private; + Steam.UserPrivacy.PrivacySettings.EPrivacySetting friendsList = Steam.UserPrivacy.PrivacySettings.EPrivacySetting.Private; Steam.UserPrivacy.PrivacySettings.EPrivacySetting inventory = Steam.UserPrivacy.PrivacySettings.EPrivacySetting.Private; Steam.UserPrivacy.PrivacySettings.EPrivacySetting inventoryGifts = Steam.UserPrivacy.PrivacySettings.EPrivacySetting.Private; Steam.UserPrivacy.ECommentPermission comments = Steam.UserPrivacy.ECommentPermission.Private; @@ -1610,20 +1610,20 @@ namespace ArchiSteamFarm { ownedGames = privacySetting; break; - case 2: // FriendsList, child of Profile - if (profile < privacySetting) { - return FormatBotResponse(string.Format(Strings.ErrorIsInvalid, nameof(ownedGames))); - } - - friendsList = privacySetting; - break; - case 3: // Playtime, child of OwnedGames + case 2: // Playtime, child of OwnedGames if (ownedGames < privacySetting) { return FormatBotResponse(string.Format(Strings.ErrorIsInvalid, nameof(playtime))); } playtime = privacySetting; break; + case 3: // FriendsList, child of Profile + if (profile < privacySetting) { + return FormatBotResponse(string.Format(Strings.ErrorIsInvalid, nameof(ownedGames))); + } + + friendsList = privacySetting; + break; case 4: // Inventory, child of Profile if (profile < privacySetting) { return FormatBotResponse(string.Format(Strings.ErrorIsInvalid, nameof(inventory))); @@ -1666,7 +1666,7 @@ namespace ArchiSteamFarm { } } - Steam.UserPrivacy userPrivacy = new Steam.UserPrivacy(new Steam.UserPrivacy.PrivacySettings(profile, ownedGames, friendsList, playtime, inventory, inventoryGifts), comments); + Steam.UserPrivacy userPrivacy = new Steam.UserPrivacy(new Steam.UserPrivacy.PrivacySettings(profile, ownedGames, playtime, friendsList, inventory, inventoryGifts), comments); return FormatBotResponse(await Bot.ArchiWebHandler.ChangePrivacySettings(userPrivacy).ConfigureAwait(false) ? Strings.Success : Strings.WarningFailed); } diff --git a/ArchiSteamFarm/Json/Steam.cs b/ArchiSteamFarm/Json/Steam.cs index 0362111c9..1b9a00eaf 100644 --- a/ArchiSteamFarm/Json/Steam.cs +++ b/ArchiSteamFarm/Json/Steam.cs @@ -634,15 +634,15 @@ namespace ArchiSteamFarm.Json { internal readonly EPrivacySetting Profile; // Constructed from privacy change request - internal PrivacySettings(EPrivacySetting profile, EPrivacySetting ownedGames, EPrivacySetting friendsList, EPrivacySetting playtime, EPrivacySetting inventory, EPrivacySetting inventoryGifts) { - if ((profile == EPrivacySetting.Unknown) || (ownedGames == EPrivacySetting.Unknown) || (friendsList == EPrivacySetting.Unknown) || (playtime == EPrivacySetting.Unknown) || (inventory == EPrivacySetting.Unknown) || (inventoryGifts == EPrivacySetting.Unknown)) { - throw new ArgumentNullException(nameof(profile) + " || " + nameof(ownedGames) + " || " + nameof(friendsList) + " || " + nameof(playtime) + " || " + nameof(inventory) + " || " + nameof(inventoryGifts)); + internal PrivacySettings(EPrivacySetting profile, EPrivacySetting ownedGames, EPrivacySetting playtime, EPrivacySetting friendsList, EPrivacySetting inventory, EPrivacySetting inventoryGifts) { + if ((profile == EPrivacySetting.Unknown) || (ownedGames == EPrivacySetting.Unknown) || (playtime == EPrivacySetting.Unknown) || (friendsList == EPrivacySetting.Unknown) || (inventory == EPrivacySetting.Unknown) || (inventoryGifts == EPrivacySetting.Unknown)) { + throw new ArgumentNullException(nameof(profile) + " || " + nameof(ownedGames) + " || " + nameof(playtime) + " || " + nameof(friendsList) + " || " + nameof(inventory) + " || " + nameof(inventoryGifts)); } Profile = profile; OwnedGames = ownedGames; - FriendsList = friendsList; Playtime = playtime; + FriendsList = friendsList; Inventory = inventory; InventoryGifts = inventoryGifts; }