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

fix duplicate aliases from color codes (AB#5)

This commit is contained in:
RaidMax
2019-12-27 14:42:17 -06:00
parent 596a9fbff8
commit fc8ff7dac9
2 changed files with 8 additions and 5 deletions

View File

@ -51,10 +51,12 @@ namespace WebfrontCore.Controllers
NetworkId = client.NetworkId,
Meta = new List<ProfileMeta>(),
Aliases = client.AliasLink.Children
.Select(a => a.Name)
.Prepend(client.Name)
.OrderBy(a => a)
.Select(_alias => _alias.Name)
.GroupBy(_alias => _alias.StripColors())
// we want the longest "duplicate" name
.Select(_grp => _grp.OrderByDescending(_name => _name.Length).First())
.Distinct()
.OrderBy(a => a)
.ToList(),
IPs = client.AliasLink.Children
.Where(i => i.IPAddress != null)