mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
strip drive letter on gamelog server if running on linux
strip undecodable chacters from gamelog server log file finish re work on alias add/update ( I think)
This commit is contained in:
@ -28,7 +28,7 @@ namespace SharedLibraryCore.Configuration
|
||||
public string WebfrontBindUrl { get; set; }
|
||||
[LocalizedDisplayName("WEBFRONT_CONFIGURATION_MANUAL_URL")]
|
||||
public string ManualWebfrontUrl { get; set; }
|
||||
public string WebfrontUrl => string.IsNullOrEmpty(ManualWebfrontUrl) ? WebfrontBindUrl.Replace("0.0.0.0", "127.0.0.1") : ManualWebfrontUrl;
|
||||
public string WebfrontUrl => string.IsNullOrEmpty(ManualWebfrontUrl) ? WebfrontBindUrl?.Replace("0.0.0.0", "127.0.0.1") : ManualWebfrontUrl;
|
||||
[LocalizedDisplayName("SETUP_USE_CUSTOMENCODING")]
|
||||
public bool EnableCustomParserEncoding { get; set; }
|
||||
[LocalizedDisplayName("WEBFRONT_CONFIGURATION_ENCODING")]
|
||||
|
@ -17,7 +17,6 @@ namespace SharedLibraryCore.Services
|
||||
{
|
||||
using (var context = new DatabaseContext())
|
||||
{
|
||||
|
||||
int? linkId = null;
|
||||
int? aliasId = null;
|
||||
|
||||
@ -45,23 +44,31 @@ namespace SharedLibraryCore.Services
|
||||
NetworkId = entity.NetworkId
|
||||
};
|
||||
|
||||
if (linkId.HasValue)
|
||||
{
|
||||
client.AliasLinkId = linkId.Value;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
client.AliasLink = new EFAliasLink();
|
||||
}
|
||||
|
||||
// they're just using a new GUID
|
||||
if (aliasId.HasValue)
|
||||
{
|
||||
client.CurrentAliasId = aliasId.Value;
|
||||
client.AliasLinkId = linkId.Value;
|
||||
}
|
||||
|
||||
// link was found but they don't have an exact alias
|
||||
else if (!aliasId.HasValue && linkId.HasValue)
|
||||
{
|
||||
client.AliasLinkId = linkId.Value;
|
||||
client.CurrentAlias = new Alias()
|
||||
{
|
||||
Name = entity.Name,
|
||||
DateAdded = DateTime.UtcNow,
|
||||
IPAddress = entity.IPAddress,
|
||||
LinkId = linkId.Value
|
||||
};
|
||||
}
|
||||
|
||||
// brand new players (supposedly)
|
||||
else
|
||||
{
|
||||
client.AliasLink = new EFAliasLink();
|
||||
|
||||
client.CurrentAlias = new Alias()
|
||||
{
|
||||
Name = entity.Name,
|
||||
@ -69,11 +76,6 @@ namespace SharedLibraryCore.Services
|
||||
IPAddress = entity.IPAddress,
|
||||
Link = client.AliasLink,
|
||||
};
|
||||
|
||||
if (client.CurrentAlias.Link == null)
|
||||
{
|
||||
client.CurrentAlias.LinkId = linkId.Value;
|
||||
}
|
||||
}
|
||||
|
||||
context.Clients.Add(client);
|
||||
@ -126,6 +128,11 @@ namespace SharedLibraryCore.Services
|
||||
|
||||
var oldAliasLink = entity.AliasLink;
|
||||
|
||||
// update all the clients that have the old alias link
|
||||
await context.Clients
|
||||
.Where(_client => _client.AliasLinkId == oldAliasLink.AliasLinkId)
|
||||
.ForEachAsync(_client => _client.AliasLinkId = newAliasLink.AliasLinkId);
|
||||
|
||||
entity.AliasLink = newAliasLink;
|
||||
entity.AliasLinkId = newAliasLink.AliasLinkId;
|
||||
|
||||
|
@ -22,7 +22,8 @@ namespace SharedLibraryCore
|
||||
public static class Utilities
|
||||
{
|
||||
#if DEBUG == true
|
||||
public static string OperatingDirectory => $"{Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)}{Path.DirectorySeparatorChar}";
|
||||
public static string OperatingDirectory => @"X:\IW4MAdmin\Application\bin\Debug\netcoreapp2.2\";
|
||||
//public static string OperatingDirectory => $"{Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)}{Path.DirectorySeparatorChar}";
|
||||
#else
|
||||
public static string OperatingDirectory => $"{Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)}{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}";
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user