fix for issue #45 and #37

This commit is contained in:
RaidMax 2018-09-02 22:09:25 -05:00
parent 20d4ab27d3
commit 672d45df7c
2 changed files with 11 additions and 10 deletions

View File

@ -209,16 +209,8 @@ namespace IW4MAdmin
var autoKickClient = (await Manager.GetClientService().Get(1)).AsPlayer(); var autoKickClient = (await Manager.GetClientService().Get(1)).AsPlayer();
autoKickClient.CurrentServer = this; autoKickClient.CurrentServer = this;
if (currentBan.Type == Penalty.PenaltyType.TempBan)
{
string formattedKick = String.Format(
RconParser.GetCommandPrefixes().Kick,
polledPlayer.ClientNumber,
$"{loc["SERVER_TB_REMAIN"]} ({(currentBan.Expires - DateTime.UtcNow).TimeSpanText()} {loc["WEBFRONT_PENALTY_TEMPLATE_REMAINING"]})");
await this.ExecuteCommandAsync(formattedKick);
}
// the player is permanently banned // the player is permanently banned
else if (currentBan.Type == Penalty.PenaltyType.Ban)
{ {
// don't store the kick message // don't store the kick message
string formattedKick = String.Format( string formattedKick = String.Format(
@ -228,6 +220,15 @@ namespace IW4MAdmin
await this.ExecuteCommandAsync(formattedKick); await this.ExecuteCommandAsync(formattedKick);
} }
else
{
string formattedKick = String.Format(
RconParser.GetCommandPrefixes().Kick,
polledPlayer.ClientNumber,
$"{loc["SERVER_TB_REMAIN"]} ({(currentBan.Expires - DateTime.UtcNow).TimeSpanText()} {loc["WEBFRONT_PENALTY_TEMPLATE_REMAINING"]})");
await this.ExecuteCommandAsync(formattedKick);
}
// reban the "evading" guid // reban the "evading" guid
if (player.Level != Player.Permission.Banned && currentBan.Type == Penalty.PenaltyType.Ban) if (player.Level != Player.Permission.Banned && currentBan.Type == Penalty.PenaltyType.Ban)
await player.Ban($"{currentBan.Offense}", autoKickClient); await player.Ban($"{currentBan.Offense}", autoKickClient);

View File

@ -194,7 +194,7 @@ namespace IW4MAdmin.Plugins.Stats.Cheat
if (currentHeadshotRatio > maxHeadshotLerpValueForFlag) if (currentHeadshotRatio > maxHeadshotLerpValueForFlag)
{ {
// ban on headshot // ban on headshot
if (currentHeadshotRatio > maxHeadshotLerpValueForFlag) if (currentHeadshotRatio > maxHeadshotLerpValueForBan)
{ {
Log.WriteDebug("**Maximum Headshot Ratio Reached For Ban**"); Log.WriteDebug("**Maximum Headshot Ratio Reached For Ban**");
Log.WriteDebug($"ClientId: {kill.AttackerId}"); Log.WriteDebug($"ClientId: {kill.AttackerId}");