From 4007b2eaafda65c1df8471b6011fe392a7664798 Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Mon, 22 May 2023 13:34:05 +0200 Subject: [PATCH] Fix cheat names and last error snippet --- robocop_ng/helpers/ryujinx_log_analyser.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/robocop_ng/helpers/ryujinx_log_analyser.py b/robocop_ng/helpers/ryujinx_log_analyser.py index 8a153b53..3394fa5c 100644 --- a/robocop_ng/helpers/ryujinx_log_analyser.py +++ b/robocop_ng/helpers/ryujinx_log_analyser.py @@ -363,7 +363,7 @@ def __get_mods(self): self._game_info["mods"] = "\n".join(mods_status) def __get_cheats(self): - cheat_regex = re.compile(r"Tampering program\s?") + cheat_regex = re.compile(r"Tampering program\s<(.+)>") matches = re.findall(cheat_regex, self._log_text) if matches: cheats = [f"ℹ️ {match}" for match in matches] @@ -621,7 +621,7 @@ def analyse_discord( ) -> dict[str, dict[str, str]]: last_error = self.get_last_error() if last_error is not None: - last_error = last_error[:2] + last_error = "\n".join(last_error[:2]) self._game_info["errors"] = f"```\n{last_error}\n```" else: self._game_info["errors"] = "No errors found in log" @@ -659,6 +659,13 @@ def analyse_discord( def analyse(self) -> dict[str, Union[dict[str, str], list[str], list[list[str]]]]: self._notes = list(self.__sort_notes()) + last_error = self.get_last_error() + if last_error is not None: + last_error = "\n".join(last_error[:2]) + self._game_info["errors"] = f"```\n{last_error}\n```" + else: + self._game_info["errors"] = "No errors found in log" + return { "hardware_info": self._hardware_info, "emu_info": self._emu_info,