add official T4/WaW support for issue #178

CoD4x parser tweak to parse full guid as decimal
This commit is contained in:
RaidMax
2020-12-13 20:33:37 -06:00
parent f03626c3ae
commit 02b910234a
7 changed files with 54 additions and 10 deletions

View File

@ -93,16 +93,25 @@ namespace IW4MAdmin.Application.EventParsers
public virtual GameEvent GenerateGameEvent(string logLine)
{
var timeMatch = Configuration.Time.PatternMatcher.Match(logLine);
int gameTime = 0;
var gameTime = 0L;
if (timeMatch.Success)
{
gameTime = timeMatch
.Values
.Skip(2)
// this converts the timestamp into seconds passed
.Select((_value, index) => int.Parse(_value.ToString()) * (index == 0 ? 60 : 1))
.Sum();
if (timeMatch.Values[0].Contains(":"))
{
gameTime = timeMatch
.Values
.Skip(2)
// this converts the timestamp into seconds passed
.Select((_value, index) => long.Parse(_value.ToString()) * (index == 0 ? 60 : 1))
.Sum();
}
else
{
gameTime = long.Parse(timeMatch.Values[0]);
}
// we want to strip the time from the log line
logLine = logLine.Substring(timeMatch.Values.First().Length);
}