KittenSoup / wardly

0 stars 4 forks source link

Create 'ready check' #14

Closed Callisto89 closed 6 years ago

Callisto89 commented 6 years ago
ProHugoLeet commented 6 years ago

Created in Pull request #23

ProHugoLeet commented 6 years ago
  1. App calls startReadyCheck(EventId)

  2. Function in dataHandler calls backend startReadyCheck(EventId) 2a Backend checks if readyCheckTimeOut is running. 3a. Backend pushes readyCheckOpen(EventId) to all users in playerList for EventId. 3b. Backend starts readyCheckTimeOut(eventId) for 30s.

  3. App pushHandler recieves readyCheckOpen(EventId)

  4. App launches readyCheckPopup()

  5. Player responds Ready/NotReady.

  6. App calls dataHandler call readyCheckAnswer(Ready/NotRead, eventId).

  7. dataHandler calls backend readyCheckAnswer(Ready/NotReady, eventId).

for every readyCheckAnswer backend pushes update event to app. for every readyCheckAnswer backend checks if all players have answered.

  1. App pushHandler recieves eventUpdated (3b->) 10. readyCheckTimeOut answers NotReady for players that have not responded. (*Update shemesindex)

  2. When last players answer; (Manual or by 30sec timeout) if ready players =5 abort.

if player in LastReadyCheck exists in playerlist - abort.

  1. Move unready players to waiting list.

  2. Add first player moved to LastReadyCheck. Move players from waitinglist to playerlist. Send readyCheckOpen(eventId) to players in PlayerList that are not ready. Backend starts readyCheckTimeOut(eventId) for 30s. (4-9)

  3. when aborted backend sends readyCheckComplete(eventId) to app.

  4. pushHandler recieves readyCheckComplete(eventId)

  5. if eventplayers =5 send WOWOWOOo READY TO RUMBLEEEE if <5 send Not enough players :,(