From d5f64b7b800cebddda4af1be9053b021d3827521 Mon Sep 17 00:00:00 2001
From: CptMoore <39010654+cptmoore@users.noreply.github.com>
Date: Tue, 10 Dec 2024 14:24:55 +0100
Subject: [PATCH] Small changes.
---
ModTek/Features/Logging/AppenderFile.cs | 8 ++++----
ModTek/Features/Logging/FastBuffer.cs | 4 ++--
ModTek/ModTek.csproj | 8 ++++++++
3 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/ModTek/Features/Logging/AppenderFile.cs b/ModTek/Features/Logging/AppenderFile.cs
index 17eb902..5019823 100644
--- a/ModTek/Features/Logging/AppenderFile.cs
+++ b/ModTek/Features/Logging/AppenderFile.cs
@@ -21,7 +21,7 @@ internal AppenderFile(string path, AppenderSettings settings)
_writer = new LogStream(path);
MTLoggerMessageDto.GetTimings(out var stopwatchTimestamp, out var dateTime, out var unityStartupTime);
- Write(System.Text.Encoding.UTF8.GetBytes(
+ Write(
$"""
ModTek v{GitVersionInformation.InformationalVersion} ({GitVersionInformation.CommitDate})
{Environment.OSVersion} ; BattleTech {Application.version} ; Unity {Application.unityVersion} ; CLR {Environment.Version} ; {System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription}"
@@ -29,11 +29,11 @@ internal AppenderFile(string path, AppenderSettings settings)
{new string('-', 80)}
{VersionInfo.GetFormattedInfo()}
"""
- ));
+ );
}
-
- private void Write(byte[] bytes)
+ private void Write(string text)
{
+ var bytes = System.Text.Encoding.UTF8.GetBytes(text);
Write(bytes, bytes.Length);
}
diff --git a/ModTek/Features/Logging/FastBuffer.cs b/ModTek/Features/Logging/FastBuffer.cs
index 524eb74..7db7be1 100644
--- a/ModTek/Features/Logging/FastBuffer.cs
+++ b/ModTek/Features/Logging/FastBuffer.cs
@@ -83,8 +83,8 @@ internal void Append(string value)
internal void AppendLast2Digits(long value)
{
- Append((char)(value / 10 + '0'));
- Append((char)(value % 10 + '0'));
+ Append((char)(((value / 10) % 10) + '0'));
+ Append((char)(((value / 1) % 10) + '0'));
}
internal void AppendLast7Digits(long value)
diff --git a/ModTek/ModTek.csproj b/ModTek/ModTek.csproj
index 94055d2..1ee843e 100644
--- a/ModTek/ModTek.csproj
+++ b/ModTek/ModTek.csproj
@@ -95,6 +95,14 @@
+
+
+