No Description

Kirk Trombley 415fddb890 Initial commit, some basic server code 3 years ago
client 415fddb890 Initial commit, some basic server code 3 years ago
server 415fddb890 Initial commit, some basic server code 3 years ago
.gitignore 415fddb890 Initial commit, some basic server code 3 years ago
README.md 415fddb890 Initial commit, some basic server code 3 years ago

README.md

Tank Tactics

Operations

All operations on a game will cause the server to distribute tokens if needed

GET /games

Return list of current games

{
    games: [{
        id: "string",
        name: "string",
    }],
}

PUT /game

Create a new game with a given name

{
    name: "string",
    width: 0,
    height: 0,
}

Returns ID

{
    id: "string",
    name: "string",
}

GET /game/{id}

Get a game with a given id

{
    name: "string", // display name of the game
    state: "LOBBY" || "PLAYING" || "FINISHED",
    width: 0, // board dimensions
    height: 0,
    distribute: "string", // next time points will be distributed
    players: {
        [code]: { // keyed by a player code string
            name: "string", // user-defined
            tank: null || { // null if jury
                x: 0,
                y: 0,
                points: 1,
                health: 3,
                range: 1,
            },
            vote: null || "string", // code of current jury vote
        }
    }
}

POST /game/{id}/join

Join a game

{
    name: "string",
}

Returns player code

{
    code: "string",
}

POST /game/{id}/start

Start a game, game must be in LOBBY state

POST /game/{id}/{fire,move,give}/{code}

Fire on, move to, or give to a target, game must be in PLAYING state

{
    x: 0,
    y: 0,
}

Returns

{
    result: true,
    reason: "string" || null, // reason for failure if applicable
}

POST /game/{id}/upgrade/{code}

Upgrade the range of a tank, game must be in PLAYING state Returns

{
    result: true,
    reason: "string" || null, // reason for failure if applicable
}

POST /game/{id}/vote/{code}

Set a jury vote, game must be in PLAYING state

{
    vote: "string" || null,
}