Server 2.10.2: warn when an uploaded save has no items.txt

Bought parts (oil filter, spark plugs, fan belt, battery ...) and whether they are
installed are stored in items.txt. Without it they are missing on the car - e.g. the
finished Satsuma of a downloaded save loses oil on the server (in singleplayer an old
local items.txt hides the problem). The upload result now says so. 2 new tests (148 pass).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-03 17:41:24 +02:00
co-authored by Claude Opus 5.5
parent bb3efb8cc3
commit 266a462fc3
4 changed files with 17 additions and 4 deletions
+11 -1
View File
@@ -216,6 +216,16 @@ public static class SaveStore
return null;
}
/// <summary>
/// Hinweis, wenn im Spielstand items.txt fehlt: dort stehen alle gekauften Teile und Gegenstände (Ölfilter,
/// Zündkerzen, Keilriemen, Batterie ...) samt "eingebaut". Ohne die Datei fehlen sie am Auto - z.B. läuft Öl aus,
/// weil kein Ölfilter da ist. Im Einzelspieler fällt das nicht auf, wenn dort noch eine alte items.txt liegt.
/// </summary>
public static string MissingItemsWarning(IReadOnlyDictionary<string, byte[]> files) =>
files.ContainsKey("items.txt") ? ""
: " - WARNING: items.txt is missing in this save. Bought parts (oil filter, spark plugs, fan belt, battery ...) are " +
"stored there, so they are missing on the car (e.g. oil runs out without the oil filter). Upload the save with items.txt.";
/// <summary>Aktuellen Spielstand als ZIP.</summary>
public static byte[] ExportZip(string dataDir)
{
@@ -247,7 +257,7 @@ public static class SaveStore
}
catch (Exception e) { return "Could not write the save game: " + e.Message; }
GameServer.Log($"New save game uploaded by {by} ({files.Count} files, server stopped) - it is also the new reset point");
return $"Save game uploaded ({files.Count} files) - start the server to use it";
return $"Save game uploaded ({files.Count} files) - start the server to use it" + MissingItemsWarning(files);
}
/// <summary>Server aus: Backup wiederherstellen.</summary>