Skip to content

Instantly share code, notes, and snippets.

@jochumdev
Created May 7, 2018 23:33
Show Gist options
  • Save jochumdev/15886d7253ab515bcc88817c4fcea076 to your computer and use it in GitHub Desktop.
Save jochumdev/15886d7253ab515bcc88817c4fcea076 to your computer and use it in GitHub Desktop.
WzLobby API V1

WzRESTLobby API V1 Documentation

This document describes the V1 API of WzRESTLobby

/api/v1/login

POST

Login to lobby with the given username and password.

returns: JWT access token

/api/v1/lobby

GET

Lists the current active games in Lobby.

returns: object

{
    "host"           : "127.0.0.1",
    "port"           : 2100,
    "description"    : "Test 1",
    "currentPlayers" : 1,
    "maxPlayers"     : 3,
    "multiVer"       : "Warzone 2100 master",
    "wzVerMajor"     : 0x1000,
    "wzVerMinor"     : 0,
    "isPrivate"      : false,
    "modlist"        : "",
    "mapname"        : "Sk-Rush-T1",
    "hostplayer"     : "Fastdeath",
    "limits"         : 0x0
}

POST

Creates a new game on the lobby.

returns: UUID

/api/v1/lobby/<UUID>/

GET

Get detailed informations about a game in lobby.

returns: object

{
    "host"           : "127.0.0.1",
    "port"           : 2100,
    "description"    : "Test 1",
    "currentPlayers" : 1,
    "maxPlayers"     : 3,
    "multiVer"       : "Warzone 2100 master",
    "wzVerMajor"     : 0x1000,
    "wzVerMinor"     : 0,
    "isPrivate"      : false,
    "modlist"        : "",
    "mapname"        : "Sk-Rush-T1",
    "hostplayer"     : "Fastdeath",
    "limits"         : 0x0,
    "players":  [
        {
            "name": "Fastdeath", 
            "rank": "not-sure-what-to-put-here", 
            "team": "a",
            "isAI": false,
            "available": false
        },
        {
            "name": "NullBot",
            "team": "b",
            "isAI": true,
            "available": false
        }
        {
            "name": "pastdue", 
            "rank": "not-sure-what-to-put-here", 
            "team": "c",
            "isAI": false,
            "available": false
        }
    ]
}

PUT

Changes a game.

optional arguments: description, isPrivate, mapname

returns: NONE

DELETE

Deletes the game if it was created by the authenticated user or the authenticated user is an admin.

returns: boolean

/api/v1/lobby/<UUID>/player/

POST

Add a new player to the game.

arguments: name, slot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment