Fix oil leaking after joining: don't sync game-computed leak states/rates (LeakOilpan, LeakOilfilter, ...); vars <filter> diagnostic command
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -26,6 +26,12 @@
|
|||||||
|
|
||||||
Server und Mod müssen beide 2.8 sein (Server: `git pull && docker compose up -d --build`).
|
Server und Mod müssen beide 2.8 sein (Server: `git pull && docker compose up -d --build`).
|
||||||
|
|
||||||
|
**Behoben: Öl lief aus dem Satsuma**
|
||||||
|
- Beim Beitreten lief Öl aus, obwohl der Spielstand lokal dicht war: die vom Spiel selbst berechneten Werte
|
||||||
|
`LeakOilpan`, `LeakOilfilter`, `LeakRockerCover`, `LeakHeadgasket` (und Raten wie `…LeakRate`) wurden wie echte
|
||||||
|
Fahrzeugwerte synchronisiert und überschrieben den Stand aus dem Spielstand. Werden jetzt nicht mehr übertragen
|
||||||
|
- Diagnose: `vars <filter>` in der F7-Konsole zeigt die synchronisierten Fahrzeugwerte (z.B. `vars oil`)
|
||||||
|
|
||||||
**Scharfe Oberfläche, FPS, Leistung**
|
**Scharfe Oberfläche, FPS, Leistung**
|
||||||
- Launcher wird in voller Auflösung gezeichnet (Schrift und Kanten scharf statt hochgezogen/verpixelt)
|
- Launcher wird in voller Auflösung gezeichnet (Schrift und Kanten scharf statt hochgezogen/verpixelt)
|
||||||
- `fps` in der F7-Konsole: FPS-Anzeige oben rechts (grün/gelb/rot), Konsole zeigt auch das längste Bild (Ruckler)
|
- `fps` in der F7-Konsole: FPS-Anzeige oben rechts (grün/gelb/rot), Konsole zeigt auch das längste Bild (Ruckler)
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ namespace MSCO
|
|||||||
"fps [on|off] - show the frames per second (toggle)\n" +
|
"fps [on|off] - show the frames per second (toggle)\n" +
|
||||||
"/admin - admin menu (kick / ban / teleport / cheats)\n" +
|
"/admin - admin menu (kick / ban / teleport / cheats)\n" +
|
||||||
"vehicles | rig - debug info about vehicles / player models\n" +
|
"vehicles | rig - debug info about vehicles / player models\n" +
|
||||||
|
"vars <filter> - synced vehicle values, e.g. vars oil (debug)\n" +
|
||||||
"debug - toggle sync debug output\n" +
|
"debug - toggle sync debug output\n" +
|
||||||
"clear - clear this console";
|
"clear - clear this console";
|
||||||
|
|
||||||
@@ -129,6 +130,10 @@ namespace MSCO
|
|||||||
case "vehicles":
|
case "vehicles":
|
||||||
foreach (string line in mp.DescribeVehicles()) print(line);
|
foreach (string line in mp.DescribeVehicles()) print(line);
|
||||||
break;
|
break;
|
||||||
|
case "vars":
|
||||||
|
// Diagnose: welche Fahrzeugwerte synchronisiert werden (z.B. "vars oil")
|
||||||
|
foreach (string line in mp.DescribeVehicleValues(args.Length > 1 ? args[1] : "")) print(line);
|
||||||
|
break;
|
||||||
case "debug":
|
case "debug":
|
||||||
FsmSync.Debug = !FsmSync.Debug;
|
FsmSync.Debug = !FsmSync.Debug;
|
||||||
print("Sync debug output " + (FsmSync.Debug ? "ON" : "OFF"));
|
print("Sync debug output " + (FsmSync.Debug ? "ON" : "OFF"));
|
||||||
|
|||||||
@@ -210,6 +210,9 @@ namespace MSCO
|
|||||||
return lines;
|
return lines;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>Konsole "vars <filter>": synchronisierte Fahrzeugwerte (Diagnose).</summary>
|
||||||
|
public List<string> DescribeVehicleValues(string filter) { return vehicleState.Describe(filter, 60); }
|
||||||
|
|
||||||
public List<string> DescribeVehicles()
|
public List<string> DescribeVehicles()
|
||||||
{
|
{
|
||||||
var lines = objects.DescribeVehicles();
|
var lines = objects.DescribeVehicles();
|
||||||
|
|||||||
+28
-2
@@ -28,7 +28,14 @@ namespace MSCO
|
|||||||
|
|
||||||
// Montiert-Flags nicht direkt setzen: das echte Anbauen läuft über FsmSync (Events)
|
// Montiert-Flags nicht direkt setzen: das echte Anbauen läuft über FsmSync (Events)
|
||||||
// Schrauben/Festigkeit laufen über FsmSync (Events) - ein falscher Wert hier würde Teile lockern und abfallen lassen
|
// Schrauben/Festigkeit laufen über FsmSync (Events) - ein falscher Wert hier würde Teile lockern und abfallen lassen
|
||||||
static readonly string[] Excluded = { "install", "bolt", "tight", "detach", "attach", "rpm", "speed", "steer", "throttle", "gear", "raycast", "distance" };
|
// Vom Spiel selbst berechnete Werte ebenfalls nicht: z.B. LeakOilpan/LeakOilfilter (leckt Öl?) ergibt sich aus
|
||||||
|
// angebauten/festgezogenen Teilen - ein übertragener alter Wert ließ beim Beitreten Öl auslaufen. Raten (…Rate)
|
||||||
|
// rechnet das Spiel laufend neu aus.
|
||||||
|
static readonly string[] Excluded =
|
||||||
|
{
|
||||||
|
"install", "bolt", "tight", "detach", "attach", "rpm", "speed", "steer", "throttle", "gear", "raycast", "distance",
|
||||||
|
"leak", "rate"
|
||||||
|
};
|
||||||
|
|
||||||
const float ScanInterval = 10f;
|
const float ScanInterval = 10f;
|
||||||
const float CheckInterval = 0.5f;
|
const float CheckInterval = 0.5f;
|
||||||
@@ -37,6 +44,7 @@ namespace MSCO
|
|||||||
class Var
|
class Var
|
||||||
{
|
{
|
||||||
public int Key;
|
public int Key;
|
||||||
|
public string Name; // Pfad|FSM|Variable (für die Diagnose "vars")
|
||||||
public string Root;
|
public string Root;
|
||||||
public NamedVariable Variable;
|
public NamedVariable Variable;
|
||||||
public byte Type; // 1 float, 2 int, 3 bool
|
public byte Type; // 1 float, 2 int, 3 bool
|
||||||
@@ -53,6 +61,24 @@ namespace MSCO
|
|||||||
|
|
||||||
public int Count { get { return vars.Count; } }
|
public int Count { get { return vars.Count; } }
|
||||||
|
|
||||||
|
/// <summary>Diagnose (Konsole "vars <filter>"): synchronisierte Fahrzeugwerte mit aktuellem Wert.</summary>
|
||||||
|
public List<string> Describe(string filter, int max)
|
||||||
|
{
|
||||||
|
var lines = new List<string>();
|
||||||
|
string f = (filter ?? "").ToLower();
|
||||||
|
foreach (Var v in vars.Values)
|
||||||
|
{
|
||||||
|
if (f.Length > 0 && (v.Name == null || !v.Name.ToLower().Contains(f))) continue;
|
||||||
|
string value = v.Type == 1 ? ((FsmFloat)v.Variable).Value.ToString("0.###")
|
||||||
|
: v.Type == 2 ? ((FsmInt)v.Variable).Value.ToString()
|
||||||
|
: ((FsmBool)v.Variable).Value.ToString();
|
||||||
|
lines.Add(" " + v.Name + " = " + value);
|
||||||
|
if (lines.Count >= max) { lines.Add(" ... (more - use a narrower filter)"); break; }
|
||||||
|
}
|
||||||
|
if (lines.Count == 0) lines.Add(" no synced vehicle value matches '" + filter + "'");
|
||||||
|
return lines;
|
||||||
|
}
|
||||||
|
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
vars.Clear();
|
vars.Clear();
|
||||||
@@ -180,7 +206,7 @@ namespace MSCO
|
|||||||
int key = Hash(prefix + variable.Name);
|
int key = Hash(prefix + variable.Name);
|
||||||
Var existing;
|
Var existing;
|
||||||
if (vars.TryGetValue(key, out existing) && existing.Variable == variable) return;
|
if (vars.TryGetValue(key, out existing) && existing.Variable == variable) return;
|
||||||
var v = new Var { Key = key, Root = root, Variable = variable, Type = type };
|
var v = new Var { Key = key, Name = prefix + variable.Name, Root = root, Variable = variable, Type = type };
|
||||||
Remember(v);
|
Remember(v);
|
||||||
vars[key] = v;
|
vars[key] = v;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user