diff --git a/Barotrauma/BarotraumaClient/ClientSource/LuaCs/LuaCsInstaller.cs b/Barotrauma/BarotraumaClient/ClientSource/LuaCs/LuaCsInstaller.cs index 4a7f9fdea..68fa823c7 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/LuaCs/LuaCsInstaller.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/LuaCs/LuaCsInstaller.cs @@ -8,51 +8,7 @@ namespace Barotrauma { public static void Uninstall() { - if (!File.Exists("Temp/Original/Barotrauma.dll")) - { - new GUIMessageBox("Error", "Error: Temp/Original/Barotrauma.dll not found, Github version? Use Steam validate files instead."); - return; - } - - var msg = new GUIMessageBox("Confirm", "Are you sure you want to remove Client-Side LuaCs?", new LocalizedString[2] { TextManager.Get("Yes"), TextManager.Get("Cancel") }); - - msg.Buttons[0].OnClicked = (GUIButton button, object obj) => - { - msg.Close(); - - string[] filesToRemove = new string[] - { - "Barotrauma.dll", "Barotrauma.deps.json", "Barotrauma.pdb", "BarotraumaCore.dll", "BarotraumaCore.pdb", - "System.Reflection.Metadata.dll", "System.Collections.Immutable.dll", - "System.Runtime.CompilerServices.Unsafe.dll" - }; - try - { - CreateMissingDirectory(); - - foreach (string file in filesToRemove) - { - File.Move(file, "Temp/ToDelete/" + file, true); - File.Move("Temp/Original/" + file, file, true); - } - } - catch (Exception e) - { - new GUIMessageBox("Error", $"{e} {e.InnerException} \nTry verifying files instead."); - return false; - } - - new GUIMessageBox("Restart", "Restart your game to apply the changes. If the mod continues to stay active after the restart, try verifying games instead."); - - return true; - }; - - msg.Buttons[1].OnClicked = (GUIButton button, object obj) => - { - msg.Close(); - return true; - }; } } } diff --git a/Barotrauma/BarotraumaServer/ServerSource/LuaCs/LuaCsInstaller.cs b/Barotrauma/BarotraumaServer/ServerSource/LuaCs/LuaCsInstaller.cs index a75ada38e..82081bd8b 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/LuaCs/LuaCsInstaller.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/LuaCs/LuaCsInstaller.cs @@ -9,13 +9,11 @@ namespace Barotrauma { public static void Install() { - throw new NotImplementedException(); - // TODO: Refactor the installer to not be dependent on LuaCsSetup. - /*ContentPackage luaPackage = LuaCsSetup.GetPackage(); + ContentPackage luaPackage = LuaCsSetup.GetLuaCsPackage(); if (luaPackage == null) { - GameMain.Server.SendChatMessage("Couldn't find the LuaCs For Barotrauma package.", ChatMessageType.ServerMessageBox); + GameMain.Server.SendChatMessage("Couldn't find the LuaCsForBarotrauma content package.", ChatMessageType.ServerMessageBox); return; } @@ -47,8 +45,6 @@ namespace Barotrauma File.Copy(Path.Combine(path, "Binary", file), file, true); } - File.WriteAllText(LuaCsSetup.VersionFile, luaPackage.ModVersion); - #if WINDOWS File.WriteAllText("LuaCsDedicatedServer.bat", "\"%LocalAppData%/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2559634234/Binary/DedicatedServer.exe\""); #endif @@ -66,7 +62,7 @@ namespace Barotrauma return; } - GameMain.Server.SendChatMessage("Client-Side LuaCs installed, restart your game to apply changes.", ChatMessageType.ServerMessageBox);*/ + GameMain.Server.SendChatMessage("Client-Side LuaCs installed, restart your game to apply changes.", ChatMessageType.ServerMessageBox); } } }