hopefully fix issue with linked banned players

This commit is contained in:
RaidMax
2022-01-02 16:19:48 -06:00
parent 67be4f8e7f
commit f5854f8d03
11 changed files with 4472 additions and 13 deletions

View File

@ -153,7 +153,7 @@ namespace SharedLibraryCore.Services
{
_logger.LogDebug("[{Method}] creating new Link and Alias for {Entity}", nameof(HandleNewCreate), entity.ToString());
var link = new EFAliasLink();
var alias = new EFAlias()
var alias = new EFAlias
{
Name = entity.Name,
SearchableName = entity.Name.StripColors().ToLower(),
@ -167,9 +167,18 @@ namespace SharedLibraryCore.Services
else
{
_logger.LogDebug("[{Method}] associating new GUID {Guid} with existing alias id {aliasId} for {Entity}",
nameof(HandleNewCreate), entity.GuidString, existingAlias.AliasId, entity.ToString());
client.CurrentAliasId = existingAlias.AliasId;
_logger.LogDebug("[{Method}] associating new GUID {Guid} with new exact alias match with linkId {LinkId} for {Entity}",
nameof(HandleNewCreate), entity.GuidString, existingAlias.LinkId, entity.ToString());
var alias = new EFAlias
{
Name = existingAlias.Name,
SearchableName = entity.Name.StripColors().ToLower(),
DateAdded = DateTime.UtcNow,
IPAddress = entity.IPAddress,
LinkId = existingAlias.LinkId
};
client.CurrentAlias = alias;
client.AliasLinkId = existingAlias.LinkId;
}
@ -338,7 +347,7 @@ namespace SharedLibraryCore.Services
return;
}
if (existingExactAlias != null)
if (existingExactAlias != null && entity.AliasLinkId == existingExactAlias.LinkId)
{
entity.CurrentAlias = existingExactAlias;
entity.CurrentAliasId = existingExactAlias.AliasId;