IW4M-Admin/SharedLibrary/Database/Models/EFClient.cs
RaidMax 1dbacd2188 added 'none' and extra m16 variants to weapon list
moved killstreak/deathstreak messages into configuration file
cleaned up configuration manager
fixed misc startup issue and threading
added more importing stuff
network id is a ulong now
ip str is now ip
added time played (per server)
2018-02-10 22:33:42 -06:00

65 lines
1.9 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SharedLibrary.Database.Models
{
public class EFClient : SharedEntity
{
[Key]
public int ClientId { get; set; }
[Index(IsUnique = true)]
public long NetworkId { get; set; }
[Required]
public int Connections { get; set; }
[Required]
// in seconds
public int TotalConnectionTime { get; set; }
[Required]
public DateTime FirstConnection { get; set; }
[Required]
public DateTime LastConnection { get; set; }
public bool Masked { get; set; }
[Required]
public int AliasLinkId { get; set; }
[ForeignKey("AliasLinkId")]
public virtual EFAliasLink AliasLink { get; set; }
[Required]
public Objects.Player.Permission Level { get; set; }
[Required]
public int CurrentAliasId { get; set; }
[ForeignKey("CurrentAliasId")]
public virtual EFAlias CurrentAlias { get; set; }
[NotMapped]
public virtual string Name
{
get { return CurrentAlias.Name; }
set { }
}
[NotMapped]
public virtual int IPAddress
{
get { return CurrentAlias.IPAddress; }
set { }
}
[NotMapped]
public string IPAddressString => new System.Net.IPAddress(BitConverter.GetBytes(IPAddress)).ToString();
public virtual ICollection<EFPenalty> ReceivedPenalties { get; set; }
public virtual ICollection<EFPenalty> AdministeredPenalties { get; set; }
public EFClient()
{
ReceivedPenalties = new List<EFPenalty>();
AdministeredPenalties = new List<EFPenalty>();
}
}
}