Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add script error checking to log reader #59

Merged
merged 7 commits into from
Sep 26, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions reaper/cogs/log_reading.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ async def on_message(self, message):
double_barrel_crash = False
mod_problem = False
invalid_value = False
script_error = []
crash_counter = 0
filename = None
audio_list = []
Expand Down Expand Up @@ -243,6 +244,20 @@ async def on_message(self, message):
problem_found = True
framework_error = True

elif "SCRIPT ERROR" in line:
dm_log.add_field(
name="",
value="SCRIPT ERROR: True",
inline=False,
)
logger.info("I found a script error!")
problem_found = True
j = i
while lines[j] != "" and j < i + 15:
Bobbyperson marked this conversation as resolved.
Show resolved Hide resolved
script_error.append(lines[j])
logger.info(lines[j])
j += 1

elif (
'Failed reading masterserver authentication response: encountered parse error "Invalid value."'
in line
Expand Down Expand Up @@ -428,6 +443,14 @@ async def on_message(self, message):
inline=False,
)

if script_error:
logger.info("adding field")
problem.add_field(
name="Script Error",
value=f"The following script error was found: \n ```{'\n'.join(script_error)}```\nYou likely have an old or outdated mod. You can try to find it based on the files listed in this part of the log and delete it, or wait for a human to give you more information.",
inline=False,
)

if mod_problem:
if double_barrel_crash:

Expand Down
Loading