fix issue with profanity plugin enabled check and add KickOnInfringingName setting

This commit is contained in:
RaidMax 2023-04-07 21:21:18 -05:00
parent 6bb97c7d83
commit 388434133b
2 changed files with 8 additions and 2 deletions

View File

@ -32,7 +32,7 @@ public class Plugin : IPluginV2
{ {
_configuration = configuration; _configuration = configuration;
if (_configuration?.EnableProfanityDeterment ?? false) if (!(_configuration?.EnableProfanityDeterment ?? false))
{ {
return; return;
} }
@ -97,7 +97,12 @@ public class Plugin : IPluginV2
private Task OnClientStateInitialized(ClientStateInitializeEvent clientEvent, CancellationToken token) private Task OnClientStateInitialized(ClientStateInitializeEvent clientEvent, CancellationToken token)
{ {
if (_configuration?.EnableProfanityDeterment ?? false) if (!(_configuration?.EnableProfanityDeterment ?? false))
{
return Task.CompletedTask;
}
if (!_configuration.KickOnInfringingName)
{ {
return Task.CompletedTask; return Task.CompletedTask;
} }

View File

@ -11,6 +11,7 @@ namespace IW4MAdmin.Plugins.ProfanityDeterment
public string ProfanityWarningMessage { get; set; } public string ProfanityWarningMessage { get; set; }
public string ProfanityKickMessage { get; set; } public string ProfanityKickMessage { get; set; }
public int KickAfterInfringementCount { get; set; } public int KickAfterInfringementCount { get; set; }
public bool KickOnInfringingName { get; set; } = true;
public IBaseConfiguration Generate() public IBaseConfiguration Generate()
{ {