v1.2.2.b6

Performance & stability pass (issue #34 + audit)

General:
- DisableAll resets only skills active in the previous round instead of all loaded skills (~89ms -> ~5ms)
- Removed per-tick LINQ/allocations, O(1) HUD skill lookups, translation substitutions moved to load time
- ForceFullUpdate creates the network service once per broadcast; view-angle guard only skips a genuine (0,0,0) placeholder
- Debug hooks/logging only active when DebugMode is enabled (single reused writer)
- Player skill state unified to a single collection (fixes a rare disconnect race)
- Gamedata signatures resolved lazily/isolated; hardened tick/transmit paths against invalid handles
- Description HUD honours always-show / -1 duration consistently across all assignment paths

Skills:
- Jester: fixed the no-damage effect leaking after a mid-round skill change (Thief/Deactivator)
- Jackal: fixed trail entities accumulating over a round
- Falcon Eye / Third Eye / Spectator: camera state cleared on disable

Also: added missing translation keys as untranslated markers across language files.

Fixes #34
This commit is contained in:
ByDexter 2026-07-05 21:48:29 +03:00
parent a0f37ba1a1
commit 25cd8eb989
31 changed files with 202 additions and 79 deletions

View file

@ -13,10 +13,17 @@ namespace src.player
{
private static string sessionId = "00000";
private static readonly string debugFolder = Path.Combine(Instance.ModuleDirectory, "logs");
private static StreamWriter? _writer;
private static readonly object _writeLock = new();
public static void Load()
{
sessionId = $"{DateTime.Now:yyyy-MM-dd_HH-mm-ss}";
lock (_writeLock) { _writer?.Dispose(); _writer = null; }
if (Config.LoadedConfig.DebugMode != true)
return;
Instance.RegisterEventHandler<EventPlayerConnectFull>((@event, info) =>
{
var player = PlayerManager.GetPlayerEvent(@event.Userid);
@ -131,13 +138,25 @@ namespace src.player
if (Config.LoadedConfig.DebugMode != true)
return;
// GetAllEntityIndexes();
lock (_writeLock)
{
_writer ??= CreateWriter();
_writer?.WriteLine($"[{DateTime.Now:dd.MM.yyyy HH:mm:ss}] {message}");
}
}
string filename = $"debug_{sessionId}.txt";
string path = Path.Combine(debugFolder, filename);
Directory.CreateDirectory(debugFolder);
File.AppendAllText(path, $"[{DateTime.Now:dd.MM.yyyy HH:mm:ss}] {message}{Environment.NewLine}", System.Text.Encoding.UTF8);
private static StreamWriter? CreateWriter()
{
try
{
Directory.CreateDirectory(debugFolder);
string path = Path.Combine(debugFolder, $"debug_{sessionId}.txt");
return new StreamWriter(path, append: true, System.Text.Encoding.UTF8) { AutoFlush = true };
}
catch
{
return null;
}
}
private static void GetAllEntityIndexes()