moloch-- / RootTheBox

A Game of Hackers (CTF Scoreboard & Game Manager)
http://root-the-box.com/
Apache License 2.0
915 stars 292 forks source link

Scoreboard placing is incorrect and based on the last person who scored. #560

Closed tetravaal4 closed 1 year ago

tetravaal4 commented 1 year ago

While playing a game if there are two players with the same score, the last person who scored shows as first place, even if another user has the same score and scored the final flag before them.

EX. Player 1 - Scores final flag - Total Score 100 Player 2 - Scores final flag 10 minutes later - Total Score 100

Result Player 2 in 1st place Player 1 in 2nd place

I would assume that in the event of a tie, the person who scored first would remain in the top position.

image

Mega fan of your work!

eljeffeg commented 1 year ago

Yeah, you're right. There were two ways to rank, score & flags.

But if you don't use hints and flag values are equal, there is no time component so it would just sort by first registered team. I think adding a time component makes sense. This is what I'm thinking:

I'm thinking putting time before flag count when ranking based off of score as it would seem to me that when basing things on score, the number of flags captured should be somewhat irrelevant if another team gets a score first.

tetravaal4 commented 1 year ago

I agree with that methodology. It should solve any "same score" scenarios and I really appreciate you taking the time! I wish I were better on the coding side and could help, but I will offer some beer money because of how awesome RTB is and how responsive you are. Let me know if you have a tip jar, or cup of coffee link..

As a fun anecdote, I was running a game today and we had a same score scenario combined with the exact same time of capture on the last flag. To fix even this scenario, we are going to implement point decrements for incorrect questions.

image

Thanks again!

eljeffeg commented 1 year ago

I pushed up the change if you can give it a test.

eljeffeg commented 1 year ago

If you don't mind unsolicited advice, with point decrements for incorrect questions you'll want to review your stats periodically for incorrect guesses and adjust your tokens to include simple mistakes (via regex or something). Of course, this will depend on your game. If you wrap your flag in something like FLAG{...} then it's usually a non-issue, but it sucks to lose a point (and maybe the game) because of case sensitivity or formatting when you feel you got the answer correct.