fixed up IW5 parser with new event system

changed login alias to li (duplicate)
fixed crashing bug in generic repo
fixed anonymous name in access to web console
This commit is contained in:
RaidMax
2018-04-28 20:11:13 -05:00
parent 8071fb37bc
commit 35e7f57156
11 changed files with 51 additions and 46 deletions

View File

@ -38,7 +38,9 @@ namespace WebfrontCore.Controllers
{
Client = Client ?? new EFClient()
{
ClientId = -1
ClientId = -1,
Level = Player.Permission.User,
CurrentAlias = new EFAlias() { Name = "Web Console Guest" }
};
if (!HttpContext.Connection.RemoteIpAddress.GetAddressBytes().SequenceEqual(LocalHost))
@ -49,7 +51,7 @@ namespace WebfrontCore.Controllers
Client.Level = (Player.Permission)Enum.Parse(typeof(Player.Permission), User.Claims.First(c => c.Type == ClaimTypes.Role).Value);
Client.CurrentAlias = new EFAlias() { Name = User.Claims.First(c => c.Type == ClaimTypes.NameIdentifier).Value };
var stillExists = Manager.GetPrivilegedClients()[Client.ClientId];
// this happens if their level has been updated
if (stillExists.Level != Client.Level)
{
@ -78,9 +80,9 @@ namespace WebfrontCore.Controllers
Authorized = Client.ClientId >= 0;
ViewBag.Authorized = Authorized;
ViewBag.Url = Startup.Configuration["Web:Address"];
ViewBag.Url = Manager.GetApplicationSettings().Configuration().WebfrontBindUrl;
ViewBag.User = Client;
ViewBag.DiscordLink = DiscordLink;
ViewBag.DiscordLink = DiscordLink ?? "";
base.OnActionExecuting(context);
}

View File

@ -35,7 +35,7 @@ namespace WebfrontCore.Controllers
ClientId = Client.ClientId,
Level = Client.Level,
CurrentServer = server,
CurrentAlias = new Alias() { Name = Client.Name }
Name = Client.Name
};
var remoteEvent = new GameEvent()
{