mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
Fixes for Thai buddhist year
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@ namespace VRCX
|
|||||||
|
|
||||||
if (File.Exists(fileLocation))
|
if (File.Exists(fileLocation))
|
||||||
{
|
{
|
||||||
Directory.SetLastWriteTime(directoryLocation, DateTime.Now);
|
Directory.SetLastWriteTimeUtc(directoryLocation, DateTime.UtcNow);
|
||||||
return fileLocation;
|
return fileLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+15
-8
@@ -27,7 +27,7 @@ namespace VRCX
|
|||||||
private bool m_FirstRun = true;
|
private bool m_FirstRun = true;
|
||||||
private bool m_ResetLog;
|
private bool m_ResetLog;
|
||||||
private Thread m_Thread;
|
private Thread m_Thread;
|
||||||
private DateTime tillDate = DateTime.Now;
|
private DateTime tillDate = DateTime.UtcNow;
|
||||||
public bool VrcClosedGracefully;
|
public bool VrcClosedGracefully;
|
||||||
|
|
||||||
// NOTE
|
// NOTE
|
||||||
@@ -38,7 +38,7 @@ namespace VRCX
|
|||||||
Instance = new LogWatcher();
|
Instance = new LogWatcher();
|
||||||
}
|
}
|
||||||
|
|
||||||
public LogWatcher()
|
private LogWatcher()
|
||||||
{
|
{
|
||||||
var logPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"Low\VRChat\VRChat";
|
var logPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"Low\VRChat\VRChat";
|
||||||
m_LogDirectoryInfo = new DirectoryInfo(logPath);
|
m_LogDirectoryInfo = new DirectoryInfo(logPath);
|
||||||
@@ -72,7 +72,8 @@ namespace VRCX
|
|||||||
|
|
||||||
public void SetDateTill(string date)
|
public void SetDateTill(string date)
|
||||||
{
|
{
|
||||||
tillDate = DateTime.Parse(date);
|
tillDate = DateTime.Parse(date, CultureInfo.InvariantCulture, DateTimeStyles.None);
|
||||||
|
tillDate = tillDate.ToUniversalTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ThreadLoop()
|
private void ThreadLoop()
|
||||||
@@ -130,7 +131,7 @@ namespace VRCX
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DateTime.Compare(fileInfo.LastWriteTime, tillDate) < 0)
|
if (DateTime.Compare(fileInfo.LastWriteTimeUtc, tillDate) < 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -208,10 +209,11 @@ namespace VRCX
|
|||||||
line.Substring(0, 19),
|
line.Substring(0, 19),
|
||||||
"yyyy.MM.dd HH:mm:ss",
|
"yyyy.MM.dd HH:mm:ss",
|
||||||
CultureInfo.InvariantCulture,
|
CultureInfo.InvariantCulture,
|
||||||
DateTimeStyles.AssumeLocal,
|
DateTimeStyles.None,
|
||||||
out var lineDate
|
out var lineDate
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
|
lineDate = lineDate.ToUniversalTime();
|
||||||
if (DateTime.Compare(lineDate, tillDate) <= 0)
|
if (DateTime.Compare(lineDate, tillDate) <= 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -291,14 +293,19 @@ namespace VRCX
|
|||||||
line.Substring(0, 19),
|
line.Substring(0, 19),
|
||||||
"yyyy.MM.dd HH:mm:ss",
|
"yyyy.MM.dd HH:mm:ss",
|
||||||
CultureInfo.InvariantCulture,
|
CultureInfo.InvariantCulture,
|
||||||
DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeLocal,
|
DateTimeStyles.None,
|
||||||
out var dt
|
out var dt
|
||||||
) == false)
|
))
|
||||||
|
{
|
||||||
|
dt = dt.ToUniversalTime();
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
dt = DateTime.UtcNow;
|
dt = DateTime.UtcNow;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $"{dt:yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'}";
|
// ISO 8601
|
||||||
|
return dt.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'", CultureInfo.InvariantCulture);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool ParseLogLocation(FileInfo fileInfo, LogContext logContext, string line, int offset)
|
private bool ParseLogLocation(FileInfo fileInfo, LogContext logContext, string line, int offset)
|
||||||
|
|||||||
Reference in New Issue
Block a user