mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 07:13:58 -05:00
add localized level names
intellisense suggestion junk
This commit is contained in:
13
SharedLibraryCore/Objects/Permission.cs
Normal file
13
SharedLibraryCore/Objects/Permission.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using static SharedLibraryCore.Objects.Player;
|
||||
|
||||
namespace SharedLibraryCore.Objects
|
||||
{
|
||||
public sealed class ClientPermission
|
||||
{
|
||||
public Permission Level { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
@ -26,7 +27,7 @@ namespace SharedLibraryCore.Objects
|
||||
SeniorAdmin = 5,
|
||||
Owner = 6,
|
||||
Creator = 7,
|
||||
Console = 8,
|
||||
Console = 8
|
||||
}
|
||||
|
||||
public Player()
|
||||
@ -102,8 +103,6 @@ namespace SharedLibraryCore.Objects
|
||||
[NotMapped]
|
||||
public int Score { get; set; }
|
||||
[NotMapped]
|
||||
public IList<Dtos.ProfileMeta> Meta { get; set; }
|
||||
[NotMapped]
|
||||
public bool IsBot { get; set; }
|
||||
private int _ipaddress;
|
||||
public override int IPAddress
|
||||
@ -115,7 +114,7 @@ namespace SharedLibraryCore.Objects
|
||||
public override string Name
|
||||
{
|
||||
get { return _name; }
|
||||
set { _name = value; }
|
||||
set { _name = value; }
|
||||
}
|
||||
[NotMapped]
|
||||
public bool IsAuthenticated { get; set; }
|
||||
@ -123,6 +122,14 @@ namespace SharedLibraryCore.Objects
|
||||
public ClientState State { get; set; }
|
||||
[NotMapped]
|
||||
public Queue<GameEvent> DelayedEvents { get; set; }
|
||||
[NotMapped]
|
||||
// this is kinda dirty, but I need localizable level names
|
||||
public ClientPermission ClientPermission => new ClientPermission()
|
||||
{
|
||||
Level = Level,
|
||||
Name = Utilities.CurrentLocalization
|
||||
.LocalizationIndex[$"GLOBAL_PERMISSION_{Level.ToString().ToUpper()}"]
|
||||
};
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
|
Reference in New Issue
Block a user