From 80f81e06bff8ad937dc7f91efb18ba1d0be30bd3 Mon Sep 17 00:00:00 2001 From: K4ryuu <104531589+K4ryuu@users.noreply.github.com> Date: Sat, 18 May 2024 21:11:16 +0200 Subject: [PATCH] Patch v4.3.3 --- CHANGELOG | 7 ++++++- K4-System/src/Plugin/PluginDatabase.cs | 20 ++++++++++++-------- K4-System/src/Plugin/PluginManifest.cs | 2 +- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 0336e70..bb4c435 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,9 @@ --- 2023.05.17 - V4.3.2 +-- 2023.05.18 - V4.3.3 + +- fix: Threading problems +- fix: All player load was full bad and caused too much resource usage on map changes + +-- 2023.05.18 - V4.3.2 - fix: Connect message shown even if its disabled - fix: Placeholder replaced error logs diff --git a/K4-System/src/Plugin/PluginDatabase.cs b/K4-System/src/Plugin/PluginDatabase.cs index 3231407..1d39d8c 100644 --- a/K4-System/src/Plugin/PluginDatabase.cs +++ b/K4-System/src/Plugin/PluginDatabase.cs @@ -369,7 +369,10 @@ LEFT JOIN foreach (var row in rows) { - LoadPlayerRowToCache(k4player, row, false); + Server.NextFrame(() => + { + LoadPlayerRowToCache(k4player, row, false); + }); } } } @@ -393,6 +396,7 @@ private void LoadAllPlayersCache() } string combinedQuery = $@"SELECT + r.`steam_id`, r.`points`, s.`kills`, s.`firstblood`, @@ -466,14 +470,14 @@ public async Task LoadAllPlayersCacheAsync(string combinedQuery) string steamId = row.steam_id; K4Player? k4player = K4Players.FirstOrDefault(p => p.SteamID == ulong.Parse(steamId)); - if (k4player is null) - continue; - - Server.NextFrame(() => + if (k4player != null) { - if (k4player.IsValid && k4player.IsPlayer) - LoadPlayerRowToCache(k4player, row, true); - }); + Server.NextFrame(() => + { + if (k4player.IsValid && k4player.IsPlayer) + LoadPlayerRowToCache(k4player, row, true); + }); + } } } } diff --git a/K4-System/src/Plugin/PluginManifest.cs b/K4-System/src/Plugin/PluginManifest.cs index fd15b94..e956c32 100644 --- a/K4-System/src/Plugin/PluginManifest.cs +++ b/K4-System/src/Plugin/PluginManifest.cs @@ -10,7 +10,7 @@ public sealed partial class Plugin : BasePlugin public override string ModuleAuthor => "K4ryuu"; - public override string ModuleVersion => "4.3.2 " + + public override string ModuleVersion => "4.3.3 " + #if RELEASE "(release)"; #else