From 3955cd96d1f3dc8a130beb0005896fb62a743781 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Wed, 3 Jul 2019 00:54:12 +0200 Subject: [PATCH] Make owns types case-insensitive --- ArchiSteamFarm/Commands.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ArchiSteamFarm/Commands.cs b/ArchiSteamFarm/Commands.cs index 879acd9e6..281657a0e 100644 --- a/ArchiSteamFarm/Commands.cs +++ b/ArchiSteamFarm/Commands.cs @@ -1640,15 +1640,15 @@ namespace ArchiSteamFarm { type = entry.Substring(0, index); } else if (uint.TryParse(entry, out uint appID) && (appID > 0)) { game = entry; - type = "app"; + type = "APP"; } else { game = entry; - type = "name"; + type = "NAME"; } - switch (type) { - case "a" when uint.TryParse(game, out uint appID) && (appID > 0): - case "app" when uint.TryParse(game, out appID) && (appID > 0): + switch (type.ToUpperInvariant()) { + case "A" when uint.TryParse(game, out uint appID) && (appID > 0): + case "APP" when uint.TryParse(game, out appID) && (appID > 0): HashSet packageIDs = ASF.GlobalDatabase.GetPackageIDs(appID, Bot.OwnedPackageIDs.Keys); if ((packageIDs != null) && (packageIDs.Count > 0)) { @@ -1679,8 +1679,8 @@ namespace ArchiSteamFarm { } break; - case "r": - case "regex": + case "R": + case "REGEX": Regex regex; try { @@ -1716,8 +1716,8 @@ namespace ArchiSteamFarm { } continue; - case "s" when uint.TryParse(game, out uint packageID) && (packageID > 0): - case "sub" when uint.TryParse(game, out packageID) && (packageID > 0): + case "S" when uint.TryParse(game, out uint packageID) && (packageID > 0): + case "SUB" when uint.TryParse(game, out packageID) && (packageID > 0): if (Bot.OwnedPackageIDs.ContainsKey(packageID)) { result["sub/" + packageID] = null; response.AppendLine(FormatBotResponse(string.Format(Strings.BotOwnedAlready, "sub/" + packageID)));