huge commit for advanced stats feature.

broke data out into its own library.
may be breaking changes with existing plugins
This commit is contained in:
RaidMax
2021-03-22 11:09:25 -05:00
parent db2e1deb2f
commit c5375b661b
505 changed files with 13671 additions and 3271 deletions

View File

@ -1,5 +1,5 @@
using System;
using static SharedLibraryCore.Database.Models.EFPenalty;
using Data.Models;
namespace SharedLibraryCore.Dtos.Meta.Responses
{
@ -10,7 +10,7 @@ namespace SharedLibraryCore.Dtos.Meta.Responses
public string OffenderName { get; set; }
public string PunisherName { get; set; }
public int PunisherClientId { get; set; }
public PenaltyType PenaltyType { get; set; }
public EFPenalty.PenaltyType PenaltyType { get; set; }
public string Offense { get; set; }
public string AutomatedOffense { get; set; }
public DateTime? ExpirationDate { get; set; }

View File

@ -1,6 +1,6 @@
using System;
using static SharedLibraryCore.Database.Models.EFClient;
using static SharedLibraryCore.Database.Models.EFPenalty;
using Data.Models;
using static Data.Models.Client.EFClient;
namespace SharedLibraryCore.Dtos
{
@ -18,14 +18,14 @@ namespace SharedLibraryCore.Dtos
public string PunisherLevelText => PunisherLevel.ToLocalizedLevelName();
public string Offense { get; set; }
public string AutomatedOffense { get; set; }
public PenaltyType PenaltyType { get; set; }
public EFPenalty.PenaltyType PenaltyType { get; set; }
public string PenaltyTypeText => PenaltyType.ToString();
public DateTime TimePunished { get; set; }
public string TimePunishedString => TimePunished.HumanizeForCurrentCulture();
public string TimeRemaining => DateTime.UtcNow > Expires ? "" : $"{((Expires ?? DateTime.MaxValue).Year == DateTime.MaxValue.Year ? TimePunishedString : ((Expires ?? DateTime.MaxValue) - DateTime.UtcNow).HumanizeForCurrentCulture())}";
public bool Expired => Expires.HasValue && Expires <= DateTime.UtcNow;
public DateTime? Expires { get; set; }
public override bool Sensitive => PenaltyType == PenaltyType.Flag || PenaltyType == PenaltyType.Unflag;
public override bool Sensitive => PenaltyType == EFPenalty.PenaltyType.Flag || PenaltyType == EFPenalty.PenaltyType.Unflag;
public bool IsEvade { get; set; }
public string AdditionalPenaltyInformation => $"{(!string.IsNullOrEmpty(AutomatedOffense) ? $" ({AutomatedOffense})" : "")}{(IsEvade ? $" ({Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_PENALTY_EVADE"]})" : "")}";
}

View File

@ -1,8 +1,8 @@
using SharedLibraryCore.Database.Models;
using SharedLibraryCore.Dtos.Meta.Responses;
using SharedLibraryCore.Dtos.Meta.Responses;
using SharedLibraryCore.Interfaces;
using System;
using System.Collections.Generic;
using Data.Models;
namespace SharedLibraryCore.Dtos
{

View File

@ -22,5 +22,6 @@ namespace SharedLibraryCore.Dtos
public string ConnectProtocolUrl { get; set; }
public string IPAddress { get; set; }
public bool IsPasswordProtected { get; set; }
public string Endpoint => $"{IPAddress}:{Port}";
}
}