mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 23:31:13 -05:00
Additional zombie stast work
This commit is contained in:
@ -1,9 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using Data.Models.Server;
|
||||
|
||||
namespace Data.Models.Zombie;
|
||||
|
||||
public class ZombieAggregateClientStat : ZombieClientStat
|
||||
{
|
||||
public long? ServerId { get; set; }
|
||||
[ForeignKey(nameof(ServerId))]
|
||||
public EFServer Server { get; set; }
|
||||
|
||||
#region Average
|
||||
|
||||
public double AverageKillsPerDown { get; set; }
|
||||
@ -41,4 +47,8 @@ public class ZombieAggregateClientStat : ZombieClientStat
|
||||
nameof(TotalRoundsPlayed),
|
||||
nameof(TotalMatchesPlayed)
|
||||
};
|
||||
|
||||
public static readonly string[] SkillKeys =
|
||||
RecordsKeys.Except(new[] { nameof(TotalMatchesPlayed), nameof(TotalRoundsPlayed), nameof(AverageDowns) })
|
||||
.ToArray();
|
||||
}
|
||||
|
@ -9,7 +9,9 @@ public abstract class ZombieClientStat : DatedRecord
|
||||
{
|
||||
[Key]
|
||||
public long ZombieClientStatId { get; set; }
|
||||
|
||||
|
||||
[NotMapped] public override long Id => ZombieClientStatId;
|
||||
|
||||
public int? MatchId { get; set; }
|
||||
|
||||
[ForeignKey(nameof(MatchId))]
|
||||
@ -17,13 +19,14 @@ public abstract class ZombieClientStat : DatedRecord
|
||||
|
||||
public int ClientId { get; set; }
|
||||
[ForeignKey(nameof(ClientId))]
|
||||
public virtual EFClient? Client { get; set; }
|
||||
public virtual EFClient Client { get; set; }
|
||||
|
||||
public int Kills { get; set; }
|
||||
public int Deaths { get; set; }
|
||||
public int DamageDealt { get; set; }
|
||||
public long DamageDealt { get; set; }
|
||||
public int DamageReceived { get; set; }
|
||||
public int Headshots { get; set; }
|
||||
public int HeadshotKills { get; set; }
|
||||
public int Melees { get; set; }
|
||||
public int Downs { get; set; }
|
||||
public int Revives { get; set; }
|
||||
|
@ -15,6 +15,9 @@ public class ZombieClientStatRecord : DatedRecord
|
||||
{
|
||||
[Key]
|
||||
public int ZombieClientStatRecordId { get; set; }
|
||||
|
||||
[NotMapped] public override long Id => ZombieClientStatRecordId;
|
||||
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Type { get; set; } = string.Empty;
|
||||
public string Value { get; set; } = string.Empty;
|
||||
|
48
Data/Models/Zombie/ZombieEventLog.cs
Normal file
48
Data/Models/Zombie/ZombieEventLog.cs
Normal file
@ -0,0 +1,48 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Data.Models.Client;
|
||||
|
||||
namespace Data.Models.Zombie;
|
||||
|
||||
public enum EventLogType
|
||||
{
|
||||
Default = 0,
|
||||
PerformanceCluster = 1,
|
||||
DamageTaken = 2,
|
||||
Downed = 3,
|
||||
Died = 4,
|
||||
Revived = 5,
|
||||
WasRevived = 6,
|
||||
PerkConsumed = 7,
|
||||
PowerupGrabbed = 8,
|
||||
RoundCompleted = 9,
|
||||
JoinedMatch = 10,
|
||||
LeftMatch = 11,
|
||||
MatchStarted = 12,
|
||||
MatchEnded = 13
|
||||
}
|
||||
|
||||
public class ZombieEventLog : DatedRecord
|
||||
{
|
||||
[Key]
|
||||
public long ZombieEventLogId { get; set; }
|
||||
|
||||
[NotMapped] public override long Id => ZombieEventLogId;
|
||||
|
||||
public EventLogType EventType { get; set; }
|
||||
|
||||
public int? SourceClientId { get; set; }
|
||||
[ForeignKey(nameof(SourceClientId))]
|
||||
public EFClient SourceClient { get; set; }
|
||||
|
||||
public int? AssociatedClientId { get; set; }
|
||||
[ForeignKey(nameof(AssociatedClientId))]
|
||||
public EFClient AssociatedClient { get; set; }
|
||||
|
||||
public double? NumericalValue { get; set; }
|
||||
public string TextualValue { get; set; }
|
||||
|
||||
public int? MatchId { get; set; }
|
||||
[ForeignKey(nameof(MatchId))]
|
||||
public ZombieMatch Match { get; set; }
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Data.Models.Client.Stats.Reference;
|
||||
@ -12,6 +11,8 @@ public class ZombieMatch : DatedRecord
|
||||
{
|
||||
[Key]
|
||||
public int ZombieMatchId { get; set; }
|
||||
|
||||
[NotMapped] public override long Id => ZombieMatchId;
|
||||
|
||||
public int? MapId { get; set; }
|
||||
[ForeignKey(nameof(MapId))]
|
||||
@ -22,8 +23,6 @@ public class ZombieMatch : DatedRecord
|
||||
public virtual EFServer? Server { get; set; }
|
||||
|
||||
public int ClientsCompleted { get; set; }
|
||||
|
||||
public virtual ICollection<ZombieClientStat>? ClientStats { get; set; }
|
||||
|
||||
public DateTimeOffset MatchStartDate { get; set; } = DateTimeOffset.UtcNow;
|
||||
public DateTimeOffset? MatchEndDate { get; set; }
|
||||
|
@ -1,6 +1,8 @@
|
||||
namespace Data.Models.Zombie;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Data.Models.Zombie;
|
||||
|
||||
public class ZombieMatchClientStat : ZombieClientStat
|
||||
{
|
||||
|
||||
[NotMapped] public int? JoinedRound { get; set; }
|
||||
}
|
||||
|
Reference in New Issue
Block a user