fix issue with log reader
fix issue with searching names on webfront that could be parsed to hex
This commit is contained in:
parent
034d887abd
commit
1c66ac9117
@ -55,7 +55,9 @@ namespace IW4MAdmin.Application.IO
|
||||
long fileSize = _reader.Length;
|
||||
|
||||
if (previousFileSize == 0)
|
||||
{
|
||||
previousFileSize = fileSize;
|
||||
}
|
||||
|
||||
long fileDiff = fileSize - previousFileSize;
|
||||
|
||||
@ -63,9 +65,7 @@ namespace IW4MAdmin.Application.IO
|
||||
if (fileDiff < 1 && fileSize != -1)
|
||||
return;
|
||||
|
||||
previousFileSize = fileSize;
|
||||
|
||||
var events = await _reader.ReadEventsFromLog(_server, fileDiff, fileSize - fileDiff);
|
||||
var events = await _reader.ReadEventsFromLog(_server, fileDiff, previousFileSize);
|
||||
|
||||
foreach (var ev in events)
|
||||
{
|
||||
|
@ -39,7 +39,7 @@ namespace IW4MAdmin.Application.IO
|
||||
using (var rd = new StreamReader(new FileStream(LogFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite), Utilities.EncodingType))
|
||||
{
|
||||
char[] buff = new char[fileSizeDiff];
|
||||
rd.BaseStream.Seek(-fileSizeDiff, SeekOrigin.End);
|
||||
rd.BaseStream.Seek(startPosition, SeekOrigin.Begin);
|
||||
await rd.ReadAsync(buff, 0, (int)fileSizeDiff);
|
||||
|
||||
var stringBuilder = new StringBuilder();
|
||||
|
@ -100,6 +100,10 @@ namespace IW4MAdmin.Plugins.Stats
|
||||
|
||||
await Manager.AddStandardKill(E.Origin, E.Target);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception();
|
||||
}
|
||||
break;
|
||||
case GameEvent.EventType.Damage:
|
||||
if (!E.Owner.CustomCallback && !ShouldIgnoreEvent(E.Origin, E.Target))
|
||||
|
@ -489,15 +489,8 @@ namespace SharedLibraryCore.Services
|
||||
var iqClients = context.Clients
|
||||
.Where(_client => _client.Active);
|
||||
|
||||
if (networkId.HasValue)
|
||||
{
|
||||
iqClients = iqClients.Where(_client => networkId.Value == _client.NetworkId);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
iqClients = iqClients.Where(_client => linkIds.Contains(_client.AliasLinkId));
|
||||
}
|
||||
|
||||
iqClients = iqClients.Where(_client => networkId == _client.NetworkId || linkIds.Contains(_client.AliasLinkId));
|
||||
|
||||
// we want to project our results
|
||||
var iqClientProjection = iqClients.OrderByDescending(_client => _client.LastConnection)
|
||||
|
Loading…
Reference in New Issue
Block a user