mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-04 05:11:50 +01:00
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:
@@ -102,8 +102,8 @@ public sealed class HaslerTapes
|
||||
noted.Add(launch);
|
||||
|
||||
_files.CreateDirectory(Folder);
|
||||
_files.WriteAllText(LaunchFile, string.Concat(noted.TakeLast(RememberedLaunches).Select(l => l.Format())),
|
||||
Encoding.UTF8);
|
||||
_files.WriteAllTextAtomic(LaunchFile,
|
||||
string.Concat(noted.TakeLast(RememberedLaunches).Select(l => l.Format())));
|
||||
lock (_playerLock)
|
||||
_launches = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user