include some of the changes meant for previous build

This commit is contained in:
RaidMax 2020-04-22 20:51:04 -05:00
parent 92a26600af
commit b41c4c6245
3 changed files with 17 additions and 12 deletions

View File

@ -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;
}

View File

@ -18,6 +18,7 @@ namespace LiveRadar
private readonly IConfigurationHandler<LiveRadarConfiguration> _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)

View File

@ -373,8 +373,6 @@ namespace SharedLibraryCore.Services
private static readonly Func<DatabaseContext, long, Task<EFClient>> _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)
);