fix concurrency issue with accent color setup
This commit is contained in:
parent
4a89744ee9
commit
17c9944eef
@ -27,6 +27,7 @@ using IW4MAdmin.Application.Migration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Serilog.Context;
|
||||
using SharedLibraryCore.Formatting;
|
||||
using static SharedLibraryCore.GameEvent;
|
||||
using ILogger = Microsoft.Extensions.Logging.ILogger;
|
||||
using ObsoleteLogger = SharedLibraryCore.Interfaces.ILogger;
|
||||
@ -455,6 +456,17 @@ namespace IW4MAdmin.Application
|
||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
Utilities.EncodingType = Encoding.GetEncoding(!string.IsNullOrEmpty(_appConfig.CustomParserEncoding) ? _appConfig.CustomParserEncoding : "windows-1252");
|
||||
|
||||
foreach (var parser in AdditionalRConParsers)
|
||||
{
|
||||
if (!parser.Configuration.ColorCodeMapping.ContainsKey(ColorCodes.Accent.ToString()))
|
||||
{
|
||||
parser.Configuration.ColorCodeMapping.Add(ColorCodes.Accent.ToString(),
|
||||
parser.Configuration.ColorCodeMapping.TryGetValue(_appConfig.IngameAccentColorKey, out var colorCode)
|
||||
? colorCode
|
||||
: "");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region COMMANDS
|
||||
|
@ -1111,15 +1111,6 @@ namespace IW4MAdmin
|
||||
Version = RconParser.Version;
|
||||
}
|
||||
|
||||
if (!RconParser.Configuration.ColorCodeMapping.ContainsKey(ColorCodes.Accent.ToString()))
|
||||
{
|
||||
var accentKey = Manager.GetApplicationSettings().Configuration().IngameAccentColorKey;
|
||||
RconParser.Configuration.ColorCodeMapping.Add(ColorCodes.Accent.ToString(),
|
||||
RconParser.Configuration.ColorCodeMapping.TryGetValue(accentKey, out var colorCode)
|
||||
? colorCode
|
||||
: "");
|
||||
}
|
||||
|
||||
var svRunning = await this.GetMappedDvarValueOrDefaultAsync<string>("sv_running");
|
||||
|
||||
if (!string.IsNullOrEmpty(svRunning.Value) && svRunning.Value != "1")
|
||||
|
Loading…
Reference in New Issue
Block a user