/// <summary> /// Loads and verifies the current MHW:IB process against the currently supported version. /// </summary> /// TODO: Make it more oo by making this the constructor for an abstract automaton. /// Then have inhertied automatons work based on different versions. /// This would allow for backward compatability /// private void LoadAndVerifyProcess() { Log.Message("Attempting to load MHW:IB Process."); // First set the mhw process _Process = StaticHelpers.GetMHWProcess(); Log.Message("Process Loaded. Retrieving version"); // Now verify the version Match match = Regex.Match(_Process.MainWindowTitle, MHWMemoryValues.SupportedVersionRegex); // If the match is made if (match.Success) { // And we have a capture group if (match.Groups.Count > 1) { // Try to turn it into a number if (int.TryParse(match.Groups[1].Value, out int result)) { Log.Message("Version found: " + result); // If it is a numeber and is the same as the supported version if (result == MHWMemoryValues.SupportedGameVersion) { // Set the flag _IsSupportedVersion = true; return; } Log.Warning( "Version unsupported. Currently supported version: " + MHWMemoryValues.SupportedGameVersion + "\n\t\tAutomaton will still run, however, correct sequences cannot be read" ); return; } } } Log.Error( "Could not verify game version. This is most likely due to a different versioning system being used by Capcom." + "\n\t\tAutomaton will still run, however, correct sequences cannot be read" ); }