https://catan-engine.herokuapp.com/Catan/managerRequest/
{
"username": "username",
"password": "password",
"command": "newGame",
"arguments":
{
"scenario": "scenario"
}
}
- only
SettlersOfCatanis implemented forscenarioat this moment
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments":
{
"gameId": "gameId"
}
}
gameIdis a random generated identifier
{
"username": "username",
"password": "password",
"command": "setMaxPlayers",
"arguments":
{
"gameId": "gameId",
"maxPlayers": "a number between 3 and 6 (integer)"
}
}
setMaxPlayerscan be sent whenever betweennewGameandstartGame
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments": null
}
{
"username": "username",
"password": "password",
"command": "addPlayer",
"arguments":
{
"gameId": "gameId"
}
}
addPlayercan be sent whenever betweensetMaxPlayersandstartGame
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments":
{
"playerId": "playerId"
}
}
playerIdis a random generated identifier
{
"username": "username",
"password": "password",
"command": "removePlayer",
"arguments":
{
"gameId": "gameId",
"playerId": "playerId"
}
}
removePlayercan be sent whenever betweensetMaxPlayersandstartGame
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments": null
}
{
"username": "username",
"password": "password",
"command": "startGame",
"arguments":
{
"gameId": "gameId"
}
}
startGamecan be sent only once, if at least one player has been added
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments":
{
"board": "array of tiles",
"ports": "array of intersections"
}
}
boardcontains for each tile a random resource, including a desert, and a random number for the dice sumportscontains for the fixed intersections a random port
{
"username": "username",
"password": "password",
"command": "changePlayerStatus",
"arguments":
{
"gameId": "gameId",
"playerId": "playerId",
"active": "true or false (boolean)"
}
}
changePlayerStatuscan be sent whenever betweennewGameandendGame
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments": null
}
{
"username": "username",
"password": "password",
"command": "getRanking",
"arguments":
{
"gameId": "gameId"
}
}
getRankingcan be sent whenever betweenstartGameandendGame
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments":
{
"player_0": "playerId",
"publicScore_0": "number of public points, without Victory Points development cards (integer)",
"hiddenScore_0": "number of hidden points, with Victory Points development cards (integer)",
"player_1": "playerId",
"publicScore_1": "number of hidden points, with Victory Points development cards (integer)",
"hiddenScore_1": "number of hidden points, with Victory Points development cards (integer)",
"foundWinner": false
}
}
- if
foundWinneris true, onlyendGamecan be sent next
{
"username": "username",
"password": "password",
"command": "endGame",
"arguments":
{
"gameId": "gameId"
}
}
endGamecan be sent whenever afterstartGameand removes the game identifier
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments": null
}
https://catan-engine.herokuapp.com/Catan/userRequest/
{
"gameId": "gameId",
"playerId": "playerId",
"command": "buildSettlement",
"arguments":
{
"intersection": "number of intersection (integer)"
}
}
- works only in the first two rounds
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments": null
}
{
"gameId": "gameId",
"playerId": "playerId",
"command": "buildRoad",
"arguments":
{
"start": "number of first intersection (integer)",
"end": "number of last intersection (integer)"
}
}
- should be after
buildSettlement - the intersections order does not matter
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments": null
}
{
"gameId": "gameId",
"playerId": "playerId",
"command": "rollDice",
"arguments": null
}
- works only after the turn starts (after the last
buildRoador afterendTurn)
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments":
{
"dice_0": "second dice value (integer)",
"dice_1": "first dice value (integer)",
"player_0": "playerId",
"lumber_0": "number of received lumbers (integer)",
"wool_0": "number of received wools (integer)",
"grain_0": "number of received grains (integer)",
"brick_0": "number of received bricks (integer)",
"ore_0": "number of received ores (integer)",
"resourcesToDiscard_0": "0 or half (rounded down) if rolled seven and has eight or more resources (integer)",
"player_1": "playerId",
"lumber_1": "number of received lumbers (integer)",
"wool_1": "number of received wools (integer)",
"grain_1": "number of received grains (integer)",
"brick_1": "number of received bricks (integer)",
"ore_1": "number of received ores (integer)",
"resourcesToDiscard_1": "0 or half (rounded down) if rolled seven and has eight or more resources (integer)"
}
}
_0(or_1,_2,_3) groups information for each playerplayer_0contains the player identifier for which the information with_0will be about (and so on)- if the dice sum is not seven,
resourcesToDiscardis 0 - if the dice sum is seven,
lumber,wool,grain,brick,oreare 0
Discard half of your resource cards if the dice sum is seven and you have eight or more resource cards
{
"gameId": "gameId",
"playerId": "playerId",
"command": "discardResources",
"arguments":
{
"lumber": "number of lumbers to discard (integer)",
"wool": "number of wools to discard (integer)",
"grain": "number of grains to discard (integer)",
"brick": "number of bricks to discard (integer)",
"ore": "number of ores to discard (integer)"
}
}
- for example, if
resourcesToDiscard_0is greater than 0 (the dice sum is seven), the player with the identifier fromplayer_0must senddiscardResources, otherwise the game will not continue (available for all players)
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments":
{
"sentAll": "true or false (boolean)"
}
}
- if the code is 200, the specified resources are moved from the player to the bank
- if the code is 202, the player must send again
discardResources - if
sentAllis true, the game can continue
{
"gameId": "gameId",
"playerId": "playerId",
"command": "moveRobber",
"arguments":
{
"tile": "a number between 0 and 18 (integer)"
}
}
- if the dice sum is seven and no player has eight or more resource cards, the current player must send
moveRobber, otherwise the game will not continue
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments":
{
"player_0": "playerId from which to steal a resource",
"player_1": "playerId from which to steal a resource"
}
}
- if the code is 200, the robber is moved on the requested tile
- the players identified by these players identifier have buildings on the tile where the robber was moved
{
"gameId": "gameId",
"playerId": "playerId",
"command": "stealResource",
"arguments":
{
"answer": "yes or no (just one per request)",
"player": "playerId"
}
}
- if
answerisno, the current player will not steal any resource card and the game continues playershould contain the player identifier from themoveRobberresponse arguments- if the current player moved the robber or uses the Knight development card, he must send
stealResource, otherwise the game will not continue
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments":
{
"resource": "random stolen resource"
}
}
- if the
answerwasyesand the code is 200, the stolen resource is moved from the selected player to the current player
{
"gameId": "gameId",
"playerId": "playerId",
"command": "playerTrade",
"arguments":
{
"lumber_o": "number of lumbers to offer (integer)",
"wool_o": "number of wools to offer (integer)",
"grain_o": "number of grains to offer (integer)",
"brick_o": "number of bricks to offer (integer)",
"ore_o": "number of ores to offer (integer)",
"lumber_r": "number of requested lumbers (integer)",
"wool_r": "number of requested wools (integer)",
"grain_r": "number of requested grains (integer)",
"brick_r": "number of requested bricks (integer)",
"ore_r": "number of requested ores (integer)"
}
}
playerTradecan be sent whenever betweenrollDiceandendTurn(if there is no special case)
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments": null
}
{
"gameId": "gameId",
"playerId": "playerId",
"command": "wantToTrade",
"arguments": null
}
- the current player is not allowed to send
wantToTrade
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments": null
}
{
"gameId": "gameId",
"playerId": "playerId",
"command": "sendPartners",
"arguments": null
}
- the current player must send
sendPartnerif he sentplayerTrade
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments":
{
"player_0": "playerId",
"player_1": "playerId"
}
}
{
"gameId": "gameId",
"playerId": "playerId",
"command": "selectPartner",
"arguments":
{
"player": "playerId"
}
}
- the current player must send
selectPartnerif he sentsendPartners playercontains the player identifier from thesendPartnersresponse argumentsplayercan contain null only if no other player wanted to trade
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments": null
}
- if the code is
200, the specified resources inplayerTradeare transferred from the current player to the selected player and vice versa
{
"gameId": "gameId",
"playerId": "playerId",
"command": "noPlayerTrade",
"arguments":
{
"port": "-1 if with bank or the number of the intersection of a port (integer)",
"offer": "offered resource",
"request": "requested resource"
}
}
noPlayerTradeis for bank trade (if sent port is -1) and for port trade otherwise
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments": null
}
- if the code is
200, the specified resources are transferred from the current player to the bank and vice versa
{
"gameId": "gameId",
"playerId": "playerId",
"command": "buyRoad",
"arguments":
{
"start": "number of first intersection (integer)",
"end": "number of last intersection (integer)"
}
}
buyRoadcan be sent whenever betweenrollDiceandendTurn(if there is no special case)
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments": null
}
{
"gameId": "gameId",
"playerId": "playerId",
"command": "buySettlement",
"arguments":
{
"intersection": "number of intersection (integer)"
}
}
buySettlementcan be sent whenever betweenrollDiceandendTurn(if there is no special case)
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments": null
}
{
"gameId": "gameId",
"playerId": "playerId",
"command": "buyCity",
"arguments":
{
"intersection": "number of intersection (integer)"
}
}
buyCitycan be sent whenever betweenrollDiceandendTurn(if there is no special case)
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments": null
}
{
"gameId": "gameId",
"playerId": "playerId",
"command": "buyDevelopment",
"arguments": null
}
buyDevelopmentcan be sent whenever betweenrollDiceandendTurn(if there is no special case)
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments":
{
"development": "random bought development"
}
}
{
"gameId": "gameId",
"playerId": "playerId",
"command": "useDevelopment",
"arguments":
{
"development": "knight or monopoly or roadBuilding or yearOfPlenty (just one per request)"
}
}
useDevelopmentcan be sent whenever betweenrollDiceandendTurn(if there is no special case)- for
knight, the current player must send nextmoveRobberandstealResourcerequests - for
monopoly, the current player must send nexttakeResourceFromAllrequest - for
roadBuilding, the current player must send next two validbuildDevelopmentRoadrequests - for
yearOfPlenty, the current player must send nexttakeTwoResourcesrequest
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments": null
}
Take all resource cards of the specified type from all the other players if you use Monopoly development card
{
"gameId": "gameId",
"playerId": "playerId",
"command": "takeResourceFromAll",
"arguments":
{
"resource": "requested resource"
}
}
takeResourceFromAllmust be sent after a validuseDevelopmentwithmonopolyrequest
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments":
{
"player_0": "playerId",
"resources_0": "number of resources to steal (integer)",
"player_1": "playerId",
"resources_1": "number of resources to steal (integer)"
}
}
resources_0contains the number of resources of the requested type that were stolen fromplayer_0- if the code is 200, all the resources of the requested type are moved from all the players who have
resourcesgreater than 0 to the current player
{
"gameId": "gameId",
"playerId": "playerId",
"command": "buildDevelopmentRoad",
"arguments":
{
"start": "number of first intersection",
"end": "number of last intersection"
}
}
- this request must be sent after a valid
useDevelopmentwithroadBuildingrequest
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments": null
}
{
"gameId": "gameId",
"playerId": "playerId",
"command": "takeTwoResources",
"arguments":
{
"resource_0": "second requested resource",
"resource_1": "first requested resource"
}
}
- this request must be sent after a valid
useDevelopmentwithyearOfPlentyrequest
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments": null
}
- if the code is 200, the requested resources are moved from the bank to the current player
See what you already own, what you can buy, where you can build, if you have the Largest Army or the Longest Road and how many public or hidden Victory Points you have
{
"gameId": "gameId",
"playerId": "playerId",
"command": "update",
"arguments": null
}
updatecan be sent whenever
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments":
{
"active": "true or false (boolean)",
"lumber": "number of owned lumbers (integer)",
"wool": "number of owned wools (integer)",
"grain": "number of owned grains (integer)",
"brick": "number of owned bricks (integer)",
"ore": "number of owned ores (integer)",
"knight": "number of owned knights (integer)",
"monopoly": "number of owned monopolies (integer)",
"roadBuilding": "number of owned roadBuildings (integer)",
"victoryPoint": "number of owned victoryPoints (integer)",
"yearOfPlenty": "number of owned yearsOfPlenty (integer)",
"usedKnights": "number of used Knight development cards (integer)",
"longestRoad": "length of longest road chain (integer)",
"roadsToBuild": "number of remaining roads to build when using Road Building development card",
"hasLargestArmy": "true or false (boolean)",
"hasLongestRoad": "true or false (boolean)",
"publicScore": "number of public points, without Victory Points development cards (integer)",
"hiddenScore": "number of hidden points, with Victory Points development cards (integer)",
"canBuyRoad": "true or false (boolean)",
"canBuySettlement": "true or false (boolean)",
"canBuyCity": "true or false (boolean)",
"canBuyDevelopment": "true or false (boolean)"
}
}
activerefers to in the game (not stepped over when when it is your turn)canBuyrefers toaffordsavailablerefers to positions that respect the game rules
{
"gameId": "gameId",
"playerId": "playerId",
"command": "endTurn",
"arguments": null
}
endTurncan be sent whenever afterrollDice
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments":
{
"nextPlayer": "playerId"
}
}
- No scenario is specified.
- The scenario is not implemented.
- The maximum number of players is not specified.
- The game does not exist.
- There are already more players.
- The game has already started.
- The game identifier is not specified.
- There is no room left.
- The player does not exist.
- The game can not start without players.
- The game was created successfully.
- The maximum number of players was set successfully.
- The player was added successfully.
- The player was removed successfully.
- The game has started successfully.
- The player status has not been changed.
- The player status has been changed successfully.
- Here is your information.
- Here is the current ranking.
- The game has ended successfully.
- The game has ended because there are not enough active players.
- Invalid request.
- Forbidden request.
- The message has no assigned action.
- You do not have more than seven resource cards to discard half of them.
- You have not discarded half of your resource cards.
- Somebody has not discarded half of their resource cards yet.
- The dice sum is seven.
- The dice sum is not seven.
- The resource cards were discarded successfully.
- You do not have enough Lumber resource cards.
- You do not have enough Wool resource cards.
- You do not have enough Grain resource cards.
- You do not have enough Brick resource cards.
- You do not have enough Ore resource cards.
- You do not have Lumber resource cards.
- You do not have Wool resource cards.
- You do not have Grain resource cards.
- You do not have Brick resource cards.
- You do not have Ore resource cards.
- You do not have Knight development cards.
- You do not have Monopoly development cards.
- You do not have Road Building development cards.
- You do not have Year of Plenty development cards.
- The development was bought successfully.
- You can use Knight development card.
- You can use Monopoly development card.
- You can use Road Building development card.
- You can use Year of Plenty development card.
- The resource cards were stolen successfully.
- You have taken the last resource card from the bank.
- You have taken the last two resource cards from the bank.
- The resource cards were taken successfully.
- It is not your turn.
- The turn was changed successfully.
- The bank does not have enough Lumber resource cards.
- The bank does not have enough Wool resource cards.
- The bank does not have enough Grain resource cards.
- The bank does not have enough Brick resource cards.
- The bank does not have enough Ore resource cards.
- The bank does not have any resource cards
- The bank does not have Lumber resource cards.
- The bank does not have Wool resource cards.
- The bank does not have Grain resource cards.
- The bank does not have Brick resource cards.
- The bank does not have Ore resource cards.
- The bank does not have any development cards.
- The bank does not have Knight development cards.
- The bank does not have Monopoly development cards.
- The bank does not have Road Building development cards.
- The bank does not have Year of Plenty development cards.
- You do not have roads in bank.
- You do not have settlements in bank.
- You do not have cities in bank.
- You have no more available road positions.
- Invalid position for road.
- It does not connect to your last intersection.
- It does not connect to one of your intersections.
- It does not connect to one of your roads.
- Road already existent.
- You have no more roads to build.
- The road was built successfully.
- The road was built successfully. You do not have roads in bank.
- The road was bought successfully.
- You have no more available settlement positions.
- Invalid position for settlement.
- Intersection already occupied.
- The two roads distance rule is not satisfied.
- It does not connect to one of your roads.
- You have no more settlements to build.
- The settlement was built successfully.
- The settlement was bought successfully.
- You have no more available city positions.
- Invalid position for city.
- You have no more cities to build.
- The city was bought successfully.
- You can not let the robber on the same tile.
- You can not steal a resource card from yourself.
- The player does not have resource cards.
- The robber was moved successfully.
- The resource card was stolen successfully.
- No trade available.
- You are already in trade.
- The selected player is not in trade.
- The offer does not match the port.
- The trade has started successfully.
- You can take part in the trade.
- The trade partners were sent successfully.
- Nobody wanted to trade.
- The trade was made successfully.
- The trade was made successfully.