j3k0 / ganomede-statistics

Ganomede statistics module
0 stars 0 forks source link

Rankings broken when games aren't ordered by date #1

Open j3k0 opened 7 years ago

j3k0 commented 7 years ago

When games aren't ordered by date, the users ranking/points computation is wrong: new points count takes into account games played in the future.

This wasn't an issue until I migrated the database and lost the correspondence between the game's timestamp and database's sequence number...

Find below the proposed fix.

Definitions:

Current code:

New code:

note: waitingList is ordered by date, so, even though processing of waitingList could share the same code as processing of readingList, there shouldn't be any future game to remove from archive...

j3k0 commented 7 years ago

no... would be better to add entries read from database right into waiting list... then process waiting list until it's empty