Skip to content
Permalink
Browse files

- fixed a DateTime regional issue

  • Loading branch information
cozy1 committed Oct 15, 2019
1 parent eb5fdf0 commit 346bf9be8bf804e91089bffca0ede2f06de45ebb
@@ -1,6 +1,6 @@
Rocksmith Toolkit Release Notes

- added OS, and CultureInfo to log
- added CultureInfo to log
- simplified custom exception messages to encourage users to read them
- added toolkit library validation check
- improved tone name error handling
@@ -996,10 +996,11 @@ private void parseArrangements(Song2014 xml, Sng2014File sng)
var piter = xml.PhraseIterations[j];

// fix for 100% bug issue and improve mastery
if (piter.Time > note.Time && j > 0)
if (piter.Time > note.Time) // && j > 0)
{
if (note.Ignore == 0)
++a.NotesInIteration1[j - 1];

++a.NotesInIteration2[j - 1];
break;
}
@@ -1028,7 +1029,7 @@ private void parseArrangements(Song2014 xml, Sng2014File sng)
var piter = xml.PhraseIterations[j];

// fix for 100% bug issue and improve mastery
if (piter.Time > chord.Time && j > 0)
if (piter.Time > chord.Time) // && j > 0)
{
if (chord.Ignore == 0)
++a.NotesInIteration1[j - 1];
@@ -85,12 +85,11 @@ public static bool IsRSTKLibValid()
// return false;
var rstkLibPath = typeof(RocksmithToolkitLib.ToolkitVersion).Assembly.Location;
var libDate = File.GetCreationTime(rstkLibPath);
// account for user's DateTime regional differences
CultureInfo cultureInfo = new CultureInfo("en-US");
DateTime libDT = DateTime.Parse(libDate.ToString(), cultureInfo, DateTimeStyles.NoCurrentDateDefault);
DateTime nowDT = DateTime.Parse(DateTime.Now.ToString(), cultureInfo, DateTimeStyles.NoCurrentDateDefault);
// use UTC to avoid regional DateTime issues
DateTime dtNow = DateTime.UtcNow;
DateTime dtLib = libDate.ToUniversalTime();

if (nowDT > libDT.AddDays(30))
if (dtNow > dtLib.AddDays(30))
return false;

return true;
@@ -103,7 +102,7 @@ public static class Startup
public static void Start()
{
if (!ToolkitVersion.IsRSTKLibValid())
throw new ApplicationException("This version of RocksmithToolkitLib.dll has expired. " + Environment.NewLine +
throw new ApplicationException("This version of RocksmithToolkitLib.dll has expired. " + Environment.NewLine +
"Please download and install the latest toolkit library. " + Environment.NewLine);
}
}

0 comments on commit 346bf9b

Please sign in to comment.
You can’t perform that action at this time.