Admin: spawn items (saved on the server), unban (menu tab + console), tabbed admin menu; dashboard needles and steering wheel synced; server browser row opens the profile

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-27 10:15:35 +02:00
co-authored by Claude Opus 5.5
parent ba396146f2
commit 85fbb8a3ce
5 changed files with 77 additions and 3 deletions
+20
View File
@@ -27,6 +27,9 @@ public sealed class WorldState
public Dictionary<string, string> Doors { get; set; } = new();
/// <summary>Fahrzeugzustand (Tank, Öl, Schrauben ...): Schlüssel -> Base64 [byte typ, wert].</summary>
public Dictionary<int, string> Vars { get; set; } = new();
/// <summary>Von Admins gespawnte Items (SpawnItem-Nachrichten, Base64), damit später Beitretende sie auch haben.</summary>
public List<string> Spawns { get; set; } = new();
public const int MaxSpawns = 2000;
public bool Dirty { get; private set; }
@@ -48,6 +51,7 @@ public sealed class WorldState
public void Reset()
{
Spawns.Clear();
Objects.Clear();
Events.Clear();
PlayerPositions.Clear();
@@ -146,6 +150,13 @@ public sealed class WorldState
public const int MaxVars = 50_000;
public const int MaxObjects = 20_000;
public void AddSpawn(byte[] payload)
{
if (Spawns.Count >= MaxSpawns || payload.Length > 512) return;
Spawns.Add(Convert.ToBase64String(payload));
Dirty = true;
}
public void AddFsmEvent(byte[] payload)
{
if (Events.Count >= MaxEvents) return;
@@ -209,6 +220,15 @@ public sealed class WorldState
w.Write(kv.Key);
w.Write(Convert.FromBase64String(kv.Value));
}
// Von Admins gespawnte Items: int n, je [int Länge, SpawnItem-Payload]
w.Write(Spawns.Count);
foreach (string sp in Spawns)
{
byte[] bytes = Convert.FromBase64String(sp);
w.Write(bytes.Length);
w.Write(bytes);
}
});
}
}