Skip to content

Commit

Permalink
Added a missing log message and migrate the TDB last write time reader.
Browse files Browse the repository at this point in the history
  • Loading branch information
pzgulyas committed Dec 12, 2021
1 parent c147e78 commit 23dfa3f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Source/ORTS.Common/VirtualFileSystem.cs
Expand Up @@ -181,8 +181,12 @@ public static void FileDelete(string vfsPath)
node.DeleteNode();
if (File.Exists(node.AbsolutePath))
File.Delete(node.AbsolutePath);
if (AccessLoggingEnabled)
Trace.TraceInformation($"VFS deleting archive node: {node.GetVerbosePath()} => {vfsPath}");
return;
}
}
throw new FileNotFoundException($"VFS deleting failed: {vfsPath}");
}

public static string[] GetDirectories(string vfsPath, SearchOption searchOption = SearchOption.TopDirectoryOnly)
Expand Down
2 changes: 1 addition & 1 deletion Source/Orts.Formats.Msts/TrackDatabaseFile.cs
Expand Up @@ -55,7 +55,7 @@ public TrackDatabaseFile(string filenamewithpath)
new STFReader.TokenProcessor("trackdb", ()=>{ TrackDB = new TrackDB(stf); }),
});

LastWriteTime = File.GetLastWriteTime(filenamewithpath);
LastWriteTime = Vfs.GetLastWriteTime(filenamewithpath);
}

/// <summary>
Expand Down
Expand Up @@ -1195,7 +1195,7 @@ public AIPath LoadPath(string pathstring, out bool validPath)
formedpathFilefullBinary = Path.Combine(formedpathFilefullBinary, Path.GetFileNameWithoutExtension(formedpathFilefull));
formedpathFilefullBinary = Path.ChangeExtension(formedpathFilefullBinary, "or-binpat");

if (BinaryPaths && File.Exists(formedpathFilefullBinary))
if (BinaryPaths && Vfs.FileExists(formedpathFilefullBinary))
{
var binaryLastWriteTime = Vfs.GetLastWriteTime(formedpathFilefullBinary);
if (binaryLastWriteTime < simulator.TDB.LastWriteTime ||
Expand Down

0 comments on commit 23dfa3f

Please sign in to comment.