using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Data.Models.Client
{
public class EFClient : SharedEntity
{
public enum Permission
{
///
/// client has been banned
///
Banned = -1,
///
/// default client state upon first connect
///
User = 0,
///
/// client has been flagged
///
Flagged = 1,
///
/// client is trusted
///
Trusted = 2,
///
/// client is a moderator
///
Moderator = 3,
///
/// client is an administrator
///
Administrator = 4,
///
/// client is a senior administrator
///
SeniorAdmin = 5,
///
/// client is a owner
///
Owner = 6,
///
/// not used
///
Creator = 7,
///
/// reserved for default account
///
Console = 8
}
[Key]
public int ClientId { get; set; }
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 Permission Level { get; set; }
[Required]
public int CurrentAliasId { get; set; }
[ForeignKey("CurrentAliasId")]
public virtual EFAlias CurrentAlias { get; set; }
public string Password { get; set; }
public string PasswordSalt { get; set; }
// list of meta for the client
public virtual ICollection Meta { get; set; }
public virtual ICollection ReceivedPenalties { get; set; }
public virtual ICollection AdministeredPenalties { get; set; }
}
}