From b7f1697c799a8a463a9fc149decfa9a32fef5b11 Mon Sep 17 00:00:00 2001 From: RaidMax Date: Wed, 22 Apr 2020 20:51:04 -0500 Subject: [PATCH] include some of the changes meant for previous build --- Application/IW4MServer.cs | 8 +++++--- Plugins/LiveRadar/Plugin.cs | 16 ++++++++++------ SharedLibraryCore/Services/ClientService.cs | 5 ++--- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Application/IW4MServer.cs b/Application/IW4MServer.cs index 34e29a88..8db6389e 100644 --- a/Application/IW4MServer.cs +++ b/Application/IW4MServer.cs @@ -880,13 +880,15 @@ namespace IW4MAdmin // this one is ok catch (ServerException e) { - if (e is NetworkException && !Throttled) + if (e is NetworkException && !Throttled && notifyDisconnects) { Logger.WriteError(loc["SERVER_ERROR_COMMUNICATION"].FormatExt($"{IP}:{Port}")); Logger.WriteDebug(e.GetExceptionInfo()); } - - Logger.WriteError(e.Message); + else + { + Logger.WriteError(e.Message); + } return false; } diff --git a/Plugins/LiveRadar/Plugin.cs b/Plugins/LiveRadar/Plugin.cs index 20cd2246..265af4b8 100644 --- a/Plugins/LiveRadar/Plugin.cs +++ b/Plugins/LiveRadar/Plugin.cs @@ -18,6 +18,7 @@ namespace LiveRadar private readonly IConfigurationHandler _configurationHandler; private bool addedPage; + private object lockObject; public Plugin(IConfigurationHandlerFactory configurationHandlerFactory) { @@ -28,13 +29,16 @@ namespace LiveRadar { // if it's an IW4 game, with custom callbacks, we want to // enable the live radar page - if (E.Type == GameEvent.EventType.Start && - S.GameName == Server.Game.IW4 && - S.CustomCallback && - !addedPage) + lock (lockObject) { - E.Owner.Manager.GetPageList().Pages.Add(Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_RADAR_TITLE"], "/Radar/All"); - addedPage = true; + if (E.Type == GameEvent.EventType.Start && + S.GameName == Server.Game.IW4 && + S.CustomCallback && + !addedPage) + { + E.Owner.Manager.GetPageList().Pages.Add(Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_RADAR_TITLE"], "/Radar/All"); + addedPage = true; + } } if (E.Type == GameEvent.EventType.Unknown) diff --git a/SharedLibraryCore/Services/ClientService.cs b/SharedLibraryCore/Services/ClientService.cs index c9f43b62..fbcfe645 100644 --- a/SharedLibraryCore/Services/ClientService.cs +++ b/SharedLibraryCore/Services/ClientService.cs @@ -373,8 +373,6 @@ namespace SharedLibraryCore.Services private static readonly Func> _getUniqueQuery = EF.CompileAsyncQuery((DatabaseContext context, long networkId) => context.Clients - .Include(c => c.CurrentAlias) - .Include(c => c.AliasLink) .Select(_client => new EFClient() { ClientId = _client.ClientId, @@ -385,7 +383,8 @@ namespace SharedLibraryCore.Services LastConnection = _client.LastConnection, Masked = _client.Masked, NetworkId = _client.NetworkId, - TotalConnectionTime = _client.TotalConnectionTime + TotalConnectionTime = _client.TotalConnectionTime, + AliasLink = _client.AliasLink }) .FirstOrDefault(c => c.NetworkId == networkId) );