Fix replay recording temporary paths not supporting subdirectories (#19887)

This commit is contained in:
Leon Friedrich
2023-09-16 23:46:12 +12:00
committed by GitHub
parent ac0b8fe621
commit 7d9693d976
3 changed files with 64 additions and 6 deletions

View File

@@ -72,13 +72,14 @@ public sealed partial class GameTicker
if (data.State is not ReplayRecordState state)
return;
if (state.MoveToPath != null)
{
_sawmillReplays.Info($"Moving replay into final position: {state.MoveToPath}");
if (state.MoveToPath == null)
return;
_taskManager.BlockWaitOnTask(_replays.WaitWriteTasks());
data.Directory.Rename(data.Path, state.MoveToPath.Value);
}
_sawmillReplays.Info($"Moving replay into final position: {state.MoveToPath}");
_taskManager.BlockWaitOnTask(_replays.WaitWriteTasks());
DebugTools.Assert(!_replays.IsWriting());
data.Directory.CreateDir(state.MoveToPath.Value.Directory);
data.Directory.Rename(data.Path, state.MoveToPath.Value);
}
private ResPath GetAutoReplayPath()