Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.