2018-04-23 01:43:48 -04:00
|
|
|
|
using SharedLibraryCore;
|
2018-11-05 22:01:29 -05:00
|
|
|
|
using SharedLibraryCore.Database.Models;
|
2018-04-15 00:26:27 -04:00
|
|
|
|
using System;
|
2018-04-23 01:43:48 -04:00
|
|
|
|
using System.Text.RegularExpressions;
|
2018-04-15 00:26:27 -04:00
|
|
|
|
|
2018-04-25 02:38:59 -04:00
|
|
|
|
namespace IW4MAdmin.Application.EventParsers
|
2018-04-15 00:26:27 -04:00
|
|
|
|
{
|
|
|
|
|
class IW5EventParser : IW4EventParser
|
|
|
|
|
{
|
2018-11-25 21:00:36 -05:00
|
|
|
|
public override string GetGameDir()
|
|
|
|
|
{
|
|
|
|
|
return "logs";
|
|
|
|
|
}
|
2018-04-23 01:43:48 -04:00
|
|
|
|
|
|
|
|
|
public override GameEvent GetEvent(Server server, string logLine)
|
|
|
|
|
{
|
|
|
|
|
string cleanedEventLine = Regex.Replace(logLine, @"[0-9]+:[0-9]+\ ", "").Trim();
|
|
|
|
|
|
|
|
|
|
if (cleanedEventLine.Contains("J;"))
|
|
|
|
|
{
|
|
|
|
|
string[] lineSplit = cleanedEventLine.Split(';');
|
|
|
|
|
|
|
|
|
|
int clientNum = Int32.Parse(lineSplit[2]);
|
|
|
|
|
|
2018-11-05 22:01:29 -05:00
|
|
|
|
var player = new EFClient()
|
2018-04-23 01:43:48 -04:00
|
|
|
|
{
|
|
|
|
|
NetworkId = lineSplit[1].ConvertLong(),
|
|
|
|
|
ClientNumber = clientNum,
|
2018-11-25 21:00:36 -05:00
|
|
|
|
CurrentAlias = new EFAlias()
|
|
|
|
|
{
|
|
|
|
|
Active = false,
|
|
|
|
|
Name = lineSplit[3]
|
|
|
|
|
}
|
2018-04-23 01:43:48 -04:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return new GameEvent()
|
|
|
|
|
{
|
2018-11-07 21:30:11 -05:00
|
|
|
|
Type = GameEvent.EventType.PreConnect,
|
2018-11-05 22:01:29 -05:00
|
|
|
|
Origin = new EFClient()
|
2018-04-23 01:43:48 -04:00
|
|
|
|
{
|
|
|
|
|
ClientId = 1
|
|
|
|
|
},
|
2018-11-05 22:01:29 -05:00
|
|
|
|
Target = new EFClient()
|
2018-04-23 01:43:48 -04:00
|
|
|
|
{
|
|
|
|
|
ClientId = 1
|
|
|
|
|
},
|
|
|
|
|
Owner = server,
|
|
|
|
|
Extra = player
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else
|
2018-11-25 21:00:36 -05:00
|
|
|
|
{
|
2018-04-23 01:43:48 -04:00
|
|
|
|
return base.GetEvent(server, logLine);
|
2018-11-25 21:00:36 -05:00
|
|
|
|
}
|
2018-04-23 01:43:48 -04:00
|
|
|
|
}
|
2018-04-15 00:26:27 -04:00
|
|
|
|
}
|
|
|
|
|
}
|