Skip to content

Commit

Permalink
Merge pull request #226 from daffyyyy/main
Browse files Browse the repository at this point in the history
2.3c
  • Loading branch information
daffyyyy authored Mar 27, 2024
2 parents cfb49e1 + 6a2d28c commit f99c9b2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,16 @@ 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
&& !p.IsBot && !p.IsHLTV && p.Connected == PlayerConnectedState.PlayerConnected
)
)
{
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("<img src='{PATH}'</img>".Replace("{PATH}", value));
}
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3b
2.3c
6 changes: 4 additions & 2 deletions WeaponPaints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
public override string ModuleAuthor => "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()
{
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion WeaponPaints.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ItemGroup>
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.193" />
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="MySqlConnector" Version="2.3.5" />
<PackageReference Include="MySqlConnector" Version="2.3.6" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

Expand Down
1 change: 1 addition & 0 deletions WeaponSynchronization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit f99c9b2

Please sign in to comment.