2.10.8: fewer hitches

- Sending on a background thread (the game thread blocked whenever the TCP
  buffer was full, e.g. while uploading the save); small frames are batched
- Server save requests: routine saves wait for a calm moment (not while driving
  fast) and are announced; urgent flag from server 2.10.5
- Dynamic built-in font for all MSCO GUI (Unity logged hundreds of
  "Font size and style overrides" warnings with stutters)
- Admin VEHICLE tab rescans every 30 s / after actions instead of every 5 s;
  time/weather FSM search less often
- Reused buffers for Build/Frame/Poll (less garbage, fewer GC pauses)
- Hitch log: GC and save detection, count of hitches between reports
- Show Bolt Size 1.0.1: finds the FPSCamera (Camera.main may be missing), uses
  MSCO's shared FSM list instead of FindObjectsOfType every 2 s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-04 00:08:36 +02:00
co-authored by Claude Opus 5.5
parent e32ddadbc8
commit d195a484d8
9 changed files with 277 additions and 57 deletions
+23
View File
@@ -10,6 +10,26 @@ namespace MSCO
/// </summary>
public static class UiTheme
{
static Font dynamicFont;
static bool fontSearched;
/// <summary>
/// Dynamische Schrift (eingebautes Arial) für alle MSCO-Oberflächen: Schriftgröße/Fett gehen nur mit dynamischen
/// Schriften - sonst schreibt Unity jedes Mal eine Warnung ins Log (400-mal in einer Sitzung, mit Rucklern).
/// </summary>
public static Font DynamicFont
{
get
{
if (!fontSearched)
{
fontSearched = true;
try { dynamicFont = Resources.GetBuiltinResource(typeof(Font), "Arial.ttf") as Font; } catch { }
if (dynamicFont != null && !dynamicFont.dynamic) dynamicFont = null;
}
return dynamicFont;
}
}
public static readonly Color Background = Hex(0x16, 0x16, 0x1a, 0.97f);
public static readonly Color Panel = Hex(0x0f, 0x0f, 0x12, 0.98f);
public static readonly Color Row = Hex(0x22, 0x22, 0x28);
@@ -170,6 +190,7 @@ namespace MSCO
public static GUIStyle Button(Color normal, Color hover, Color text, int fontSize = 13, bool bold = true)
{
var s = new GUIStyle(GUI.skin.button);
if (DynamicFont != null) s.font = DynamicFont;
s.normal.background = Rounded(normal);
s.hover.background = Rounded(hover);
s.active.background = Rounded(hover);
@@ -186,6 +207,7 @@ namespace MSCO
public static GUIStyle Field(int fontSize = 14)
{
var s = new GUIStyle(GUI.skin.textField);
if (DynamicFont != null) s.font = DynamicFont;
s.normal.background = Rounded(FieldColor);
s.hover.background = Rounded(FieldFocus);
s.focused.background = Rounded(FieldFocus);
@@ -200,6 +222,7 @@ namespace MSCO
public static GUIStyle Label(int fontSize, Color color, FontStyle font = FontStyle.Normal, TextAnchor align = TextAnchor.UpperLeft)
{
var s = new GUIStyle(GUI.skin.label);
if (DynamicFont != null) s.font = DynamicFont;
s.fontSize = fontSize;
s.fontStyle = font;
s.normal.textColor = color;