From 71c2e54afd81f29d929e13224b2258b8fc48bf13 Mon Sep 17 00:00:00 2001 From: Evil Factory <36804725+evilfactory@users.noreply.github.com> Date: Mon, 29 Dec 2025 11:52:35 -0300 Subject: [PATCH] Remove CheckUpdate --- .../BarotraumaClient/ClientSource/GameMain.cs | 3 - .../ClientSource/LuaCs/LuaCsInstaller.cs | 68 ------------------- 2 files changed, 71 deletions(-) diff --git a/Barotrauma/BarotraumaClient/ClientSource/GameMain.cs b/Barotrauma/BarotraumaClient/ClientSource/GameMain.cs index 92b024ed0..874de92fc 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/GameMain.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/GameMain.cs @@ -636,9 +636,6 @@ namespace Barotrauma HasLoaded = true; log("LOADING COROUTINE FINISHED"); -#if CLIENT - LuaCsInstaller.CheckUpdate(); -#endif contentLoaded = true; while (postContentLoadActions.TryDequeue(out Action action)) diff --git a/Barotrauma/BarotraumaClient/ClientSource/LuaCs/LuaCsInstaller.cs b/Barotrauma/BarotraumaClient/ClientSource/LuaCs/LuaCsInstaller.cs index 490ce38d1..4a7f9fdea 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/LuaCs/LuaCsInstaller.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/LuaCs/LuaCsInstaller.cs @@ -54,73 +54,5 @@ namespace Barotrauma return true; }; } - - public static void CheckUpdate() - { - throw new NotImplementedException(); - /*// TODO: Rewrite this to not rely on LuaCsSetup. - - if (!File.Exists(LuaCsSetup.VersionFile)) { return; } - - ContentPackage luaPackage = LuaCsSetup.GetPackage(new SteamWorkshopId(GameMain.LuaCs.LuaForBarotraumaSteamId?.Value ?? 0)); - - if (luaPackage == null) { return; } - - string luaCsPath = Path.GetDirectoryName(luaPackage.Path); - string clientVersion = File.ReadAllText(LuaCsSetup.VersionFile); - string workshopVersion = luaPackage.ModVersion; - - if (clientVersion == workshopVersion || File.Exists("debugsomething")) { return; } - - var msg = new GUIMessageBox($"LuaCs Update", $"Your LuaCs client version is different from the version found in the LuaCsForBarotrauma workshop files. Do you want to update?\n\n Client Version: {clientVersion}\n Workshop Version: {workshopVersion}", - new LocalizedString[2] { TextManager.Get("Yes"), TextManager.Get("Cancel") }); - - msg.Buttons[0].OnClicked = (GUIButton button, object obj) => - { - string[] filesToUpdate = trackingFiles.Concat(Directory.EnumerateFiles(luaCsPath, "*.dll", SearchOption.AllDirectories) - .Where(s => s.Contains("mscordaccore_amd64_amd64")).Select(s => Path.GetFileName(s))).ToArray(); - - try - { - CreateMissingDirectory(); - - foreach (string file in filesToUpdate) - { - try - { - File.Move(file, "Temp/Old/" + file, true); - File.Copy(Path.Combine(luaCsPath, "Binary", file), file, true); - } - catch (Exception e) - { - DebugConsole.ThrowError($"Failed to update file {e}"); - } - - } - - File.WriteAllText(LuaCsSetup.VersionFile, workshopVersion); - } - catch (Exception e) - { - new GUIMessageBox("Failed", $"Failed to update, error: {e}"); - - msg.Close(); - return true; - } - - new GUIMessageBox("Restart", $"LuaCs updated! Restart your game to apply the changes."); - - msg.Close(); - return true; - }; - - msg.Buttons[1].OnClicked = (GUIButton button, object obj) => - { - msg.Close(); - return true; - }; - */ - - } } }