mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-22 13:10:26 -05:00
small updates to stat handling
various little tweaks
This commit is contained in:
@ -72,6 +72,7 @@ namespace IW4MAdmin.Application.IO
|
||||
foreach (var ev in events)
|
||||
{
|
||||
_server.Manager.GetEventHandler().AddEvent(ev);
|
||||
await ev.WaitAsync(Utilities.DefaultCommandTimeout, ev.Owner.Manager.CancellationToken);
|
||||
}
|
||||
|
||||
previousFileSize = fileSize;
|
||||
|
@ -36,14 +36,15 @@ namespace IW4MAdmin.Application.IO
|
||||
List<string> logLines = new List<string>();
|
||||
|
||||
// open the file as a stream
|
||||
using (var rd = new StreamReader(new FileStream(LogFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite), Utilities.EncodingType))
|
||||
using (FileStream fs = new FileStream(LogFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
|
||||
{
|
||||
char[] buff = new char[fileSizeDiff];
|
||||
rd.BaseStream.Seek(startPosition, SeekOrigin.Begin);
|
||||
await rd.ReadAsync(buff, 0, (int)fileSizeDiff);
|
||||
|
||||
byte[] buff = new byte[fileSizeDiff];
|
||||
fs.Seek(startPosition, SeekOrigin.Begin);
|
||||
await fs.ReadAsync(buff, 0, (int)fileSizeDiff, server.Manager.CancellationToken);
|
||||
var stringBuilder = new StringBuilder();
|
||||
foreach (char c in buff)
|
||||
char[] charBuff = Utilities.EncodingType.GetChars(buff);
|
||||
|
||||
foreach (char c in charBuff)
|
||||
{
|
||||
if (c == '\n')
|
||||
{
|
||||
|
@ -1,7 +1,6 @@
|
||||
using SharedLibraryCore;
|
||||
using SharedLibraryCore.Interfaces;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
Reference in New Issue
Block a user