Skip to content

Commit

Permalink
fix: fix alert typo
Browse files Browse the repository at this point in the history
  • Loading branch information
TrueRou committed Feb 13, 2024
1 parent 4e45d7c commit 0607a98
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/usecases/anticheat.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ def _parse_score(score: Score) -> (ReplayString, Optional[Beatmap]):
return circleguard.ReplayString(replay_data), cg_beatmap


async def _save_suspicion(score: Score, reason: str, detail: dict):
if score.player and score.player.is_online:
async def _save_suspicion(score: Score, reason: str, detail: dict, alert: bool = True):
if score.player and score.player.is_online and alert:
score.player.send_bot("Suspicion detected, we will do nothing but record it to the database.")
score.player.send_bot(f"Suspicion reason: {reason}")
score.player.send_bot("We are currently using experimenting anticheat. If it's a mistake, please contect stuff for help.")
score.player.send_bot("We are currently using experimenting anticheat. If it's a mistake, please contact staff for help.")
async with app.state.services.db_session() as session:
obj = ScoresSuspicion(score_id=score.id, suspicion_reason=reason, suspicion_time=datetime.now(), detail=detail)
await app.orm_utils.add_model(session, obj)
Expand Down Expand Up @@ -162,7 +162,7 @@ async def validate_checksum(unique_ids: str, osu_version: str, client_hash_decod
},
}

await _save_suspicion(score, f"mismatching hashes on score submission", detail)
await _save_suspicion(score, f"mismatching hashes on score submission", detail, alert=False)

async def check_suspicion(player: Player, score: Score):
replay, beatmap = _parse_score(score)
Expand Down

0 comments on commit 0607a98

Please sign in to comment.