From 8edbe3321aa39f6c65770976c6988b6346a79838 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Mon, 2 Jan 2017 19:59:33 +0100 Subject: [PATCH] Goodbye Steam Sale Keeping core around for eventual next one --- ArchiSteamFarm/ArchiWebHandler.cs | 10 ++++++++++ ArchiSteamFarm/Bot.cs | 6 +++--- ArchiSteamFarm/JSON/Steam.cs | 2 ++ ArchiSteamFarm/SteamSaleEvent.cs | 30 ++++++++++++++++++++++++++++-- ArchiSteamFarm/Utilities.cs | 4 +++- 5 files changed, 46 insertions(+), 6 deletions(-) diff --git a/ArchiSteamFarm/ArchiWebHandler.cs b/ArchiSteamFarm/ArchiWebHandler.cs index abf583ec6..54a976877 100644 --- a/ArchiSteamFarm/ArchiWebHandler.cs +++ b/ArchiSteamFarm/ArchiWebHandler.cs @@ -127,6 +127,7 @@ namespace ArchiSteamFarm { return htmlDocument?.DocumentNode.SelectSingleNode("//div[@class='add_free_content_success_area']") != null; } + /* internal async Task ClearFromDiscoveryQueue(uint appID) { if (appID == 0) { Bot.ArchiLogger.LogNullError(nameof(appID)); @@ -151,6 +152,7 @@ namespace ArchiSteamFarm { return await WebBrowser.UrlPostRetry(request, data).ConfigureAwait(false); } + */ internal void DeclineTradeOffer(ulong tradeID) { if ((tradeID == 0) || string.IsNullOrEmpty(Bot.BotConfig.SteamApiKey)) { @@ -180,6 +182,7 @@ namespace ArchiSteamFarm { } } + /* internal async Task> GenerateNewDiscoveryQueue() { if (!await RefreshSessionIfNeeded().ConfigureAwait(false)) { return null; @@ -200,6 +203,7 @@ namespace ArchiSteamFarm { Steam.NewDiscoveryQueueResponse output = await WebBrowser.UrlPostToJsonResultRetry(request, data).ConfigureAwait(false); return output?.Queue; } + */ internal HashSet GetActiveTradeOffers() { if (string.IsNullOrEmpty(Bot.BotConfig.SteamApiKey)) { @@ -360,6 +364,7 @@ namespace ArchiSteamFarm { return await WebBrowser.UrlGetToHtmlDocumentRetry(request).ConfigureAwait(false); } + /* internal async Task GetDiscoveryQueuePage() { if (!await RefreshSessionIfNeeded().ConfigureAwait(false)) { return null; @@ -368,6 +373,7 @@ namespace ArchiSteamFarm { const string request = SteamStoreURL + "/explore?l=english"; return await WebBrowser.UrlGetToHtmlDocumentRetry(request).ConfigureAwait(false); } + */ internal async Task> GetFamilySharingSteamIDs() { if (!await RefreshSessionIfNeeded().ConfigureAwait(false)) { @@ -649,6 +655,7 @@ namespace ArchiSteamFarm { return 0; } + /* internal async Task GetSteamAwardsPage() { if (!await RefreshSessionIfNeeded().ConfigureAwait(false)) { return null; @@ -657,6 +664,7 @@ namespace ArchiSteamFarm { const string request = SteamStoreURL + "/SteamAwards?l=english"; return await WebBrowser.UrlGetToHtmlDocumentRetry(request).ConfigureAwait(false); } + */ internal async Task GetTradeHoldDuration(ulong tradeID) { if (tradeID == 0) { @@ -952,6 +960,7 @@ namespace ArchiSteamFarm { return true; } + /* internal async Task SteamAwardsVote(byte voteID, uint appID) { if ((voteID == 0) || (appID == 0)) { Bot.ArchiLogger.LogNullError(nameof(voteID) + " || " + nameof(appID)); @@ -977,6 +986,7 @@ namespace ArchiSteamFarm { return await WebBrowser.UrlPostRetry(request, data).ConfigureAwait(false); } + */ private static uint GetAppIDFromMarketHashName(string hashName) { if (string.IsNullOrEmpty(hashName)) { diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index cc8e0d053..66e8f172a 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -82,7 +82,7 @@ namespace ArchiSteamFarm { private readonly SteamClient SteamClient; private readonly ConcurrentHashSet SteamFamilySharingIDs = new ConcurrentHashSet(); private readonly SteamFriends SteamFriends; - private readonly SteamSaleEvent SteamSaleEvent; + //private readonly SteamSaleEvent SteamSaleEvent; private readonly SteamUser SteamUser; private readonly Trading Trading; @@ -208,7 +208,7 @@ namespace ArchiSteamFarm { CardsFarmer = new CardsFarmer(this); CardsFarmer.SetInitialState(BotConfig.Paused); - SteamSaleEvent = new SteamSaleEvent(this); + //SteamSaleEvent = new SteamSaleEvent(this); Trading = new Trading(this); if (Program.GlobalConfig.Statistics) { @@ -235,7 +235,7 @@ namespace ArchiSteamFarm { InitializationSemaphore.Dispose(); SteamFamilySharingIDs.Dispose(); OwnedPackageIDs.Dispose(); - SteamSaleEvent.Dispose(); + //SteamSaleEvent.Dispose(); Trading.Dispose(); // Those are objects that might be null and the check should be in-place diff --git a/ArchiSteamFarm/JSON/Steam.cs b/ArchiSteamFarm/JSON/Steam.cs index 63d8a4203..6de6365ca 100644 --- a/ArchiSteamFarm/JSON/Steam.cs +++ b/ArchiSteamFarm/JSON/Steam.cs @@ -368,6 +368,7 @@ namespace ArchiSteamFarm.JSON { } } + /* [SuppressMessage("ReSharper", "ClassCannotBeInstantiated")] [SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")] internal sealed class NewDiscoveryQueueResponse { // Deserialized from JSON @@ -378,6 +379,7 @@ namespace ArchiSteamFarm.JSON { private NewDiscoveryQueueResponse() { } } + */ [SuppressMessage("ReSharper", "ClassCannotBeInstantiated")] [SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")] diff --git a/ArchiSteamFarm/SteamSaleEvent.cs b/ArchiSteamFarm/SteamSaleEvent.cs index c44d43f60..61fa4e9a4 100644 --- a/ArchiSteamFarm/SteamSaleEvent.cs +++ b/ArchiSteamFarm/SteamSaleEvent.cs @@ -1,4 +1,29 @@ -using System; +/* + _ _ _ ____ _ _____ + / \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___ + / _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \ + / ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | | +/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_| + + Copyright 2015-2016 Łukasz "JustArchi" Domeradzki + Contact: JustArchi@JustArchi.net + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +/* +using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -157,4 +182,5 @@ namespace ArchiSteamFarm { } } } -} \ No newline at end of file +} +*/ \ No newline at end of file diff --git a/ArchiSteamFarm/Utilities.cs b/ArchiSteamFarm/Utilities.cs index 7f2a93009..7c3af4867 100644 --- a/ArchiSteamFarm/Utilities.cs +++ b/ArchiSteamFarm/Utilities.cs @@ -31,7 +31,7 @@ using System.Text; namespace ArchiSteamFarm { internal static class Utilities { - private static readonly Random Random = new Random(); + //private static readonly Random Random = new Random(); [MethodImpl(MethodImplOptions.AggressiveInlining)] [SuppressMessage("ReSharper", "UnusedParameter.Global")] @@ -58,6 +58,7 @@ namespace ArchiSteamFarm { internal static uint GetUnixTime() => (uint) DateTimeOffset.Now.ToUnixTimeSeconds(); + /* internal static int RandomNext(int maxWithout) { if (maxWithout <= 0) { Program.ArchiLogger.LogNullError(nameof(maxWithout)); @@ -72,6 +73,7 @@ namespace ArchiSteamFarm { return Random.Next(maxWithout); } } + */ internal static string ToHumanReadable(this TimeSpan timeSpan) { // It's really dirty, I'd appreciate a lot if C# offered nice TimeSpan formatting by default