- Fixed godmode
- Added logging commands to simpleadmin logs file
- Fixed votes?
- Added updating player_ip and player_name after connect with ban issued by css_addban
This commit is contained in:
Dawid Bepierszcz
2024-02-21 13:14:46 +01:00
parent 619bdfbb14
commit 5bf966f9cd
16 changed files with 213 additions and 88 deletions

View File

@@ -58,6 +58,7 @@ namespace CS2_SimpleAdmin
internal void Ban(CCSPlayerController? caller, CCSPlayerController player, int time, string reason, string? callerName = null, BanManager? banManager = null)
{
if (_database == null) return;
callerName ??= caller == null ? "Console" : caller.PlayerName;
banManager ??= new BanManager(_database, Config);
@@ -80,6 +81,8 @@ namespace CS2_SimpleAdmin
IpAddress = caller?.IpAddress?.Split(":")[0]
};
Helper.LogCommand(caller, $"css_ban {player?.SteamID} {time} {reason}");
Task.Run(async () =>
{
await banManager.BanPlayer(playerInfo, adminInfo, reason, time);
@@ -177,6 +180,8 @@ namespace CS2_SimpleAdmin
IpAddress = caller?.IpAddress?.Split(":")[0]
};
Helper.LogCommand(caller, command);
List<CCSPlayerController> matches = Helper.GetPlayerFromSteamid64(steamid);
if (matches.Count == 1)
{
@@ -281,6 +286,8 @@ namespace CS2_SimpleAdmin
IpAddress = caller?.IpAddress?.Split(":")[0]
};
Helper.LogCommand(caller, command);
int.TryParse(command.GetArg(2), out int time);
if (command.ArgCount >= 3 && command.GetArg(3).Length > 0)
@@ -375,6 +382,8 @@ namespace CS2_SimpleAdmin
_discordWebhookClientLog.SendMessageAsync(Helper.GenerateMessageDiscord(_localizer["sa_discord_log_command", $"[{callerName}]({communityUrl})", command.GetCommandString]));
}
Helper.LogCommand(caller, command);
string pattern = command.GetArg(1);
Database database = new Database(dbConnectionString);