1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-25 14:40:31 -05:00

update zombie models

This commit is contained in:
RaidMax
2023-05-07 14:18:59 -05:00
parent 24b6f6d73b
commit 2d20e69856
11 changed files with 148 additions and 2151 deletions

View File

@ -25,5 +25,6 @@ namespace Data.Models.Client.Stats
public int? Ranking { get; set; }
public double? ZScore { get; set; }
public double? PerformanceMetric { get; set; }
public string PerformanceBucket { get; set; }
}
}

View File

@ -0,0 +1,9 @@
using System;
namespace Data.Models;
public class DatedRecord
{
public DateTimeOffset CreatedDateTime { get; set; } = DateTimeOffset.UtcNow;
public DateTimeOffset? UpdatedDateTime { get; set; }
}

View File

@ -15,6 +15,7 @@ namespace Data.Models.Server
public Reference.Game? GameName { get; set; }
public string HostName { get; set; }
public bool IsPasswordProtected { get; set; }
public string PerformanceBucket { get; set; }
public long Id => ServerId;
public string Value => EndPoint;
}

View File

@ -1,4 +1,6 @@
namespace Data.Models.Zombie;
using System.ComponentModel.DataAnnotations.Schema;
namespace Data.Models.Zombie;
public class ZombieAggregateClientStat : ZombieClientStat
{
@ -20,8 +22,23 @@ public class ZombieAggregateClientStat : ZombieClientStat
public int HighestRound { get; set; }
public int TotalRoundsPlayed { get; set; }
public int TotalMatchesPlayed { get; set; }
public int TotalMatchesCompleted { get; set; }
#endregion
public double RankingMetric { get; set; }
[NotMapped]
public static readonly string[] RecordsKeys =
{
nameof(AverageKillsPerDown),
nameof(AverageDowns),
nameof(AverageRevives),
nameof(HeadshotPercentage),
nameof(AlivePercentage),
nameof(AverageMelees),
nameof(AverageRoundReached),
nameof(AveragePoints),
nameof(HighestRound),
nameof(TotalRoundsPlayed),
nameof(TotalMatchesPlayed)
};
}

View File

@ -5,7 +5,7 @@ using Data.Models.Client;
namespace Data.Models.Zombie;
public abstract class ZombieClientStat
public abstract class ZombieClientStat : DatedRecord
{
[Key]
public long ZombieClientStatId { get; set; }
@ -27,8 +27,8 @@ public abstract class ZombieClientStat
public int Melees { get; set; }
public int Downs { get; set; }
public int Revives { get; set; }
public int PointsEarned { get; set; }
public int PointsSpent { get; set; }
public long PointsEarned { get; set; }
public long PointsSpent { get; set; }
public int PerksConsumed { get; set; }
public int PowerupsGrabbed { get; set; }
}

View File

@ -0,0 +1,29 @@
#nullable enable
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Data.Models.Client;
namespace Data.Models.Zombie;
public enum RecordType
{
Maximum,
Minimum
}
public class ZombieClientStatRecord : DatedRecord
{
[Key]
public int ZombieClientStatRecordId { get; set; }
public string Name { get; set; } = string.Empty;
public string Type { get; set; } = string.Empty;
public string Value { get; set; } = string.Empty;
public int? ClientId { get; set; }
[ForeignKey(nameof(ClientId))]
public virtual EFClient? Client { get; set; }
public long? RoundId { get; set; }
[ForeignKey(nameof(RoundId))]
public virtual ZombieRoundClientStat? Round { get; set; }
}

View File

@ -8,7 +8,7 @@ using Data.Models.Server;
namespace Data.Models.Zombie;
public class ZombieMatch
public class ZombieMatch : DatedRecord
{
[Key]
public int ZombieMatchId { get; set; }
@ -21,6 +21,8 @@ public class ZombieMatch
[ForeignKey(nameof(ServerId))]
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;