IW4M-Admin/Data/Models/Client/Stats/EFACSnapshot.cs

68 lines
2.7 KiB
C#
Raw Permalink Normal View History

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Numerics;
using Data.Models.Server;
namespace Data.Models.Client.Stats
{
/// <summary>
/// This class houses the information for anticheat snapshots (used for validating a ban)
/// </summary>
public class EFACSnapshot : SharedEntity
{
[Key]
public int SnapshotId { get; set; }
public int ClientId { get; set; }
[ForeignKey("ClientId")]
public EFClient Client { get; set; }
public long? ServerId { get; set; }
[ForeignKey(nameof(ServerId))]
public EFServer Server { get; set; }
public DateTime When { get; set; }
public int CurrentSessionLength { get; set; }
public int TimeSinceLastEvent { get; set; }
public double EloRating { get; set; }
public int SessionScore { get; set; }
public double SessionSPM { get; set; }
public int Hits { get; set; }
public int Kills { get; set; }
public int Deaths { get; set; }
public double CurrentStrain { get; set; }
public double StrainAngleBetween { get; set; }
public double SessionAngleOffset { get; set; }
2019-06-15 18:37:43 -04:00
public double RecoilOffset { get; set; }
2018-09-23 20:45:54 -04:00
public int LastStrainAngleId { get; set; }
[ForeignKey("LastStrainAngleId")]
public Vector3 LastStrainAngle { get; set; }
2018-09-23 20:45:54 -04:00
public int HitOriginId { get; set; }
[ForeignKey("HitOriginId")]
public Vector3 HitOrigin { get; set; }
2018-09-23 20:45:54 -04:00
public int HitDestinationId { get; set; }
[ForeignKey("HitDestinationId")]
public Vector3 HitDestination { get; set; }
public double Distance { get; set; }
2019-09-27 16:53:52 -04:00
public double SessionAverageSnapValue { get; set; }
public int SessionSnapHits { get; set; }
2018-09-23 20:45:54 -04:00
public int CurrentViewAngleId { get; set; }
[ForeignKey("CurrentViewAngleId")]
public Vector3 CurrentViewAngle { get; set; }
[Obsolete]
public int WeaponId { get; set; }
public string WeaponReference { get; set; }
public int HitLocation { get; set; }
public string HitLocationReference { get; set; }
public int HitType { get; set; }
public virtual ICollection<EFACSnapshotVector3> PredictedViewAngles { get; set; }
[NotMapped]
public string CapturedViewAngles => PredictedViewAngles?.Count > 0 ?
string.Join(", ", PredictedViewAngles.OrderBy(_angle => _angle.ACSnapshotVector3Id).Select(_angle => _angle.Vector.ToString())) :
"";
[NotMapped] public string ServerName => Server?.HostName ?? "--";
}
}