From d07d82438f13ff54d9c5936309b63620bb32b5a1 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Fri, 1 Dec 2017 00:49:19 +0100 Subject: [PATCH] Update ENotification According to https://github.com/SteamRE/SteamKit/issues/493 --- ArchiSteamFarm/ArchiHandler.cs | 23 ++++++++++++++++------- ArchiSteamFarm/Bot.cs | 6 ------ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/ArchiSteamFarm/ArchiHandler.cs b/ArchiSteamFarm/ArchiHandler.cs index 5832848da..7aa35e2f9 100644 --- a/ArchiSteamFarm/ArchiHandler.cs +++ b/ArchiSteamFarm/ArchiHandler.cs @@ -21,11 +21,13 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Net; using System.Threading.Tasks; using ArchiSteamFarm.CMsgs; +using ArchiSteamFarm.Localization; using SteamKit2; using SteamKit2.Internal; @@ -272,7 +274,7 @@ namespace ArchiSteamFarm { ENotification type = (ENotification) notification.user_notification_type; if (type == ENotification.Unknown) { - ASF.ArchiLogger.LogNullError(nameof(notification.user_notification_type)); + ASF.ArchiLogger.LogGenericWarning(string.Format(Strings.WarningUnknownValuePleaseReport, nameof(type), type)); continue; } @@ -289,13 +291,20 @@ namespace ArchiSteamFarm { Notifications = new Dictionary(1) { { ENotification.Items, msg.count_new_items } }; } + [SuppressMessage("ReSharper", "UnusedMember.Global")] internal enum ENotification : byte { - Unknown = 0, - Trading = 1, - Unknown10 = 10, // TODO: This was mentioned as a possibility by one user, but I didn't check yet what 10 stands for - - // Only custom below, different than ones available as user_notification_type - Items = 255 + Unknown, + Trading, + GameTurns, + ModeratorMessages, + Comments, + Items, + Invites, + Unknown7, // No clue what 7 stands for, and I doubt we can find out + Gifts, + Chat, + HelpRequestReplies, + AccountAlerts } } diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 81c786b1a..3549205a3 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -2070,12 +2070,6 @@ namespace ArchiSteamFarm { Trading.OnNewTrade().Forget(); } - break; - // Notifications we're not really interested in, but still valid - case ArchiHandler.NotificationsCallback.ENotification.Unknown10: - break; - default: - ASF.ArchiLogger.LogGenericWarning(string.Format(Strings.WarningUnknownValuePleaseReport, nameof(notification.Key), notification.Key)); break; } }