Write the list of launches beside the tapes in one move

The tape window reads starter-launch.txt every two seconds. Written in place,
the file could be read half written, and a crash during the write lost the
launches noted before.
This commit is contained in:
maj00r
2026-11-03 21:51:54 +01:00
parent d95182f17c
commit 306bdc44df

View File

@@ -102,8 +102,8 @@ public sealed class HaslerTapes
noted.Add(launch); noted.Add(launch);
_files.CreateDirectory(Folder); _files.CreateDirectory(Folder);
_files.WriteAllText(LaunchFile, string.Concat(noted.TakeLast(RememberedLaunches).Select(l => l.Format())), _files.WriteAllTextAtomic(LaunchFile,
Encoding.UTF8); string.Concat(noted.TakeLast(RememberedLaunches).Select(l => l.Format())));
lock (_playerLock) lock (_playerLock)
_launches = null; _launches = null;
} }