1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

Add automated ban offense for anti-cheat

add EFClientStatHistory and EFClientAverageStatHistory for tracking change of stats over time
This commit is contained in:
RaidMax
2018-05-30 20:50:20 -05:00
parent ebda1984fa
commit dca4d10967
22 changed files with 1178 additions and 103 deletions

View File

@ -0,0 +1,22 @@
using SharedLibraryCore.Database.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
namespace IW4MAdmin.Plugins.Stats.Models
{
public class EFClientAverageStatHistory : SharedEntity
{
[Key]
public int ClientId { get; set; }
[ForeignKey("ClientId")]
public virtual EFClient Client { get; set; }
public virtual ICollection<EFRating> Ratings { get; set; }
[Required]
public int LastRatingId { get; set; }
[ForeignKey("LastRatingId")]
public virtual EFRating LastRating { get; set; }
}
}

View File

@ -0,0 +1,23 @@
using IW4MAdmin.Plugins.Stats.Models;
using SharedLibraryCore.Database.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
namespace IW4MAdmin.Plugins.Stats.Models
{
public class EFClientStatHistory : SharedEntity
{
[Key]
public int StatHistoryId { get; set; }
public int ClientId { get; set; }
[ForeignKey("ClientId")]
public virtual EFClient Client { get; set; }
public int ServerId { get; set; }
[ForeignKey("ServerId")]
public virtual EFServer Server { get; set; }
public virtual ICollection<EFRating> Ratings { get; set; }
}
}

View File

@ -96,5 +96,7 @@ namespace IW4MAdmin.Plugins.Stats.Models
private List<int> SessionScores = new List<int>() { 0 };
[NotMapped]
public IW4Info.Team Team { get; set; }
[NotMapped]
public DateTime LastStatHistoryUpdate { get; set; } = DateTime.UtcNow;
}
}

View File

@ -0,0 +1,22 @@
using SharedLibraryCore.Database.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
namespace IW4MAdmin.Plugins.Stats.Models
{
public class EFRating : SharedEntity
{
[Key]
public int RatingId { get; set; }
public int ClientId { get; set; }
[ForeignKey("ClientId")]
public EFClient Client { get; set; }
[Required]
public double Performance { get; set; }
[Required]
public int Ranking { get; set; }
}
}