Function backend::update_player

source ·
pub(crate) async fn update_player(data: Path<String>) -> impl Responder
Expand description

Reads the save file and updates the requested player stats.

How to use

The request structure is the following: http://ip_address/update/<NAME>:<STAT>:<VALUE>

  • <NAME> is replaced with the username of the player you’re trying yo update
  • <STAT> is replaced with the stat that you want to update, which can be:
    • health, which is deprecated in favor of /judge
    • xpos, which means you want to update the position of the player in the X coordenate
    • ypos, which means you want to update the position of the player in the Y coordinate The reply will simply be a json object containing “OK” if the operation succeeded.