mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
remove create proxy as it's not even used anymore
more fixes for alias stuff hopefully fix rare bug where client activity cshtml loop goes oob add URLProtocol format to event parsers to allow connecting through webfront
This commit is contained in:
@ -17,27 +17,6 @@ namespace SharedLibraryCore.Services
|
||||
public async Task<EFAlias> Create(EFAlias entity)
|
||||
{
|
||||
throw await Task.FromResult(new Exception());
|
||||
/*using (var context = new DatabaseContext())
|
||||
{
|
||||
var alias = new EFAlias()
|
||||
{
|
||||
Active = true,
|
||||
DateAdded = DateTime.UtcNow,
|
||||
IPAddress = entity.IPAddress,
|
||||
Name = entity.Name
|
||||
};
|
||||
|
||||
entity.Link = await context.AliasLinks
|
||||
.FirstAsync(a => a.AliasLinkId == entity.Link.AliasLinkId);
|
||||
context.Aliases.Add(entity);
|
||||
await context.SaveChangesAsync();
|
||||
return entity;
|
||||
}*/
|
||||
}
|
||||
|
||||
public Task<EFAlias> CreateProxy()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public async Task<EFAlias> Delete(EFAlias entity)
|
||||
|
@ -28,9 +28,12 @@ namespace SharedLibraryCore.Services
|
||||
|
||||
if (existingAlias != null)
|
||||
{
|
||||
entity.CurrentServer.Logger.WriteDebug($"[create] client with new GUID {entity} has existing link {existingAlias.LinkId}");
|
||||
|
||||
linkId = existingAlias.LinkId;
|
||||
if (existingAlias.Name == entity.Name)
|
||||
{
|
||||
entity.CurrentServer.Logger.WriteDebug($"[create] client with new GUID {entity} has existing alias {existingAlias.AliasId}");
|
||||
aliasId = existingAlias.AliasId;
|
||||
}
|
||||
}
|
||||
@ -44,9 +47,12 @@ namespace SharedLibraryCore.Services
|
||||
NetworkId = entity.NetworkId
|
||||
};
|
||||
|
||||
context.Clients.Add(client);
|
||||
|
||||
// they're just using a new GUID
|
||||
if (aliasId.HasValue)
|
||||
{
|
||||
entity.CurrentServer.Logger.WriteDebug($"[create] setting {entity}'s alias id and linkid to ({aliasId.Value}, {linkId.Value})");
|
||||
client.CurrentAliasId = aliasId.Value;
|
||||
client.AliasLinkId = linkId.Value;
|
||||
}
|
||||
@ -54,8 +60,9 @@ namespace SharedLibraryCore.Services
|
||||
// link was found but they don't have an exact alias
|
||||
else if (!aliasId.HasValue && linkId.HasValue)
|
||||
{
|
||||
entity.CurrentServer.Logger.WriteDebug($"[create] setting {entity}'s linkid to {linkId.Value}, but creating new alias");
|
||||
client.AliasLinkId = linkId.Value;
|
||||
client.CurrentAlias = new Alias()
|
||||
client.CurrentAlias = new EFAlias()
|
||||
{
|
||||
Name = entity.Name,
|
||||
DateAdded = DateTime.UtcNow,
|
||||
@ -67,18 +74,22 @@ namespace SharedLibraryCore.Services
|
||||
// brand new players (supposedly)
|
||||
else
|
||||
{
|
||||
client.AliasLink = new EFAliasLink();
|
||||
|
||||
client.CurrentAlias = new Alias()
|
||||
entity.CurrentServer.Logger.WriteDebug($"[create] creating new Link and Alias for {entity}");
|
||||
var link = new EFAliasLink();
|
||||
var alias = new EFAlias()
|
||||
{
|
||||
Name = entity.Name,
|
||||
DateAdded = DateTime.UtcNow,
|
||||
IPAddress = entity.IPAddress,
|
||||
Link = client.AliasLink,
|
||||
Link = link
|
||||
};
|
||||
|
||||
link.Children.Add(alias);
|
||||
|
||||
client.AliasLink = link;
|
||||
client.CurrentAlias = alias;
|
||||
}
|
||||
|
||||
context.Clients.Add(client);
|
||||
await context.SaveChangesAsync();
|
||||
|
||||
return client;
|
||||
@ -474,11 +485,6 @@ namespace SharedLibraryCore.Services
|
||||
.CountAsync();
|
||||
}
|
||||
}
|
||||
|
||||
public Task<EFClient> CreateProxy()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -68,11 +68,6 @@ namespace SharedLibraryCore.Services
|
||||
return newEntity;
|
||||
}
|
||||
|
||||
public Task<EFPenalty> CreateProxy()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<EFPenalty> Delete(EFPenalty entity)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
Reference in New Issue
Block a user