2018-02-14 14:01:26 -05:00
|
|
|
|
using System;
|
2021-03-22 12:09:25 -04:00
|
|
|
|
using Data.Models;
|
|
|
|
|
using static Data.Models.Client.EFClient;
|
2018-02-14 14:01:26 -05:00
|
|
|
|
|
2018-04-08 02:44:42 -04:00
|
|
|
|
namespace SharedLibraryCore.Dtos
|
2018-02-14 14:01:26 -05:00
|
|
|
|
{
|
2018-03-06 02:22:19 -05:00
|
|
|
|
public class PenaltyInfo : SharedInfo
|
2018-02-14 14:01:26 -05:00
|
|
|
|
{
|
|
|
|
|
public string OffenderName { get; set; }
|
|
|
|
|
public int OffenderId { get; set; }
|
2019-03-27 20:40:26 -04:00
|
|
|
|
public ulong OffenderNetworkId { get; set; }
|
|
|
|
|
public string OffenderIPAddress { get; set; }
|
2018-02-14 14:01:26 -05:00
|
|
|
|
public string PunisherName { get; set; }
|
|
|
|
|
public int PunisherId { get; set; }
|
2019-03-27 20:40:26 -04:00
|
|
|
|
public ulong PunisherNetworkId { get; set; }
|
|
|
|
|
public string PunisherIPAddress { get; set; }
|
2019-03-31 20:56:31 -04:00
|
|
|
|
public Permission PunisherLevel { get; set; }
|
|
|
|
|
public string PunisherLevelText => PunisherLevel.ToLocalizedLevelName();
|
2018-02-14 14:01:26 -05:00
|
|
|
|
public string Offense { get; set; }
|
2018-05-30 21:50:20 -04:00
|
|
|
|
public string AutomatedOffense { get; set; }
|
2021-03-22 12:09:25 -04:00
|
|
|
|
public EFPenalty.PenaltyType PenaltyType { get; set; }
|
2019-03-31 20:56:31 -04:00
|
|
|
|
public string PenaltyTypeText => PenaltyType.ToString();
|
|
|
|
|
public DateTime TimePunished { get; set; }
|
2020-08-17 22:21:11 -04:00
|
|
|
|
public string TimePunishedString => TimePunished.HumanizeForCurrentCulture();
|
2022-01-26 11:32:16 -05:00
|
|
|
|
|
|
|
|
|
public string TimeRemaining => DateTime.UtcNow > Expires
|
|
|
|
|
? ""
|
|
|
|
|
: $"{((Expires ?? DateTime.MaxValue).Year == DateTime.MaxValue.Year ? TimePunishedString : ((Expires ?? DateTime.MaxValue) - DateTime.UtcNow).HumanizeForCurrentCulture())}";
|
|
|
|
|
|
2019-03-31 20:56:31 -04:00
|
|
|
|
public bool Expired => Expires.HasValue && Expires <= DateTime.UtcNow;
|
|
|
|
|
public DateTime? Expires { get; set; }
|
2022-01-26 11:32:16 -05:00
|
|
|
|
|
|
|
|
|
public override bool Sensitive =>
|
|
|
|
|
PenaltyType == EFPenalty.PenaltyType.Flag || PenaltyType == EFPenalty.PenaltyType.Unflag;
|
|
|
|
|
|
2019-03-31 20:56:31 -04:00
|
|
|
|
public bool IsEvade { get; set; }
|
2022-01-26 11:32:16 -05:00
|
|
|
|
|
|
|
|
|
public string AdditionalPenaltyInformation =>
|
|
|
|
|
$"{(!string.IsNullOrEmpty(AutomatedOffense) ? $" ({AutomatedOffense})" : "")}{(IsEvade ? $" ({Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_PENALTY_EVADE"]})" : "")}";
|
2018-02-14 14:01:26 -05:00
|
|
|
|
}
|
2022-01-26 11:32:16 -05:00
|
|
|
|
}
|