riceEx / CITS3403-project

repo for project
1 stars 0 forks source link

Leaderboard backend functions missing #13

Closed LDY681 closed 4 months ago

LDY681 commented 4 months ago

Need to add backend implementations for leaderboard

API:

LDY681 commented 4 months ago

14 // increment score of current user if existed, else create new score

add_score(user_id, score): user_id: wihch user to update score: the amount to increment

LDY681 commented 4 months ago

14

TODO:

  1. get_scores // get all scores
  2. integrate websocket.io, send broadcast to frontend when there is an update to score table. Frontend should update the leaderboard once message is sent.
LDY681 commented 4 months ago

15

get_scores, get scores of all users @param page_no page number @param page_size page size @param order: asc or desc

LDY681 commented 4 months ago

16

Integrate websocket to frontend and backend listen to score table changes and emit score_update event join user.username to the score result