Skip to content

Commit

Permalink
feat: send challenge score after invalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
thatchinkumar2005 committed Feb 9, 2025
1 parent d351309 commit 7b780c7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/validator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,19 @@ pub fn game_handler(
}

if _game_state.in_validation.is_invalidated {
return Some(Ok(send_terminate_game_message(
let mut response = send_terminate_game_message(
socket_request.frame_number,
_game_state.in_validation.message.clone(),
)));
);
let challenge = if let Some(challenge_state) = _game_state.challenge {
Some(ChallengeResponse {
score: challenge_state.score,
})
} else {
None
};
response.challenge = challenge;
return Some(Ok(response));
}

let spawn_result = _game_state
Expand Down

0 comments on commit 7b780c7

Please sign in to comment.