This commit is contained in:
EvilFactory
2023-10-20 12:20:18 -03:00
10 changed files with 28 additions and 13 deletions

View File

@@ -73,7 +73,7 @@ body:
label: Version
description: Which version of the game did the bug happen in? You can see the current version number in the bottom left corner of your screen in the main menu.
options:
- v1.1.18.0 (Treacherous Tides)
- v1.1.18.1 (Treacherous Tides)
- Other
validations:
required: true

View File

@@ -583,7 +583,9 @@ namespace Barotrauma
if (saveFiles == null)
{
saveFiles = SaveUtil.GetSaveFiles(SaveUtil.SaveType.Singleplayer);
//we don't need to log errors at this point,
//if any file fails to load the error will get logged when we try to extract the root from the game session doc later in the method
saveFiles = SaveUtil.GetSaveFiles(SaveUtil.SaveType.Singleplayer, logLoadErrors: false);
}
var leftColumn = new GUILayoutGroup(new RectTransform(new Vector2(0.5f, 1.0f), loadGameContainer.RectTransform), childAnchor: Anchor.TopCenter)

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>1.1.18.0</Version>
<Version>1.1.18.1</Version>
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>1.1.18.0</Version>
<Version>1.1.18.1</Version>
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>1.1.18.0</Version>
<Version>1.1.18.1</Version>
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product>
<Version>1.1.18.0</Version>
<Version>1.1.18.1</Version>
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName>

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product>
<Version>1.1.18.0</Version>
<Version>1.1.18.1</Version>
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName>

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product>
<Version>1.1.18.0</Version>
<Version>1.1.18.1</Version>
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName>

View File

@@ -238,7 +238,7 @@ namespace Barotrauma
return folder;
}
public static IReadOnlyList<CampaignMode.SaveInfo> GetSaveFiles(SaveType saveType, bool includeInCompatible = true)
public static IReadOnlyList<CampaignMode.SaveInfo> GetSaveFiles(SaveType saveType, bool includeInCompatible = true, bool logLoadErrors = true)
{
string defaultFolder = saveType == SaveType.Singleplayer ? DefaultSaveFolder : DefaultMultiplayerSaveFolder;
if (!Directory.Exists(defaultFolder))
@@ -273,7 +273,7 @@ namespace Barotrauma
List<CampaignMode.SaveInfo> saveInfos = new List<CampaignMode.SaveInfo>();
foreach (string file in files)
{
var docRoot = ExtractGameSessionRootElementFromSaveFile(file);
var docRoot = ExtractGameSessionRootElementFromSaveFile(file, logLoadErrors);
if (!includeInCompatible && !IsSaveFileCompatible(docRoot))
{
continue;
@@ -561,7 +561,7 @@ namespace Barotrauma
/// Extract *only* the root element of the gamesession.xml file in the given save.
/// For performance reasons, none of its child elements are returned.
/// </summary>
public static XElement? ExtractGameSessionRootElementFromSaveFile(string savePath)
public static XElement? ExtractGameSessionRootElementFromSaveFile(string savePath, bool logLoadErrors = true)
{
const int maxRetries = 4;
for (int i = 0; i <= maxRetries; i++)
@@ -617,12 +617,19 @@ namespace Barotrauma
if (i >= maxRetries || !File.Exists(savePath)) { throw; }
DebugConsole.NewMessage(
$"Failed to decompress file \"{savePath}\" for root extraction {{{e.Message}}}, retrying in 250 ms...",
$"Failed to decompress file \"{savePath}\" for root extraction ({e.Message}), retrying in 250 ms...",
Color.Red);
Thread.Sleep(250);
}
catch (System.IO.InvalidDataException e)
{
if (logLoadErrors)
{
DebugConsole.ThrowError($"Failed to decompress file \"{savePath}\" for root extraction.", e);
}
return null;
}
}
return null;
}

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------------------------------------------------------------------------------------
v1.1.18.1
-------------------------------------------------------------------------------------------------------------------------------------------------
- Fixed opening the "load game" menu crashing the game if you have any corrupted/unloadable saves in the save folder. In multiplayer, this would just prevent opening the campaign setup menu without any error messages.
-------------------------------------------------------------------------------------------------------------------------------------------------
v1.1.18.0
-------------------------------------------------------------------------------------------------------------------------------------------------