Compare commits

...

13 Commits

Author SHA1 Message Date
Dawid Bepierszcz
a1fa8f37c7 Merge pull request #345 from daffyyyy/main
Website fix
2024-10-24 21:06:49 +02:00
Dawid Bepierszcz
475e91e779 Merge branch 'main' of https://github.com/daffyyyy/cs2-WeaponPaints 2024-10-24 21:00:59 +02:00
Dawid Bepierszcz
a136f5472e Website fix
- Website fix (still missing new features)
2024-10-24 21:00:44 +02:00
Dawid Bepierszcz
b5d7f12024 Merge pull request #344 from daffyyyy/main
3.2b
2024-10-24 18:04:32 +02:00
Dawid Bepierszcz
9ec64e346f Merge branch 'Nereziel:main' into main 2024-10-24 18:02:40 +02:00
Dawid Bepierszcz
b4dc20523c Merge branch 'main' of https://github.com/daffyyyy/cs2-WeaponPaints 2024-10-24 18:02:28 +02:00
Dawid Bepierszcz
8891ce815e 3.2b
- Schema for stickers when using custom coords
- Fixed some not found team key
2024-10-24 18:02:25 +02:00
Dawid Bepierszcz
ea9963b920 Merge pull request #342 from daffyyyy/main
3.1a
2024-10-24 14:16:22 +02:00
Dawid Bepierszcz
4a5a08aca9 Merge branch 'Nereziel:main' into main 2024-10-24 14:14:32 +02:00
Dawid Bepierszcz
573604a9d9 3.1a
- Possibility to change menu type by config

`MenuType:`
- selectable (each player can change menu type by command css_menus)
- dynamic (center + keys)
- center (center + chat)
- chat
- console
2024-10-24 14:14:10 +02:00
Dawid Bepierszcz
3929a43e46 Merge pull request #336 from daffyyyy/main
3.0c
2024-10-21 21:05:20 +02:00
Dawid Bepierszcz
f7f18b7919 Merge branch 'Nereziel:main' into main 2024-10-21 21:04:08 +02:00
Dawid Bepierszcz
0d110d83c7 3.0c
- Temp fix for knife (one weapon)
- Fix for stattrak saving
2024-10-21 21:01:38 +02:00
1746 changed files with 154 additions and 85 deletions

View File

@@ -181,7 +181,7 @@ public partial class WeaponPaints
.Where(pair => pair.Key.StartsWith("weapon_knife") || pair.Key.StartsWith("weapon_bayonet"))
.ToDictionary(pair => pair.Key, pair => pair.Value);
var giveItemMenu = MenuApi?.NewMenu(Localizer["wp_knife_menu_title"]);
var giveItemMenu = Utility.CreateMenu(Localizer["wp_knife_menu_title"]);
var handleGive = (CCSPlayerController player, ChatMenuOption option) =>
{
@@ -265,7 +265,7 @@ public partial class WeaponPaints
.Except([new KeyValuePair<string, string>("weapon_knife", "Default Knife")])
.ToDictionary(kvp => kvp.Value, kvp => kvp.Key);
var weaponSelectionMenu = MenuApi?.NewMenu(Localizer["wp_skin_menu_weapon_title"]);
var weaponSelectionMenu = Utility.CreateMenu(Localizer["wp_skin_menu_weapon_title"]);
// Function to handle skin selection for a specific weapon
var handleWeaponSelection = (CCSPlayerController? player, ChatMenuOption option) =>
@@ -280,7 +280,7 @@ public partial class WeaponPaints
weaponName?.ToString() == selectedWeaponClassname
)?.ToList();
var skinSubMenu = MenuApi?.NewMenu(Localizer["wp_skin_menu_skin_title", selectedWeapon]);
var skinSubMenu = Utility.CreateMenu(Localizer["wp_skin_menu_skin_title", selectedWeapon]);
// Function to handle skin selection for the chosen weapon
var handleSkinSelection = (CCSPlayerController p, ChatMenuOption opt) =>
@@ -416,7 +416,7 @@ public partial class WeaponPaints
private void SetupGlovesMenu()
{
var glovesSelectionMenu = MenuApi?.NewMenu(Localizer["wp_glove_menu_title"]);
var glovesSelectionMenu = Utility.CreateMenu(Localizer["wp_glove_menu_title"]);
if (glovesSelectionMenu == null) return;
glovesSelectionMenu.PostSelectAction = PostSelectAction.Close;
@@ -625,7 +625,7 @@ public partial class WeaponPaints
if (!CommandsCooldown.TryGetValue(player.Slot, out DateTime cooldownEndTime) ||
DateTime.UtcNow >= (CommandsCooldown.TryGetValue(player.Slot, out cooldownEndTime) ? cooldownEndTime : DateTime.UtcNow))
{
var agentsSelectionMenu = MenuApi?.NewMenu(Localizer["wp_agent_menu_title"]);
var agentsSelectionMenu = Utility.CreateMenu(Localizer["wp_agent_menu_title"]);
if (agentsSelectionMenu == null) return;
agentsSelectionMenu.PostSelectAction = PostSelectAction.Close;
@@ -665,7 +665,7 @@ public partial class WeaponPaints
private void SetupMusicMenu()
{
var musicSelectionMenu = MenuApi?.NewMenu(Localizer["wp_music_menu_title"]);
var musicSelectionMenu = Utility.CreateMenu(Localizer["wp_music_menu_title"]);
if (musicSelectionMenu == null) return;
musicSelectionMenu.PostSelectAction = PostSelectAction.Close;
@@ -800,7 +800,7 @@ public partial class WeaponPaints
private void SetupPinsMenu()
{
var pinsSelectionMenu = MenuApi?.NewMenu(Localizer["wp_pins_menu_title"]);
var pinsSelectionMenu = Utility.CreateMenu(Localizer["wp_pins_menu_title"]);
if (pinsSelectionMenu == null) return;
pinsSelectionMenu.PostSelectAction = PostSelectAction.Close;

View File

@@ -99,5 +99,8 @@ namespace WeaponPaints
[JsonPropertyName("Additional")]
public Additional Additional { get; set; } = new();
[JsonPropertyName("MenuType")]
public string MenuType { get; set; } = "selectable";
}
}

View File

@@ -2,6 +2,7 @@
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Core.Attributes.Registration;
using CounterStrikeSharp.API.Modules.Entities;
using CounterStrikeSharp.API.Modules.Entities.Constants;
using CounterStrikeSharp.API.Modules.Memory;
using CounterStrikeSharp.API.Modules.Memory.DynamicFunctions;
@@ -79,15 +80,17 @@ namespace WeaponPaints
IpAddress = player.IpAddress?.Split(":")[0]
};
if (WeaponSync != null)
Task.Run(async () =>
{
_ = Task.Run(async () => await WeaponSync.SyncStatTrakToDatabase(playerInfo));
}
if (WeaponSync != null)
await WeaponSync.SyncStatTrakToDatabase(playerInfo);
if (Config.Additional.SkinEnabled)
{
GPlayerWeaponsInfo.TryRemove(player.Slot, out _);
}
});
if (Config.Additional.SkinEnabled)
{
GPlayerWeaponsInfo.TryRemove(player.Slot, out _);
}
if (Config.Additional.KnifeEnabled)
{
GPlayersKnife.TryRemove(player.Slot, out _);
@@ -202,7 +205,17 @@ namespace WeaponPaints
var player = GetPlayerFromItemServices(itemServices);
if (player != null)
{
var weaponServices = player.PlayerPawn.Value?.WeaponServices;
GivePlayerWeaponSkin(player, weapon);
if (weaponServices is { MyWeapons.Count: 1 })
{
// player.GiveNamedItem(CsItem.Healthshot);
// newWeapon.AddEntityIOEvent("Kill", newWeapon, null, "", 0.1f);
}
}
}
catch { }
@@ -274,9 +287,10 @@ namespace WeaponPaints
[GameEventHandler]
public HookResult OnItemPickup(EventItemPickup @event, GameEventInfo _)
{
if (!IsWindows) return HookResult.Continue;
// if (!IsWindows) return HookResult.Continue;
var player = @event.Userid;
if (!@event.Item.Contains("knife")) return HookResult.Continue;
if (player != null && player is { IsValid: true, Connected: PlayerConnectedState.PlayerConnected, PawnIsAlive: true, PlayerPawn.IsValid: true })
{
GiveOnItemPickup(player);
@@ -336,8 +350,7 @@ namespace WeaponPaints
if (Config.Additional.ShowSkinImage)
RegisterListener<Listeners.OnTick>(OnTick);
if (!IsWindows)
VirtualFunctions.GiveNamedItemFunc.Hook(OnGiveNamedItemPost, HookMode.Post);
VirtualFunctions.GiveNamedItemFunc.Hook(OnGiveNamedItemPost, HookMode.Post);
}
}
}

View File

@@ -1,6 +1,8 @@
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Core.Translations;
using CounterStrikeSharp.API.Modules.Menu;
using Dapper;
using MenuManager;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
@@ -188,10 +190,32 @@ namespace WeaponPaints
Console.WriteLine("[WeaponPaints] " + message);
Console.ResetColor();
}
internal static string ReplaceTags(string message)
internal static IMenu? CreateMenu(string title)
{
return message.ReplaceColorTags();
var menuType = WeaponPaints.Instance.Config.MenuType.ToLower();
var menu = menuType switch
{
_ when menuType.Equals("selectable", StringComparison.CurrentCultureIgnoreCase) =>
WeaponPaints.MenuApi?.NewMenu(title),
_ when menuType.Equals("dynamic", StringComparison.CurrentCultureIgnoreCase) =>
WeaponPaints.MenuApi?.NewMenuForcetype(title, MenuType.ButtonMenu),
_ when menuType.Equals("center", StringComparison.CurrentCultureIgnoreCase) =>
WeaponPaints.MenuApi?.NewMenuForcetype(title, MenuType.CenterMenu),
_ when menuType.Equals("chat", StringComparison.CurrentCultureIgnoreCase) =>
WeaponPaints.MenuApi?.NewMenuForcetype(title, MenuType.ChatMenu),
_ when menuType.Equals("console", StringComparison.CurrentCultureIgnoreCase) =>
WeaponPaints.MenuApi?.NewMenuForcetype(title, MenuType.ConsoleMenu),
_ => WeaponPaints.MenuApi?.NewMenu(title)
};
return menu;
}
internal static async Task CheckVersion(string version, ILogger logger)

View File

@@ -1 +1 @@
3.0b
3.1b

View File

@@ -77,7 +77,8 @@ public partial class WeaponPaints
internal static readonly ConcurrentDictionary<int, ConcurrentDictionary<CsTeam, ushort>> GPlayersGlove = new();
internal static readonly ConcurrentDictionary<int, ConcurrentDictionary<CsTeam, ushort>> GPlayersMusic = new();
internal static readonly ConcurrentDictionary<int, ConcurrentDictionary<CsTeam, ushort>> GPlayersPin = new();
public static readonly ConcurrentDictionary<int, (string? CT, string? T)> GPlayersAgent = new();
internal static readonly ConcurrentDictionary<int, (string? CT, string? T)> GPlayersAgent = new();
internal static readonly Dictionary<int, int> GPlayersKnivesPickup = [];
internal static readonly ConcurrentDictionary<int, ConcurrentDictionary<CsTeam, ConcurrentDictionary<int, WeaponInfo>>> GPlayerWeaponsInfo = new();
internal static List<JObject> SkinsList = [];
internal static List<JObject> PinsList = [];
@@ -92,7 +93,7 @@ public partial class WeaponPaints
internal static Database? Database;
private static readonly MemoryFunctionVoid<nint, string, float> CAttributeListSetOrAddAttributeValueByName = new(GameData.GetSignature("CAttributeList_SetOrAddAttributeValueByName"));
private static readonly MemoryFunctionWithReturn<nint, string, int, int> SetBodygroupFunc = new(
GameData.GetSignature("CBaseModelEntity_SetBodygroup"));

View File

@@ -20,8 +20,10 @@ namespace WeaponPaints
bool isKnife = weapon.DesignerName.Contains("knife") || weapon.DesignerName.Contains("bayonet");
if (isKnife && !GPlayersKnife.ContainsKey(player.Slot) ||
isKnife && GPlayersKnife[player.Slot][player.Team] == "weapon_knife") return;
if (isKnife && (!GPlayersKnife.ContainsKey(player.Slot) ||
!GPlayersKnife[player.Slot].ContainsKey(player.Team) ||
GPlayersKnife[player.Slot][player.Team] == "weapon_knife"))
return;
if (isKnife)
{
@@ -52,7 +54,9 @@ namespace WeaponPaints
bool isLegacyModel;
if (_config.Additional.GiveRandomSkin &&
!GPlayerWeaponsInfo[player.Slot][player.Team].ContainsKey(weaponDefIndex))
GPlayerWeaponsInfo.ContainsKey(player.Slot) &&
(!GPlayerWeaponsInfo[player.Slot].ContainsKey(player.Team) ||
!GPlayerWeaponsInfo[player.Slot][player.Team].ContainsKey(weaponDefIndex)))
{
// Random skins
weapon.FallbackPaintKit = GetRandomPaint(weaponDefIndex);
@@ -103,21 +107,14 @@ namespace WeaponPaints
weapon.AttributeManager.Item.CustomName = weaponInfo.Nametag;
weapon.FallbackPaintKit = weaponInfo.Paint;
if (weaponInfo is { Paint: 38, Seed: 0 })
{
weapon.FallbackSeed = _fadeSeed++;
}
else
{
weapon.FallbackSeed = weaponInfo.Seed;
}
weapon.FallbackSeed = weaponInfo is { Paint: 38, Seed: 0 } ? _fadeSeed++ : weaponInfo.Seed;
weapon.FallbackWear = weaponInfo.Wear;
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle, "set item texture prefab", weapon.FallbackPaintKit);
if (weaponInfo.StatTrak)
{
weapon.AttributeManager.Item.EntityQuality = 7;
weapon.AttributeManager.Item.EntityQuality = 9;
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle, "kill eater", ViewAsFloat((uint)weaponInfo.StatTrakCount));
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle, "kill eater score type", 0);
@@ -131,8 +128,6 @@ namespace WeaponPaints
if (fallbackPaintKit == 0)
return;
if (isKnife) return;
if (weaponInfo.KeyChain != null) SetKeychain(player, weapon);
if (weaponInfo.Stickers.Count > 0) SetStickers(player, weapon);
@@ -143,6 +138,7 @@ namespace WeaponPaints
.ToList();
isLegacyModel = skinInfo.Count <= 0 || skinInfo[0].Value<bool>("legacy_model");
UpdatePlayerWeaponMeshGroupMask(player, weapon, isLegacyModel);
}
@@ -187,15 +183,13 @@ namespace WeaponPaints
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
$"sticker slot {stickerSlot} id", ViewAsFloat(sticker.Id));
// CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
// $"sticker slot {stickerSlot} schema", stickerSlot);
// if (stickerSlot == 5)
// {
if (sticker.OffsetX != 0 || sticker.OffsetY != 0)
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
$"sticker slot {stickerSlot} schema", 0);
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
$"sticker slot {stickerSlot} offset x", sticker.OffsetX);
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
$"sticker slot {stickerSlot} offset y", sticker.OffsetY);
// }
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
$"sticker slot {stickerSlot} wear", sticker.Wear);
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
@@ -218,8 +212,11 @@ namespace WeaponPaints
int weaponDefIndex = weapon.AttributeManager.Item.ItemDefinitionIndex;
if (!GPlayerWeaponsInfo.TryGetValue(player.Slot, out var playerWeaponsInfo) ||
!playerWeaponsInfo[player.Team].TryGetValue(weaponDefIndex, out var value) ||
value.KeyChain == null) return;
!playerWeaponsInfo.TryGetValue(player.Team, out var teamWeaponsInfo) ||
!teamWeaponsInfo.TryGetValue(weaponDefIndex, out var value) ||
value.KeyChain == null)
return;
var keyChain = value.KeyChain;
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
@@ -242,6 +239,7 @@ namespace WeaponPaints
//string knifeToGive = (CsTeam)player.TeamNum == CsTeam.Terrorist ? "weapon_knife_t" : "weapon_knife";
player.GiveNamedItem(CsItem.Knife);
Utilities.SetStateChanged(player, "CCSPlayerController", "m_pInventoryServices");
}
private static bool PlayerHasKnife(CCSPlayerController? player)
@@ -284,6 +282,8 @@ namespace WeaponPaints
if (player.Team is CsTeam.None or CsTeam.Spectator)
return;
var hasKnife = false;
Dictionary<string, List<(int, int)>> weaponsWithAmmo = [];
foreach (var weapon in weapons)
@@ -291,7 +291,7 @@ namespace WeaponPaints
if (!weapon.IsValid || weapon.Value == null ||
!weapon.Value.IsValid || !weapon.Value.DesignerName.Contains("weapon_"))
continue;
CCSWeaponBaseGun gun = weapon.Value.As<CCSWeaponBaseGun>();
if (weapon.Value.Entity == null) continue;
@@ -330,6 +330,7 @@ namespace WeaponPaints
if (weaponData.GearSlot == gear_slot_t.GEAR_SLOT_KNIFE)
{
weapon.Value?.AddEntityIOEvent("Kill", weapon.Value, null, "", 0.1f);
hasKnife = true;
}
}
catch (Exception ex)
@@ -341,9 +342,16 @@ namespace WeaponPaints
AddTimer(0.23f, () =>
{
if (!_gBCommandsAllowed) return;
if (!PlayerHasKnife(player))
GiveKnifeToPlayer(player);
if (!PlayerHasKnife(player) && hasKnife)
{
var newKnife = new CBasePlayerWeapon(player.GiveNamedItem(CsItem.Knife));
newKnife.AddEntityIOEvent("Kill", newKnife, null, "", 0.01f);
var newWeapon = new CBasePlayerWeapon(player.GiveNamedItem(CsItem.USP));
player.GiveNamedItem(CsItem.Knife);
player.ExecuteClientCommand("slot3");
newWeapon.AddEntityIOEvent("Kill", newWeapon, null, "", 0.01f);
}
foreach (var entry in weaponsWithAmmo)
{
@@ -396,9 +404,12 @@ namespace WeaponPaints
return;
if (!GPlayersGlove.TryGetValue(player.Slot, out var gloveInfo) ||
!gloveInfo.TryGetValue(player.Team, out var gloveId) || gloveId == 0) return;
WeaponInfo weaponInfo = GPlayerWeaponsInfo[player.Slot][player.Team][gloveId];
!gloveInfo.TryGetValue(player.Team, out var gloveId) ||
gloveId == 0 ||
!GPlayerWeaponsInfo.TryGetValue(player.Slot, out var playerWeaponsInfo) ||
!playerWeaponsInfo.TryGetValue(player.Team, out var teamWeaponsInfo) ||
!teamWeaponsInfo.TryGetValue(gloveId, out var weaponInfo))
return;
item.ItemDefinitionIndex = gloveId;
item.ItemIDLow = 16384 & 0xFFFFFFFF;
@@ -462,6 +473,7 @@ namespace WeaponPaints
var viewModel = GetPlayerViewModel(player);
if (viewModel == null || viewModel.Weapon.Value == null ||
viewModel.Weapon.Value.Index != weapon.Index) return;
UpdateWeaponMeshGroupMask(viewModel, isLegacy);
Utilities.SetStateChanged(viewModel, "CBaseEntity", "m_CBodyComponent");
}
@@ -525,13 +537,22 @@ namespace WeaponPaints
var myWeapons = pawn.WeaponServices?.MyWeapons;
if (myWeapons == null) return;
foreach (var handle in myWeapons)
{
var weapon = handle.Value;
if (weapon != null && weapon.DesignerName.Contains("knife"))
if (weapon == null || !weapon.IsValid) continue;
if (myWeapons.Count == 1)
{
GivePlayerWeaponSkin(player, weapon);
var newWeapon = new CBasePlayerWeapon(player.GiveNamedItem(CsItem.USP));
weapon.AddEntityIOEvent("Kill", weapon, null, "", 0.01f);
player.GiveNamedItem(CsItem.Knife);
player.ExecuteClientCommand("slot3");
newWeapon.AddEntityIOEvent("Kill", newWeapon, null, "", 0.01f);
}
GivePlayerWeaponSkin(player, weapon);
}
}

View File

@@ -1,6 +1,7 @@
using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Core.Attributes;
using CounterStrikeSharp.API.Modules.Memory.DynamicFunctions;
using Microsoft.Extensions.Logging;
using MySqlConnector;
@@ -16,7 +17,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 => "3.0b";
public override string ModuleVersion => "3.1b";
public override void Load(bool hotReload)
{
@@ -39,6 +40,7 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
!string.IsNullOrEmpty(player.IpAddress) && player is
{ IsBot: false, Connected: PlayerConnectedState.PlayerConnected }))
{
GPlayersKnivesPickup[player.Slot] = 0;
var playerInfo = new PlayerInfo
{
UserId = player.UserId,

View File

@@ -3,7 +3,6 @@ using MySqlConnector;
using System.Collections.Concurrent;
using CounterStrikeSharp.API.Modules.Utils;
namespace WeaponPaints;
internal class WeaponSynchronization
@@ -50,7 +49,7 @@ internal class WeaponSynchronization
if (!_config.Additional.KnifeEnabled || string.IsNullOrEmpty(player?.SteamId))
return;
const string query = "SELECT `knife`, `weapon_team` FROM `wp_player_knife` WHERE `steamid` = @steamid";
const string query = "SELECT `knife`, `weapon_team` FROM `wp_player_knife` WHERE `steamid` = @steamid ORDER BY `weapon_team` ASC";
var rows = connection.Query<dynamic>(query, new { steamid = player.SteamId }); // Retrieve all records for the player
foreach (var row in rows)
@@ -61,9 +60,9 @@ internal class WeaponSynchronization
// Determine the weapon team based on the query result
CsTeam weaponTeam = (int)row.weapon_team switch
{
0 => CsTeam.None,
2 => CsTeam.Terrorist,
_ => CsTeam.CounterTerrorist
3 => CsTeam.CounterTerrorist,
_ => CsTeam.None,
};
// Get or create entries for the players slot
@@ -95,7 +94,7 @@ internal class WeaponSynchronization
if (!_config.Additional.GloveEnabled || string.IsNullOrEmpty(player?.SteamId))
return;
const string query = "SELECT `weapon_defindex`, `weapon_team` FROM `wp_player_gloves` WHERE `steamid` = @steamid";
const string query = "SELECT `weapon_defindex`, `weapon_team` FROM `wp_player_gloves` WHERE `steamid` = @steamid ORDER BY `weapon_team` ASC";
var rows = connection.Query<dynamic>(query, new { steamid = player.SteamId }); // Retrieve all records for the player
foreach (var row in rows)
@@ -106,9 +105,9 @@ internal class WeaponSynchronization
var playerGloves = WeaponPaints.GPlayersGlove.GetOrAdd(player.Slot, _ => new ConcurrentDictionary<CsTeam, ushort>());
CsTeam weaponTeam = (int)row.weapon_team switch
{
0 => CsTeam.None,
2 => CsTeam.Terrorist,
_ => CsTeam.CounterTerrorist
3 => CsTeam.CounterTerrorist,
_ => CsTeam.None,
};
// Get or create entries for the players slot
@@ -172,28 +171,27 @@ internal class WeaponSynchronization
// var weaponInfos = new ConcurrentDictionary<int, WeaponInfo>();
const string query = "SELECT * FROM `wp_player_skins` WHERE `steamid` = @steamid";
const string query = "SELECT * FROM `wp_player_skins` WHERE `steamid` = @steamid ORDER BY `weapon_team` ASC";
var playerSkins = connection.Query<dynamic>(query, new { steamid = player.SteamId });
foreach (var row in playerSkins)
{
int weaponDefIndex = row?.weapon_defindex ?? 0;
int weaponPaintId = row?.weapon_paint_id ?? 0;
float weaponWear = row?.weapon_wear ?? 0f;
int weaponSeed = row?.weapon_seed ?? 0;
string weaponNameTag = row?.weapon_nametag ?? "";
bool weaponStatTrak = row?.weapon_stattrak ?? false;
int weaponStatTrakCount = row?.weapon_stattrak_count ?? 0;
int weaponDefIndex = row.weapon_defindex ?? 0;
int weaponPaintId = row.weapon_paint_id ?? 0;
float weaponWear = row.weapon_wear ?? 0f;
int weaponSeed = row.weapon_seed ?? 0;
string weaponNameTag = row.weapon_nametag ?? "";
bool weaponStatTrak = row.weapon_stattrak ?? false;
int weaponStatTrakCount = row.weapon_stattrak_count ?? 0;
CsTeam weaponTeam = row?.weapon_team switch
CsTeam weaponTeam = row.weapon_team switch
{
null => CsTeam.None,
0 => CsTeam.None,
2 => CsTeam.Terrorist,
_ => CsTeam.CounterTerrorist
3 => CsTeam.CounterTerrorist,
_ => CsTeam.None,
};
string[]? keyChainParts = row?.weapon_keychain?.ToString().Split(';');
string[]? keyChainParts = row.weapon_keychain?.ToString().Split(';');
KeyChainInfo keyChainInfo = new KeyChainInfo();
@@ -303,7 +301,7 @@ internal class WeaponSynchronization
if (!_config.Additional.MusicEnabled || string.IsNullOrEmpty(player?.SteamId))
return;
const string query = "SELECT `music_id`, `weapon_team` FROM `wp_player_music` WHERE `steamid` = @steamid";
const string query = "SELECT `music_id`, `weapon_team` FROM `wp_player_music` WHERE `steamid` = @steamid ORDER BY `weapon_team` ASC";
var rows = connection.Query<dynamic>(query, new { steamid = player.SteamId }); // Retrieve all records for the player
foreach (var row in rows)
@@ -314,9 +312,9 @@ internal class WeaponSynchronization
// Determine the weapon team based on the query result
CsTeam weaponTeam = (int)row.weapon_team switch
{
0 => CsTeam.None,
2 => CsTeam.Terrorist,
_ => CsTeam.CounterTerrorist
3 => CsTeam.CounterTerrorist,
_ => CsTeam.None,
};
// Get or create entries for the players slot
@@ -348,7 +346,7 @@ internal class WeaponSynchronization
if (string.IsNullOrEmpty(player?.SteamId))
return;
const string query = "SELECT `id`, `weapon_team` FROM `wp_player_pins` WHERE `steamid` = @steamid";
const string query = "SELECT `id`, `weapon_team` FROM `wp_player_pins` WHERE `steamid` = @steamid ORDER BY `weapon_team` ASC";
var rows = connection.Query<dynamic>(query, new { steamid = player.SteamId }); // Retrieve all records for the player
foreach (var row in rows)
@@ -359,9 +357,9 @@ internal class WeaponSynchronization
// Determine the weapon team based on the query result
CsTeam weaponTeam = (int)row.weapon_team switch
{
0 => CsTeam.None,
2 => CsTeam.Terrorist,
_ => CsTeam.CounterTerrorist
3 => CsTeam.CounterTerrorist,
_ => CsTeam.None,
};
// Get or create entries for the players slot

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 KiB

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Some files were not shown because too many files have changed in this diff Show More