-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
50 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,13 +57,17 @@ public class Program | |
private const string SCRIPT_START_METHOD = "Run"; | ||
private const string REPO_PATH = "https://github.com/ClusterM/famicom-dumper-client"; | ||
private const int DEFAULT_GRPC_PORT = 26673; | ||
private static DateTime BUILD_TIME = DateTime.FromFileTimeUtc(long.Parse(Properties.Resources.buildtime)); | ||
|
||
static int Main(string[] args) | ||
{ | ||
Console.WriteLine($"Famicom Dumper Client v{Assembly.GetExecutingAssembly().GetName().Version.Major}.{Assembly.GetExecutingAssembly().GetName().Version.Minor}"); | ||
Console.WriteLine($" Commit {Properties.Resources.gitCommit} @ {REPO_PATH}"); | ||
#if DEBUG | ||
Console.WriteLine($" Debug version, build time: {BUILD_TIME.ToLocalTime()}"); | ||
#endif | ||
Console.WriteLine(" (c) Alexey 'Cluster' Avdyukhin / https://clusterrr.com / [email protected]"); | ||
Console.WriteLine(); | ||
Console.WriteLine(""); | ||
var startTime = DateTime.Now; | ||
string port = "auto"; | ||
string mapperName = null; | ||
|
@@ -447,16 +451,22 @@ static Assembly Compile(string path) | |
var cacheFile = Path.Combine(cacheDirectory, Path.GetFileNameWithoutExtension(path)) + ".dll"; | ||
|
||
// Try to load cached assembly | ||
if (File.Exists(cacheFile) && (new FileInfo(cacheFile).LastWriteTime >= new FileInfo(path).LastWriteTime)) | ||
; | ||
if (File.Exists(cacheFile)) | ||
{ | ||
try | ||
{ | ||
var rawAssembly = File.ReadAllBytes(cacheFile); | ||
return Assembly.Load(rawAssembly); | ||
} | ||
catch (Exception ex) | ||
var cacheCompileTime = new FileInfo(cacheFile).LastWriteTime; | ||
if ((cacheCompileTime >= new FileInfo(path).LastWriteTime) // recompile if script was changed | ||
&& (cacheCompileTime >= BUILD_TIME.ToLocalTime())) // recompile if our app is newer | ||
{ | ||
Console.WriteLine($"Can't load cached compiled script file: {ex.Message}"); | ||
try | ||
{ | ||
var rawAssembly = File.ReadAllBytes(cacheFile); | ||
return Assembly.Load(rawAssembly); | ||
} | ||
catch (Exception ex) | ||
{ | ||
Console.WriteLine($"Can't load cached compiled script file: {ex.Message}"); | ||
} | ||
} | ||
} | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule NesContainers
updated
8 files
+1 −1 | Crc32Calculator.cs | |
+23 −22 | FdsBlockDiskInfo.cs | |
+7 −4 | FdsBlockFileAmount.cs | |
+11 −6 | FdsBlockFileData.cs | |
+6 −4 | FdsBlockFileHeader.cs | |
+0 −23 | FdsBlockParser.cs | |
+8 −6 | FdsDiskSide.cs | |
+1 −2 | IFdsBlock.cs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters