mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-02-18 10:43:22 +00:00
Removed the use of skin update using names due to vulnerability with the all command
This commit is contained in:
15
Commands.cs
15
Commands.cs
@@ -162,17 +162,16 @@ public partial class WeaponPaints
|
|||||||
|
|
||||||
if (string.IsNullOrEmpty(args))
|
if (string.IsNullOrEmpty(args))
|
||||||
{
|
{
|
||||||
Console.WriteLine("[WeaponPaints] Usage: wp_refresh <player_name|steamid>");
|
Console.WriteLine("[WeaponPaints] Usage: wp_refresh <steamid64|all>");
|
||||||
Console.WriteLine("[WeaponPaints] Examples:");
|
Console.WriteLine("[WeaponPaints] Examples:");
|
||||||
Console.WriteLine("[WeaponPaints] wp_refresh - Refresh skins for all players");
|
Console.WriteLine("[WeaponPaints] wp_refresh all - Refresh skins for all players");
|
||||||
Console.WriteLine("[WeaponPaints] wp_refresh PlayerName - Refresh skins for a specific player");
|
Console.WriteLine("[WeaponPaints] wp_refresh 76561198012345678 - Refresh skins by SteamID64");
|
||||||
Console.WriteLine("[WeaponPaints] wp_refresh STEAM_1:0:123456789 - Refresh skins by SteamID");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var targetPlayers = new List<CCSPlayerController>();
|
var targetPlayers = new List<CCSPlayerController>();
|
||||||
|
|
||||||
if (args.ToLower() == "")
|
if (args.Equals("all", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
targetPlayers = Utilities.GetPlayers().Where(p =>
|
targetPlayers = Utilities.GetPlayers().Where(p =>
|
||||||
p != null && p.IsValid && !p.IsBot && p.UserId != null).ToList();
|
p != null && p.IsValid && !p.IsBot && p.UserId != null).ToList();
|
||||||
@@ -189,12 +188,11 @@ public partial class WeaponPaints
|
|||||||
{
|
{
|
||||||
var foundPlayer = Utilities.GetPlayers().FirstOrDefault(p =>
|
var foundPlayer = Utilities.GetPlayers().FirstOrDefault(p =>
|
||||||
p != null && p.IsValid && !p.IsBot && p.UserId != null &&
|
p != null && p.IsValid && !p.IsBot && p.UserId != null &&
|
||||||
(p.PlayerName?.Contains(args, StringComparison.OrdinalIgnoreCase) == true ||
|
p.SteamID.ToString() == args);
|
||||||
p.SteamID.ToString() == args));
|
|
||||||
|
|
||||||
if (foundPlayer == null)
|
if (foundPlayer == null)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"[WeaponPaints] Player '{args}' not found.");
|
Console.WriteLine($"[WeaponPaints] Player with SteamID64 '{args}' not found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,6 +241,7 @@ public partial class WeaponPaints
|
|||||||
Console.WriteLine("[WeaponPaints] Refresh process completed.");
|
Console.WriteLine("[WeaponPaints] Refresh process completed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void OnCommandStattrak(CCSPlayerController? player, CommandInfo commandInfo)
|
private void OnCommandStattrak(CCSPlayerController? player, CommandInfo commandInfo)
|
||||||
{
|
{
|
||||||
if (player == null || !player.IsValid) return;
|
if (player == null || !player.IsValid) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user