1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

[webfront] search by ip and name

[application] levels set properly with multiple GUIDs
[stats] require 3 hours of playtime for top stats recognition
[application] configurable rcon polling rate
This commit is contained in:
RaidMax
2018-06-07 21:19:12 -05:00
parent 7def173957
commit fc2b846a5c
10 changed files with 64 additions and 23 deletions

View File

@ -57,7 +57,9 @@ namespace SharedLibraryCore.Services
// set the level to the level of the existing client if they have the same IP + Name but new NetworkId
// fixme: issues?
Level = hasExistingAlias ?
context.Clients.First(c => c.AliasLinkId == existingAlias.LinkId).Level :
(await context.Clients.Where(c => c.AliasLinkId == existingAlias.LinkId)
.OrderByDescending(c => c.Level)
.FirstAsync()).Level :
Player.Permission.User,
FirstConnection = DateTime.UtcNow,
Connections = 1,
@ -119,12 +121,12 @@ namespace SharedLibraryCore.Services
{
Client = client,
LinkedAccounts = (from linkedClient in context.Clients
where client.AliasLinkId == linkedClient.AliasLinkId
select new
{
linkedClient.ClientId,
linkedClient.NetworkId
})
where client.AliasLinkId == linkedClient.AliasLinkId
select new
{
linkedClient.ClientId,
linkedClient.NetworkId
})
};
var foundClient = await iqClient.FirstOrDefaultAsync();
@ -260,10 +262,18 @@ namespace SharedLibraryCore.Services
using (var context = new DatabaseContext())
{
context.ChangeTracker.AutoDetectChangesEnabled = false;
context.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
int asIP = name.ConvertToIP();
// hack: so IW4MAdmin doesn't show up in search results
asIP = asIP == 0 ? int.MinValue : asIP;
var iqClients = (from alias in context.Aliases
.AsNoTracking()
where alias.Name.ToLower()
.Contains(name.ToLower())
.Contains(name.ToLower()) ||
alias.IPAddress == asIP
join link in context.AliasLinks
on alias.LinkId equals link.AliasLinkId
join client in context.Clients