add localized level names

intellisense suggestion junk
This commit is contained in:
RaidMax
2018-08-03 21:11:58 -05:00
parent 3c0e101f14
commit bbade07646
23 changed files with 93 additions and 50 deletions

View File

@ -37,9 +37,9 @@ namespace WebfrontCore.Controllers.API
player.Name,
player.Score,
player.Ping,
player.State,
State = player.State.ToString(),
player.ClientNumber,
player.ConnectionTime,
ConnectionTime = (DateTime.UtcNow - player.ConnectionTime).TotalSeconds,
player.Level,
})
});

View File

@ -27,7 +27,7 @@ namespace WebfrontCore.Controllers
var clientDto = new PlayerInfo()
{
Name = client.Name,
Level = client.Level.ToString(),
Level = client.Level.ToLocalizedLevelName(),
LevelInt = (int)client.Level,
ClientId = client.ClientId,
IPAddress = client.IPAddressString,
@ -148,7 +148,7 @@ namespace WebfrontCore.Controllers
var clientsDto = clients.Select(c => new PlayerInfo()
{
Name = c.Name,
Level = c.Level.ToString(),
Level = c.Level.ToLocalizedLevelName(),
LevelInt = (int)c.Level,
ClientId = c.ClientId,
LastSeen = Utilities.GetTimePassed(c.LastConnection, false)

View File

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using SharedLibraryCore;
using SharedLibraryCore.Dtos;
using System;
using System.Collections.Generic;
@ -31,7 +32,7 @@ namespace WebfrontCore.Controllers
{
Name = p.Name,
ClientId = p.ClientId,
Level = p.Level.ToString(),
Level = p.Level.ToLocalizedLevelName(),
LevelInt = (int)p.Level
}).ToList(),
ChatHistory = s.ChatHistory,

View File

@ -14,7 +14,7 @@ namespace WebfrontCore
{
public class Startup
{
private IHostingEnvironment _appHost;
private readonly IHostingEnvironment _appHost;
public static IConfigurationRoot Configuration { get; private set; }
public Startup(IHostingEnvironment env)

View File

@ -20,7 +20,7 @@ namespace WebfrontCore.ViewComponents
OffenderName = p.Offender.Name,
PunisherId = p.PunisherId,
PunisherName = p.Punisher.Name,
PunisherLevel = p.Punisher.Level.ToString(),
PunisherLevel = p.Punisher.Level.ToLocalizedLevelName(),
#if DEBUG
Offense = !string.IsNullOrEmpty(p.AutomatedOffense) ? p.AutomatedOffense : p.Offense,
#else

View File

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using SharedLibraryCore;
using SharedLibraryCore.Dtos;
using System.Linq;
@ -24,7 +25,7 @@ namespace WebfrontCore.ViewComponents
{
Name = p.Name,
ClientId = p.ClientId,
Level = p.Level.ToString(),
Level = p.Level.ToLocalizedLevelName(),
LevelInt = (int)p.Level
}).ToList(),
ChatHistory = s.ChatHistory,