Skip to content

Commit

Permalink
Added HarmonyX version to ModTek log headers. Small code formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
CptMoore committed Dec 22, 2024
1 parent 70261da commit fff0463
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
2 changes: 1 addition & 1 deletion ModTek/Features/Logging/AppenderFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal AppenderFile(string path, AppenderSettings settings)
MTLoggerMessageDto.GetTimings(out var stopwatchTimestamp, out var dateTime, out var unityStartupTime);
Write(
$"""
ModTek v{GitVersionInformation.InformationalVersion} ({GitVersionInformation.CommitDate})
ModTek v{GitVersionInformation.InformationalVersion} ({GitVersionInformation.CommitDate}) ; HarmonyX {typeof(Harmony).Assembly.GetName().Version}
{Environment.OSVersion} ; BattleTech {Application.version} ; Unity {Application.unityVersion} ; CLR {Environment.Version} ; {System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription}"
{dateTime.ToLocalTime().ToString("o", CultureInfo.InvariantCulture)} ; Startup {unityStartupTime.ToString(null, CultureInfo.InvariantCulture)} ; Ticks {stopwatchTimestamp}
{new string('-', 80)}
Expand Down
25 changes: 8 additions & 17 deletions ModTek/Features/Logging/FastBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ internal void Append(string value)
SetAscii(positionIterPtr, charsIterPtr, 5, out var a5);
SetAscii(positionIterPtr, charsIterPtr, 6, out var a6);
SetAscii(positionIterPtr, charsIterPtr, 7, out var a7);
if (
if (!(
a0 &&
a1 &&
a2 &&
Expand All @@ -109,13 +109,10 @@ internal void Append(string value)
a5 &&
a6 &&
a7
) {
_length += IterSize;
}
else
{
)) {
goto Utf8Fallback;
}
_length += IterSize;
positionIterPtr = _bufferPtr + _length;
charsIterPtr += IterSize;
}
Expand All @@ -127,16 +124,13 @@ internal void Append(string value)
{
SetAscii(positionIterPtr, charsIterPtr, 0, out var a0);
SetAscii(positionIterPtr, charsIterPtr, 1, out var a1);
if (
if (!(
a0 &&
a1
) {
_length += IterSize;
}
else
{
)) {
goto Utf8Fallback;
}
_length += IterSize;
positionIterPtr = _bufferPtr + _length;
charsIterPtr += IterSize;
}
Expand All @@ -146,14 +140,11 @@ internal void Append(string value)
{
const int IterSize = 1;
SetAscii(positionIterPtr, charsIterPtr, 0, out var a0);
if (a0)
{
_length += IterSize;
}
else
if (!a0)
{
goto Utf8Fallback;
}
_length += IterSize;
}

return;
Expand Down

0 comments on commit fff0463

Please sign in to comment.