https://catan-engine.herokuapp.com/Catan/managerRequest/
{
"username": "username",
"password": "password",
"command": "newGame",
"arguments":
{
"scenario": "scenario"
}
}
- only
SettlersOfCatan
is implemented forscenario
at this moment
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments":
{
"gameId": "gameId"
}
}
gameId
is a random generated identifier
{
"username": "username",
"password": "password",
"command": "setMaxPlayers",
"arguments":
{
"gameId": "gameId",
"maxPlayers": "a number between 3 and 6 (integer)"
}
}
setMaxPlayers
can be sent whenever betweennewGame
andstartGame
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments": null
}
{
"username": "username",
"password": "password",
"command": "addPlayer",
"arguments":
{
"gameId": "gameId"
}
}
addPlayer
can be sent whenever betweensetMaxPlayers
andstartGame
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments":
{
"playerId": "playerId"
}
}
playerId
is a random generated identifier
{
"username": "username",
"password": "password",
"command": "removePlayer",
"arguments":
{
"gameId": "gameId",
"playerId": "playerId"
}
}
removePlayer
can be sent whenever betweensetMaxPlayers
andstartGame
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments": null
}
{
"username": "username",
"password": "password",
"command": "startGame",
"arguments":
{
"gameId": "gameId"
}
}
startGame
can 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"
}
}
board
contains for each tile a random resource, including a desert, and a random number for the dice sumports
contains for the fixed intersections a random port
{
"username": "username",
"password": "password",
"command": "changePlayerStatus",
"arguments":
{
"gameId": "gameId",
"playerId": "playerId",
"active": "true or false (boolean)"
}
}
changePlayerStatus
can be sent whenever betweennewGame
andendGame
{
"code": "HttpStatus code",
"status": "message (success or error type)",
"arguments": null
}
{
"username": "username",
"password": "password",
"command": "getRanking",
"arguments":
{
"gameId": "gameId"
}
}
getRanking
can be sent whenever betweenstartGame
andendGame
{
"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
foundWinner
is true, onlyendGame
can be sent next
{
"username": "username",
"password": "password",
"command": "endGame",
"arguments":
{
"gameId": "gameId"
}
}
endGame
can be sent whenever afterstartGame
and 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
buildRoad
or 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_0
contains the player identifier for which the information with_0
will be about (and so on)- if the dice sum is not seven,
resourcesToDiscard
is 0 - if the dice sum is seven,
lumber
,wool
,grain
,brick
,ore
are 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_0
is greater than 0 (the dice sum is seven), the player with the identifier fromplayer_0
must 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
sentAll
is 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
answer
isno
, the current player will not steal any resource card and the game continues player
should contain the player identifier from themoveRobber
response 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
answer
wasyes
and 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)"
}
}
playerTrade
can be sent whenever betweenrollDice
andendTurn
(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
sendPartner
if 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
selectPartner
if he sentsendPartners
player
contains the player identifier from thesendPartners
response argumentsplayer
can 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 inplayerTrade
are 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"
}
}
noPlayerTrade
is 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)"
}
}
buyRoad
can be sent whenever betweenrollDice
andendTurn
(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)"
}
}
buySettlement
can be sent whenever betweenrollDice
andendTurn
(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)"
}
}
buyCity
can be sent whenever betweenrollDice
andendTurn
(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
}
buyDevelopment
can be sent whenever betweenrollDice
andendTurn
(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)"
}
}
useDevelopment
can be sent whenever betweenrollDice
andendTurn
(if there is no special case)- for
knight
, the current player must send nextmoveRobber
andstealResource
requests - for
monopoly
, the current player must send nexttakeResourceFromAll
request - for
roadBuilding
, the current player must send next two validbuildDevelopmentRoad
requests - for
yearOfPlenty
, the current player must send nexttakeTwoResources
request
{
"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"
}
}
takeResourceFromAll
must be sent after a validuseDevelopment
withmonopoly
request
{
"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_0
contains 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
resources
greater 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
useDevelopment
withroadBuilding
request
{
"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
useDevelopment
withyearOfPlenty
request
{
"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
}
update
can 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)"
}
}
active
refers to in the game (not stepped over when when it is your turn)canBuy
refers toaffords
available
refers to positions that respect the game rules
{
"gameId": "gameId",
"playerId": "playerId",
"command": "endTurn",
"arguments": null
}
endTurn
can 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.