1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 23:31:13 -05:00

include some of the changes meant for previous build

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

View File

@ -880,13 +880,15 @@ namespace IW4MAdmin
// this one is ok // this one is ok
catch (ServerException e) catch (ServerException e)
{ {
if (e is NetworkException && !Throttled) if (e is NetworkException && !Throttled && notifyDisconnects)
{ {
Logger.WriteError(loc["SERVER_ERROR_COMMUNICATION"].FormatExt($"{IP}:{Port}")); Logger.WriteError(loc["SERVER_ERROR_COMMUNICATION"].FormatExt($"{IP}:{Port}"));
Logger.WriteDebug(e.GetExceptionInfo()); Logger.WriteDebug(e.GetExceptionInfo());
} }
else
Logger.WriteError(e.Message); {
Logger.WriteError(e.Message);
}
return false; return false;
} }

View File

@ -18,6 +18,7 @@ namespace LiveRadar
private readonly IConfigurationHandler<LiveRadarConfiguration> _configurationHandler; private readonly IConfigurationHandler<LiveRadarConfiguration> _configurationHandler;
private bool addedPage; private bool addedPage;
private object lockObject;
public Plugin(IConfigurationHandlerFactory configurationHandlerFactory) public Plugin(IConfigurationHandlerFactory configurationHandlerFactory)
{ {
@ -28,13 +29,16 @@ namespace LiveRadar
{ {
// if it's an IW4 game, with custom callbacks, we want to // if it's an IW4 game, with custom callbacks, we want to
// enable the live radar page // enable the live radar page
if (E.Type == GameEvent.EventType.Start && lock (lockObject)
S.GameName == Server.Game.IW4 &&
S.CustomCallback &&
!addedPage)
{ {
E.Owner.Manager.GetPageList().Pages.Add(Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_RADAR_TITLE"], "/Radar/All"); if (E.Type == GameEvent.EventType.Start &&
addedPage = true; 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) if (E.Type == GameEvent.EventType.Unknown)

View File

@ -373,8 +373,6 @@ namespace SharedLibraryCore.Services
private static readonly Func<DatabaseContext, long, Task<EFClient>> _getUniqueQuery = private static readonly Func<DatabaseContext, long, Task<EFClient>> _getUniqueQuery =
EF.CompileAsyncQuery((DatabaseContext context, long networkId) => EF.CompileAsyncQuery((DatabaseContext context, long networkId) =>
context.Clients context.Clients
.Include(c => c.CurrentAlias)
.Include(c => c.AliasLink)
.Select(_client => new EFClient() .Select(_client => new EFClient()
{ {
ClientId = _client.ClientId, ClientId = _client.ClientId,
@ -385,7 +383,8 @@ namespace SharedLibraryCore.Services
LastConnection = _client.LastConnection, LastConnection = _client.LastConnection,
Masked = _client.Masked, Masked = _client.Masked,
NetworkId = _client.NetworkId, NetworkId = _client.NetworkId,
TotalConnectionTime = _client.TotalConnectionTime TotalConnectionTime = _client.TotalConnectionTime,
AliasLink = _client.AliasLink
}) })
.FirstOrDefault(c => c.NetworkId == networkId) .FirstOrDefault(c => c.NetworkId == networkId)
); );