Tutorial

Join a game

Join a game by simply call /fights/:gameToken/players/:playerKey in POST, with :

  • gameToken : the token of the game
  • playerKey : the key (or id) of your player. To make it simple, this key will authenticate you during the game : just a few characters are required.

You should also pass some informations inside the request body :

  • character : the character you will use.

The 6 characters available are : WARRIOR, PALADIN, DRUID, SORCERER, ELF and TROLL.

  • name : the name of your player
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \
   "character": "warrior", \
   "name": "Vince" \
 }' 'https://coding-game.swat-sii.fr/api/fights/9nrrx5/players/vog'

The response of the API is a JSON with these informations on your player :

{
  "token": "9nrrx5",
  "status": "WAITING",
  "countDown": null,
  "me": {
    "healthPoints": 1000,
    "armor": 20,
    "character": {
      "armor": 20,
      "name": "WARRIOR",
      "actions": [
        {
          "name": "SWORD_STROKE",
          "description": null,
          "coolDown": 1
        },
        {
          "name": "THRUST",
          "description": null,
          "coolDown": 2
        },
        {
          "name": "STRONG_STROKE",
          "description": null,
          "coolDown": 4
        },
        {
          "name": "HEATER_SHIELD",
          "description": null,
          "coolDown": 1
        }
      ]
    }
  },
  "foe": null
}

results matching ""

    No results matching ""