diff --git a/Events.cs b/Events.cs index e7477f28..608a11ba 100644 --- a/Events.cs +++ b/Events.cs @@ -305,6 +305,8 @@ public void OnEntitySpawned(CEntityInstance entity) private void OnTick() { + if (!Config.Additional.ShowSkinImage) return; + foreach (var player in Utilities.GetPlayers().Where(p => p is not null && p.IsValid && p.PlayerPawn != null && p.PlayerPawn.IsValid && (LifeState_t)p.LifeState == LifeState_t.LIFE_ALIVE && p.SteamID.ToString().Length == 17 @@ -312,7 +314,7 @@ private void OnTick() ) ) { - if (Config.Additional.ShowSkinImage && PlayerWeaponImage.TryGetValue(player.Slot, out string? value) && !string.IsNullOrEmpty(value)) + if (PlayerWeaponImage.TryGetValue(player.Slot, out string? value) && !string.IsNullOrEmpty(value)) { player.PrintToCenterHtml("".Replace("{PATH}", value)); } diff --git a/VERSION b/VERSION index 2fcdc9e8..d580a15f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.3b \ No newline at end of file +2.3c \ No newline at end of file diff --git a/WeaponPaints.cs b/WeaponPaints.cs index 8da76f0f..4bec9b3f 100644 --- a/WeaponPaints.cs +++ b/WeaponPaints.cs @@ -160,7 +160,7 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig "Nereziel & daffyy"; public override string ModuleDescription => "Skin, gloves, agents and knife selector, standalone and web-based"; public override string ModuleName => "WeaponPaints"; - public override string ModuleVersion => "2.3b"; + public override string ModuleVersion => "2.3c"; public static WeaponPaintsConfig GetWeaponPaintsConfig() { @@ -258,7 +258,9 @@ public void OnConfigParsed(WeaponPaintsConfig config) Password = config.DatabasePassword, Database = config.DatabaseName, Port = (uint)config.DatabasePort, - Pooling = true + Pooling = true, + MaximumPoolSize = 640, + ConnectionReset = false }; _database = new(builder.ConnectionString); diff --git a/WeaponPaints.csproj b/WeaponPaints.csproj index a3fbf5e7..07b7ffb3 100644 --- a/WeaponPaints.csproj +++ b/WeaponPaints.csproj @@ -11,7 +11,7 @@ - + diff --git a/WeaponSynchronization.cs b/WeaponSynchronization.cs index eb9e3f6b..90dcce10 100644 --- a/WeaponSynchronization.cs +++ b/WeaponSynchronization.cs @@ -233,6 +233,7 @@ internal async Task SyncWeaponPaintsToDatabase(PlayerInfo player) string query; object parameters; + if (existingRecordCount > 0) { query = "UPDATE `wp_player_skins` SET `weapon_paint_id` = @paintId, `weapon_wear` = @wear, `weapon_seed` = @seed WHERE `steamid` = @steamid AND `weapon_defindex` = @weaponDefIndex";