2018-02-14 14:01:26 -05:00
|
|
|
|
using System;
|
2019-03-31 20:56:31 -04:00
|
|
|
|
using static SharedLibraryCore.Database.Models.EFClient;
|
2019-05-29 17:55:35 -04:00
|
|
|
|
using static SharedLibraryCore.Database.Models.EFPenalty;
|
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; }
|
2019-03-31 20:56:31 -04:00
|
|
|
|
public PenaltyType PenaltyType { get; set; }
|
|
|
|
|
public string PenaltyTypeText => PenaltyType.ToString();
|
|
|
|
|
public DateTime TimePunished { get; set; }
|
|
|
|
|
public string TimePunishedString => Utilities.GetTimePassed(TimePunished, true);
|
|
|
|
|
public string TimeRemaining => DateTime.UtcNow > Expires ? "" : $"{((Expires ?? DateTime.MaxValue).Year == DateTime.MaxValue.Year ? Utilities.GetTimePassed(TimePunished, true) : Utilities.TimeSpanText((Expires ?? DateTime.MaxValue) - DateTime.UtcNow))}";
|
|
|
|
|
public bool Expired => Expires.HasValue && Expires <= DateTime.UtcNow;
|
|
|
|
|
public DateTime? Expires { get; set; }
|
2019-04-05 14:34:03 -04:00
|
|
|
|
public override bool Sensitive => PenaltyType == PenaltyType.Flag || PenaltyType == PenaltyType.Unflag;
|
2019-03-31 20:56:31 -04:00
|
|
|
|
public bool IsEvade { get; set; }
|
|
|
|
|
public string AdditionalPenaltyInformation => $"{(!string.IsNullOrEmpty(AutomatedOffense) ? $" ({AutomatedOffense})" : "")}{(IsEvade ? $" ({Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_PENALTY_EVADE"]})" : "")}";
|
2018-02-14 14:01:26 -05:00
|
|
|
|
}
|
|
|
|
|
}
|