Skip to content

Commit

Permalink
1.4.1a
Browse files Browse the repository at this point in the history
- Minor changes
  • Loading branch information
daffyyyy committed Apr 28, 2024
1 parent 806b503 commit aefa6c6
Show file tree
Hide file tree
Showing 28 changed files with 1,270 additions and 1,353 deletions.
13 changes: 13 additions & 0 deletions .idea/.idea.CS2-SimpleAdmin/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/.idea.CS2-SimpleAdmin/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/.idea.CS2-SimpleAdmin/.idea/sqldialects.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/.idea.CS2-SimpleAdmin/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions CS2-SimpleAdmin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin

public static IStringLocalizer? _localizer;
public static Dictionary<string, int> voteAnswers = [];
public static ConcurrentBag<int> godPlayers = [];
public static ConcurrentBag<int> silentPlayers = [];
public static ConcurrentBag<string> bannedPlayers = [];
public static bool TagsDetected = false;
private static ConcurrentBag<int> godPlayers = [];
private static ConcurrentBag<int> silentPlayers = [];
private static ConcurrentBag<string> bannedPlayers = [];
private static bool TagsDetected = false;
public static bool voteInProgress = false;
public static int? ServerId = null;

Expand Down Expand Up @@ -52,7 +52,7 @@ public override void Load(bool hotReload)
OnMapStart(string.Empty);
}

CBasePlayerController_SetPawnFunc = new(GameData.GetSignature("CBasePlayerController_SetPawn"));
CBasePlayerController_SetPawnFunc = new MemoryFunctionVoid<CBasePlayerController, CCSPlayerPawn, bool, bool>(GameData.GetSignature("CBasePlayerController_SetPawn"));
}

public void OnConfigParsed(CS2_SimpleAdminConfig config)
Expand Down Expand Up @@ -132,14 +132,14 @@ public void OnConfigParsed(CS2_SimpleAdminConfig config)
_localizer = Localizer;

if (!string.IsNullOrEmpty(Config.Discord.DiscordLogWebhook))
_discordWebhookClientLog = new(Config.Discord.DiscordLogWebhook);
_discordWebhookClientLog = new DiscordWebhookClient(Config.Discord.DiscordLogWebhook);
if (!string.IsNullOrEmpty(Config.Discord.DiscordPenaltyWebhook))
_discordWebhookClientPenalty = new(Config.Discord.DiscordPenaltyWebhook);
_discordWebhookClientPenalty = new DiscordWebhookClient(Config.Discord.DiscordPenaltyWebhook);
}

private static TargetResult? GetTarget(CommandInfo command)
{
TargetResult matches = command.GetArgTargetResult(1);
var matches = command.GetArgTargetResult(1);

if (!matches.Any())
{
Expand All @@ -162,13 +162,13 @@ public static void RemoveFromConcurrentBag(ConcurrentBag<int> bag, int playerSlo
List<int> tempList = [];
while (!bag.IsEmpty)
{
if (bag.TryTake(out int item) && item != playerSlot)
if (bag.TryTake(out var item) && item != playerSlot)
{
tempList.Add(item);
}
}

foreach (int item in tempList)
foreach (var item in tempList)
{
bag.Add(item);
}
Expand Down
Loading

0 comments on commit aefa6c6

Please sign in to comment.