mirror of
https://github.com/BubbaGumpShrump/AutoTrackR2.git
synced 2025-06-18 12:49:06 +00:00
21 lines
No EOL
590 B
C#
21 lines
No EOL
590 B
C#
using System.Text.RegularExpressions;
|
|
|
|
namespace AutoTrackR2.LogEventHandlers;
|
|
|
|
public class GameVersionEvent : ILogEventHandler
|
|
{
|
|
public Regex Pattern { get; }
|
|
|
|
public GameVersionEvent()
|
|
{
|
|
Pattern = new Regex(@"--system-trace-env-id='pub-sc-alpha-(?<GameVersion>\d{3,4}-\d{7})'");
|
|
}
|
|
public void Handle(LogEntry entry)
|
|
{
|
|
if (entry.Message is null) return;
|
|
var match = Pattern.Match(entry.Message);
|
|
if (!match.Success) return;
|
|
|
|
TrackREventDispatcher.OnGameVersionEvent(match.Groups["GameVersion"].Value);
|
|
}
|
|
} |