From a581b2360e4f557d73fcd4ef1c340f15ed11f672 Mon Sep 17 00:00:00 2001 From: Fallen-ice <96802720+Fallen-ice@users.noreply.github.com> Date: Wed, 16 Oct 2024 14:57:01 +0800 Subject: [PATCH 1/8] Update Simplified Chinese to latest Update Simplified Chinese localization to latest version. --- Localization/Language/zh-CN.json | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/Localization/Language/zh-CN.json b/Localization/Language/zh-CN.json index a449254..863c090 100644 --- a/Localization/Language/zh-CN.json +++ b/Localization/Language/zh-CN.json @@ -92,6 +92,8 @@ "SAVE.TAG_D": "🔌", "SAVE.TAG_L": "💀", "SAVE.TAG_X": "❗", + "SAVE.TAG_B": "😇", + "SAVE.TAG_C": "✅", "SETTINGS.CHECK_UPDATE": "检查更新", "SETTINGS.OPEN_DATA_BTN": "数据", @@ -193,6 +195,17 @@ "SETTINGS.OSCDAMAGEDEVENT_EDIT": "(设置间隔时间)", "SETTINGS.OSCDAMAGEDEVENT_EDIT.TT": "设置从发送伤害事件到将其重置为0的时间间隔。(以毫秒为单位)", "SETTINGS.OSCDAMAGEDEVENT.TITLE": "设置伤害间隔", + "SETTINGS.OSCDEATHEVENT": "发送死亡事件", + "SETTINGS.OSCDEATHEVENT.TT": "向INT参数“ToN_DeathID”发送死亡事件。\n你可以使用此功能跟踪好友在游戏中的死亡时间。\n数字代表刚刚死亡的指定玩家名在列表中的位置,衰减时间结束后,该值将重置为0。", + "SETTINGS.OSCDEATHEVENT.TITLE": "设置玩家名称", + "SETTINGS.OSCDEATHEVENT_EDIT": "(编辑)", + "SETTINGS.OSCDEATHEVENT_EDIT.TT": "设置用于该参数的玩家名称列表。\n使用逗号(,)分隔不同的显示名称。", + "SETTINGS.OSCDEATHEVENT_DECAY": "(衰减)", + "SETTINGS.OSCDEATHEVENT_DECAY.TT": "设置将此值重置为0之前的等待时间(毫秒)。", + "SETTINGS.OSCDEATHEVENT_DECAY.TITLE": "设置衰减时间", + "SETTINGS.OSCDEATHEVENT_COOLDOWN": "(冷却)", + "SETTINGS.OSCDEATHEVENT_COOLDOWN.TT": "设置多名玩家连续死亡后,在设置该参数的ID值之前等待的时间(毫秒)。", + "SETTINGS.OSCDEATHEVENT_COOLDOWN.TITLE": "设置冷却时间", "SETTINGS.GROUP.NOTIFICATIONS": "通知", @@ -253,6 +266,7 @@ "OBJECTIVES.OMORI_PLUSH.TT": "在某物(Something)下存活。", "OBJECTIVES.PARADISE_LOST": "失乐园(Paradise Lost)", "OBJECTIVES.PARADISE_LOST.TT": "把使徒(Apostles)打得屁滚尿流。", + "OBJECTIVES.ITEM_SKIN_UNLOCKS": "物品皮肤解锁", "OBJECTIVES.RED_MEDKIT": "红色医疗箱(Red Medkit)", "OBJECTIVES.RED_MEDKIT.TT": "使用医疗箱(Medkit)在病毒(Virus)下存活。", @@ -284,6 +298,38 @@ "OBJECTIVES.TORCH_OF_OBSESSION": "痴迷的火炬(Torch Of Obsession)", "OBJECTIVES.TORCH_OF_OBSESSION.TT": "在寒夜(Cold Night)下存活。", + "OBJECTIVES.HAVE_PLUSH": "Have玩偶(Have Plush)", + "OBJECTIVES.HAVE_PLUSH.TT": "在观察者(The Observation)下存活。", + "OBJECTIVES.PORTABLE_SLOTS": "便携式老虎机(Portable Slots)", + "OBJECTIVES.PORTABLE_SLOTS.TT": "使用Have的神秘啤酒(Have's Mysterious Brew)在无束(Unbound)回合中存活。", + "OBJECTIVES.SOUL_VISITOR": "灵魂访客(Soul Visitor)", + "OBJECTIVES.SOUL_VISITOR.TT": "使用传送器(Teleporter)在无束(Unbound)回合中存活。", + "OBJECTIVES.DEFLECT_COIL": "偏折线圈(Deflect Coil)", + "OBJECTIVES.DEFLECT_COIL.TT": "使用再生线圈(Regen Coil)在变异(Alternate)回合中存活。", + "OBJECTIVES.ROOT_COIL": "根植线圈(Root Coil)", + "OBJECTIVES.ROOT_COIL.TT": "触摸草地。", + "OBJECTIVES.GHOST_BAT": "幽灵球棒(Ghost Bat)", + "OBJECTIVES.GHOST_BAT.TT": "使用金属球棒(Metal Bat)在幽灵(Ghost)回合中存活。", + "OBJECTIVES.BLOODY_CHARM": "血腥护身符(Bloody Charm)", + "OBJECTIVES.BLOODY_CHARM.TT": "使用银猫护身符(Silver Kat Charm)在血浴(Bloodbath)回合中存活。", + "OBJECTIVES.LUNA_CHARM": "月之护身符(Luna Charm)", + "OBJECTIVES.LUNA_CHARM.TT": "在奇美拉(Kimera)下存活。", + "OBJECTIVES.DESTROYER_COIL": "毁灭者线圈(Destroyer Coil)", + "OBJECTIVES.DESTROYER_COIL.TT": "使用螺旋线圈(Corkscrew Coil)在午夜(Midnight)回合中存活。", + "OBJECTIVES.BLOODY_REVOLVER": "血腥左轮手枪(Bloody Revolver)", + "OBJECTIVES.BLOODY_REVOLVER.TT": "使用古董左轮手枪(Antique Revolver)在血浴(Bloodbath)回合中存活。", + "OBJECTIVES.HAUNTED_HAMBURGER": "闹鬼汉堡(Haunted Hamburger)", + "OBJECTIVES.HAUNTED_HAMBURGER.TT": "使用汉堡(Hamburger)在幽灵(Ghost)回合中存活。", + + "OBJECTIVES.CLAW_MACHINE_UNLOCKS": "抓娃娃机解锁", + "OBJECTIVES.NORA_PLUSH": "Nora玩偶(Nora Plush)", + "OBJECTIVES.NORA_PLUSH.TT": "需要:Beyond玩偶(Beyond Plush)。", + "OBJECTIVES.ROBLANDER_PLUSH": "奇袭者玩偶(Roblander Plush)", + "OBJECTIVES.ROBLANDER_PLUSH.TT": "需要:深灰色玩偶(Darkgrey Plush)。", + "OBJECTIVES.OBSERVATION_PLUSH": "观察者玩偶(Observation Plush)", + "OBJECTIVES.OBSERVATION_PLUSH.TT": "需要:Have玩偶(Have Plush)。", + + "STATS.TITLE": "ToN统计跟踪", "STATS.SHOW_LOBBY": "显示房间统计", "STATS.SHOW_TOTAL": "显示全部统计", @@ -343,6 +389,8 @@ "STATS.LABEL_MAPORIGIN.TT": "显示该地图的来源。", "STATS.LABEL_ISALIVE": "是否存活", "STATS.LABEL_ISALIVE.TT": "如果玩家在当前回合中还活着,则为 True。", + "STATS.LABEL_ISREBORN": "是否复活", + "STATS.LABEL_ISREBORN.TT": "如果玩家在当前回合中使用麦克斯韦(Maxwell)复活过,则为True。", "STATS.LABEL_ISSTARTED": "是否开始", "STATS.LABEL_ISSTARTED.TT": "如果一轮回合已开始并正在进行,则为True。", "STATS.LABEL_INSTANCEURL": "房间链接", From 87f5a77c814d91ab5df90e60993d5e4579640915 Mon Sep 17 00:00:00 2001 From: Kittenji <41535779+ChrisFeline@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:15:24 -0400 Subject: [PATCH 2/8] Update Updater.cs --- Updater.cs | 66 +++++------------------------------------------------- 1 file changed, 6 insertions(+), 60 deletions(-) diff --git a/Updater.cs b/Updater.cs index a49fc2c..f7d38d7 100644 --- a/Updater.cs +++ b/Updater.cs @@ -9,57 +9,6 @@ internal static class Updater { [return: MarshalAs(UnmanagedType.Bool)] static extern bool AllocConsole(); - internal class UpdateProgressBar : IProgress { - string start = "["; - string end = "]"; - char fill = '#'; - char back = '-'; - - int top = 0; - int left = 0; - int length = 0; - - int full_len = 0; - - string final = "Done."; - - internal UpdateProgressBar (int length = 20) { - this.top = Console.CursorTop; - this.left = Console.CursorLeft; - this.length = length; - } - - public void Start() { - Console.CursorVisible = false; - } - - public void Report(float value) { - lock (start) { - Console.SetCursorPosition(left, top); - - - int c = (int)Math.Round(value * length); - Console.Write(start); - Console.Write(new string(fill, c).PadRight(length, back)); - Console.Write(end); - Console.Write(' '); - - float percent = value * 100; - Console.Write(percent.ToString("0.00").PadLeft(6, ' ')); - Console.Write('%'); - - full_len = Console.CursorLeft - left; - } - } - - public void Done() { - Report(1); - Console.SetCursorPosition(left, top); - Console.WriteLine((start + final + end).PadRight(full_len)); - Console.CursorVisible = true; - } - } - const string POST_UPDATE_ARG = "--clean-update"; internal static void Start(GitHubRelease release, GitHubRelease.Asset asset) { AllocConsole(); @@ -75,20 +24,15 @@ internal static void Start(GitHubRelease release, GitHubRelease.Asset asset) { Console.Write($"Downloading '{asset.name}' . . . "); - UpdateProgressBar progress = new UpdateProgressBar(); - progress.Start(); string downloadUrl = asset.browser_download_url; - using (HttpClient client = new HttpClient()) { - client.Timeout = TimeSpan.FromMinutes(5); - - using (var file = new FileStream(TempFileLocation, FileMode.Create, FileAccess.Write, FileShare.None)) { - client.Download(downloadUrl, file, progress); + using (var s = client.GetStreamAsync(downloadUrl).Result) { + using (var fs = new FileStream(TempFileLocation, FileMode.CreateNew)) { + s.CopyTo(fs); + } } } - progress.Done(); - // Move current executable Logger.Info("Moving from: " + Program.ProgramLocation); Logger.Info("Moving to: " + Program.ProgramLocationTemporary); @@ -210,6 +154,7 @@ static void CopyTo(this Stream source, Stream destination, int bufferSize, IProg } } + /* static void Download(this HttpClient client, string requestUri, Stream destination, IProgress? progress = null) { // Get the http headers first to examine the content length using (var response = client.GetAsync(requestUri, HttpCompletionOption.ResponseHeadersRead).Result) { @@ -232,6 +177,7 @@ static void Download(this HttpClient client, string requestUri, Stream destinati } } } + */ #endregion } } From 571e0c3a70c91194b15dc32bc828b37408e98f68 Mon Sep 17 00:00:00 2001 From: Kittenji <41535779+ChrisFeline@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:18:19 -0400 Subject: [PATCH 3/8] Remove Message Box --- CHANGELOG.md | 12 +----------- Updater.cs | 49 +------------------------------------------------ 2 files changed, 2 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cb666e..273bfa8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,4 @@ # Latest Changelog -- New items added to the Objectives window. Have fun! -- Added new OSC configurable parameter 'ToN_DeathID' - - With this parameter, you can set a list of friends and you will receive OSC events when they die in a round. -- Added new OSC parameter 'ToN_Reborn' - - This parameter is set to true when you get reborn using Maxwell. - - Added event to WebSocket API: 'REBORN' -- 'Auto Copy On Join' only works when you join a ToN lobby now. -- Updated OSC docs for items to reveal more item IDs. -- Finally fixed Double Trouble colors for OSC. - -- Added Italian localization (Thank you @TheIceDragonz) +- Fixed the False Positives with the two only free Anti Viruses. - Updated Simplified Chinese localization (Thank you @Fallen-ice) \ No newline at end of file diff --git a/Updater.cs b/Updater.cs index f7d38d7..289df4f 100644 --- a/Updater.cs +++ b/Updater.cs @@ -124,7 +124,7 @@ internal static void CheckPostUpdate(string[] args) { } Logger.Info("Post-update success."); - MessageBox.Show("Successfully updated to version " + Program.GetVersion(), Program.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Information); + // MessageBox.Show("Successfully updated to version " + Program.GetVersion(), Program.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { Logger.Error("Failed to run post-update."); Logger.Error(ex); @@ -132,52 +132,5 @@ internal static void CheckPostUpdate(string[] args) { MessageBox.Show("Failed to run post-update.\nPlease report this issue on the GitHub page.\n\n" + ex, "Update Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } - - #region Extensions - static void CopyTo(this Stream source, Stream destination, int bufferSize, IProgress? progress = null) { - ArgumentNullException.ThrowIfNull(source); - ArgumentNullException.ThrowIfNull(destination); - ArgumentOutOfRangeException.ThrowIfNegative(bufferSize); - - if (!source.CanRead) - throw new ArgumentException("Has to be readable", nameof(source)); - if (!destination.CanWrite) - throw new ArgumentException("Has to be writable", nameof(destination)); - - var buffer = new byte[bufferSize]; - long totalBytesRead = 0; - int bytesRead; - while ((bytesRead = source.Read(buffer, 0, buffer.Length)) != 0) { - destination.Write(buffer, 0, bytesRead); - totalBytesRead += bytesRead; - progress?.Report(totalBytesRead); - } - } - - /* - static void Download(this HttpClient client, string requestUri, Stream destination, IProgress? progress = null) { - // Get the http headers first to examine the content length - using (var response = client.GetAsync(requestUri, HttpCompletionOption.ResponseHeadersRead).Result) { - var contentLength = response.Content.Headers.ContentLength; - - using (var download = response.Content.ReadAsStream()) { - - // Ignore progress reporting when no progress reporter was - // passed or when the content length is unknown - if (progress == null || !contentLength.HasValue) { - download.CopyTo(destination); - return; - } - - // Convert absolute progress (bytes downloaded) into relative progress (0% - 100%) - var relativeProgress = new Progress(totalBytes => progress.Report((float)totalBytes / contentLength.Value)); - // Use extension method to report progress while downloading - download.CopyTo(destination, 81920, relativeProgress); - progress.Report(1); - } - } - } - */ - #endregion } } From 51613eb44498b1463031620a24f19622110e29a5 Mon Sep 17 00:00:00 2001 From: Kittenji <41535779+ChrisFeline@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:20:37 -0400 Subject: [PATCH 4/8] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 273bfa8..9ee1c8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ # Latest Changelog -- Fixed the False Positives with the two only free Anti Viruses. +- Attempting to fix the False Positives with the two only FREE Anti Viruses. - Updated Simplified Chinese localization (Thank you @Fallen-ice) \ No newline at end of file From ecf0e68118343a5da94639089bf3ebb464851b00 Mon Sep 17 00:00:00 2001 From: Kittenji <41535779+ChrisFeline@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:20:49 -0400 Subject: [PATCH 5/8] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ee1c8b..0be5c21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # Latest Changelog - Attempting to fix the False Positives with the two only FREE Anti Viruses. -- Updated Simplified Chinese localization (Thank you @Fallen-ice) \ No newline at end of file +- Updated Simplified Chinese localization (Thank you @Fallen-ice) +- I always knew. \ No newline at end of file From 591f3a89bc0116af245d36ad388bd0f53dea9a36 Mon Sep 17 00:00:00 2001 From: Kittenji <41535779+ChrisFeline@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:41:24 -0400 Subject: [PATCH 6/8] Update Updater.cs --- Updater.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Updater.cs b/Updater.cs index 289df4f..65270bc 100644 --- a/Updater.cs +++ b/Updater.cs @@ -11,6 +11,7 @@ internal static class Updater { const string POST_UPDATE_ARG = "--clean-update"; internal static void Start(GitHubRelease release, GitHubRelease.Asset asset) { + /* AllocConsole(); Console.Title = "ToNSaveManager - Updating " + release.name; @@ -66,6 +67,7 @@ internal static void Start(GitHubRelease release, GitHubRelease.Asset asset) { if (File.Exists(Program.ProgramLocationTemporary)) { File.Move(Program.ProgramLocationTemporary, Program.ProgramLocation, true); } + */ } const string LEGACY_POST_UPDATE_ARG = "--post-update"; From 1cacdb411df98e506a18861b49115f244d7c857c Mon Sep 17 00:00:00 2001 From: Kittenji <41535779+ChrisFeline@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:56:45 -0400 Subject: [PATCH 7/8] Update Updater.cs --- Updater.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Updater.cs b/Updater.cs index 65270bc..289df4f 100644 --- a/Updater.cs +++ b/Updater.cs @@ -11,7 +11,6 @@ internal static class Updater { const string POST_UPDATE_ARG = "--clean-update"; internal static void Start(GitHubRelease release, GitHubRelease.Asset asset) { - /* AllocConsole(); Console.Title = "ToNSaveManager - Updating " + release.name; @@ -67,7 +66,6 @@ internal static void Start(GitHubRelease release, GitHubRelease.Asset asset) { if (File.Exists(Program.ProgramLocationTemporary)) { File.Move(Program.ProgramLocationTemporary, Program.ProgramLocation, true); } - */ } const string LEGACY_POST_UPDATE_ARG = "--post-update"; From fa433a754c333dc940b3c72822ab0ed2b53422c7 Mon Sep 17 00:00:00 2001 From: Kittenji <41535779+ChrisFeline@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:57:34 -0400 Subject: [PATCH 8/8] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0be5c21..4f7de99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # Latest Changelog -- Attempting to fix the False Positives with the two only FREE Anti Viruses. +- Attempting to fix the False Positives with the two only FREE Anti Viruses. (Avast and AVG) again... - Updated Simplified Chinese localization (Thank you @Fallen-ice) - I always knew. \ No newline at end of file