The endGame function doesn't check if the gameTime has actually ended.
Currently, the function assumes that the game has ended based on the gameActive
flag. However, without verifying that the endTime
has been reached, the owner could prematurely end the game.
This could allow:
Fewer players to join or participate.
Confusion among players who still see the game as ongoing based on the timer.
Game could be ended early
Players may be confused, especially if the time/UI shows the game as ongoing
Manual review
Add a time check to ensure the game duration has completed before allowing it to end:
Incorrect values reported when a game is ended early
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.