From 50a87e184bb3446a0571c3a8a98f07829c80796e Mon Sep 17 00:00:00 2001 From: Ege Bilecen Date: Thu, 22 Dec 2022 22:18:14 +0300 Subject: [PATCH 1/3] added workshop item id logging when running mod update checker schedule --- localization/default.json | 3 +++ src/Bot/Commands/AdminCommands.cs | 1 + src/Bot/Util/SteamWebAPI.cs | 2 ++ 3 files changed, 6 insertions(+) diff --git a/localization/default.json b/localization/default.json index 4d61441..f047447 100644 --- a/localization/default.json +++ b/localization/default.json @@ -81,6 +81,9 @@ "disc_cmd_localization_not_found": "Couldn't find **{localization}** localization!", "disc_cmd_localization_download_fail": "Couldn't download localization! Please try again later...", "disc_cmd_localization_update_text": "There is a new version for **{localization}** ({version})! Please use `!localization {localization}` command to update.", + "disc_cmd_localization_avaib_list": "Available localization list:", + "disc_cmd_localization_usage": "Please use `!localization ` command to update current localization. You can set localization back to default by using `!localization default` command.", + "disc_cmd_localization_no_localization": "There are no other available localizations at the moment.", "disc_cmd_start_server_warn_running": "Server is already running.", "disc_cmd_start_server_warn_backup": "Cannot start the server during backup in progress. Please wait until backup finishes.", "disc_cmd_start_server_ok": "Server should be on it's way to get started. This process may take a while. Please check the server status in 1 or 2 minute(s).", diff --git a/src/Bot/Commands/AdminCommands.cs b/src/Bot/Commands/AdminCommands.cs index 55f1e16..bfd1542 100644 --- a/src/Bot/Commands/AdminCommands.cs +++ b/src/Bot/Commands/AdminCommands.cs @@ -13,5 +13,6 @@ public class AdminCommands : ModuleBase public async Task Debug(string param1="", string param2="", string param3="") { await Context.Message.AddReactionAsync(EmojiList.GreenCheck); + await SteamWebAPI.GetWorkshopItemDetails(new string[] { }); } } diff --git a/src/Bot/Util/SteamWebAPI.cs b/src/Bot/Util/SteamWebAPI.cs index 8b11c34..79cfd3f 100644 --- a/src/Bot/Util/SteamWebAPI.cs +++ b/src/Bot/Util/SteamWebAPI.cs @@ -85,8 +85,10 @@ public class WorkshopItemDetails { JArray workshopItems = (JArray)jsonData["publishedfiledetails"]; + int i=-1; foreach(JToken elem in workshopItems) { + Logger.WriteLog($"SteamWebAPI.GetWorkshopItemDetails() - Workshop Item ID: {idList[++i]}"); Model.WorkshopItemDetails itemDetails = elem.ToObject(); itemDetailsList.Add(itemDetails); } From 34da2debc15099cfc84fd0b6bcf87f41e72c812a Mon Sep 17 00:00:00 2001 From: Ege Bilecen Date: Fri, 23 Dec 2022 03:40:31 +0300 Subject: [PATCH 2/3] fixed issue in workshop mod update checked: "Could not convert to integer" --- src/Bot/Util/SteamWebAPI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bot/Util/SteamWebAPI.cs b/src/Bot/Util/SteamWebAPI.cs index 79cfd3f..f1b0207 100644 --- a/src/Bot/Util/SteamWebAPI.cs +++ b/src/Bot/Util/SteamWebAPI.cs @@ -27,7 +27,7 @@ public class WorkshopItemDetails public int ConsumerAppId; public string FileName; [JsonProperty("file_size")] - public int FileSize; + public long FileSize; [JsonProperty("file_url")] public string FileURL; [JsonProperty("hcontent_file")] From cbf9c34300c77e487f51fa85b7f5840e3f61ec9f Mon Sep 17 00:00:00 2001 From: Ege Bilecen Date: Fri, 23 Dec 2022 03:43:38 +0300 Subject: [PATCH 3/3] updated version to 1.8.1 --- src/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Program.cs b/src/Program.cs index b6470d8..46273b3 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -13,7 +13,7 @@ public static class Application { public const string BotRepoURL = "https://github.com/egebilecen/PZServerDiscordBot"; - public static readonly SemanticVersion BotVersion = new SemanticVersion(1, 8, 0, DevelopmentStage.Release); + public static readonly SemanticVersion BotVersion = new SemanticVersion(1, 8, 1, DevelopmentStage.Release); public static Settings.BotSettings BotSettings; public static DiscordSocketClient Client;