Crate backend

source ·

Modules

Structs

  • Deletes all the players and their data.
  • Creates a new player with the provided username. The new player will have the following defaults: Health = 3, X and Y positions = Center of HTML5 canvas.
  • Reads the save file and sends a json object with all the players to the caller.
  • Judges if players picked the right question. If it’s incorrect, 1HP is substracted from their health
  • Returns a json object containing a single number of players in the game session
  • Returns a specific question when provided with the question ID.
  • Replies with a random question from the set
  • Reads the save file and updates the requested player stats.

Functions

  • clear 🔒
    Deletes all the players and their data.
  • Creates a new player with the provided username. The new player will have the following defaults: Health = 3, X and Y positions = Center of HTML5 canvas.
  • Reads the save file and sends a json object with all the players to the caller.
  • judge 🔒
    Judges if players picked the right question. If it’s incorrect, 1HP is substracted from their health
  • main 🔒
  • Returns a json object containing a single number of players in the game session
  • questionid 🔒
    Returns a specific question when provided with the question ID.
  • Replies with a random question from the set
  • Reads the save file and updates the requested player stats.