fixes for new polling setup

update database model for alias (nullable ip)
heartbeats now send ip to master server
This commit is contained in:
RaidMax
2018-11-25 20:00:36 -06:00
parent 9bdd7d1b8a
commit 5ac8a55c72
28 changed files with 1257 additions and 408 deletions

View File

@ -57,13 +57,6 @@ namespace WebfrontCore.Controllers
Client.ClientId = Convert.ToInt32(base.User.Claims.First(c => c.Type == ClaimTypes.Sid).Value);
Client.Level = (EFClient.Permission)Enum.Parse(typeof(EFClient.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)
{
Client.Level = stillExists.Level;
}
}
catch (InvalidOperationException)
@ -78,11 +71,13 @@ namespace WebfrontCore.Controllers
}
}
// give the local host full access
else
{
Client.ClientId = 1;
Client.Level = EFClient.Permission.Console;
Client.CurrentAlias = new EFAlias() { Name = "IW4MAdmin" };
Authorized = true;
}
Authorized = Client.ClientId >= 0;

View File

@ -121,7 +121,7 @@ namespace WebfrontCore.Controllers
{
var admins = (await Manager.GetClientService().GetPrivilegedClients())
.OrderByDescending(a => a.Level)
.GroupBy(a => a.LinkId).Select(a => a.First());
.GroupBy(a => a.AliasLinkId).Select(a => a.First());
var adminsDict = new Dictionary<EFClient.Permission, IList<ClientInfo>>();

View File

@ -1,4 +1,4 @@
@model Dictionary<SharedLibraryCore.Objects.Player.Permission, IList<SharedLibraryCore.Dtos.ClientInfo>>
@model Dictionary<SharedLibraryCore.Database.Models.EFClient.Permission, IList<SharedLibraryCore.Dtos.ClientInfo>>
<h4 class="pb-2 text-center ">@ViewBag.Title</h4>