Function backend::get_players

source ·
pub(crate) async fn get_players() -> impl Responder
Expand description

Reads the save file and sends a json object with all the players to the caller.

How to use:

The request structure is the following: http://ip_address/players

The json file that’s replied back is structured like the following:

        name: "<PLAYER_NAME>"
        xpos: <XPOS>
        ypos: <YPOS>
        health: <HEALTH>
        name: "<PLAYER2_NAME>"