-
Notifications
You must be signed in to change notification settings - Fork 4
API Documentation for Administration (Game State)
Resets the players, pacdots, and game state. No pacdots may be eaten.
All players are set to the state UNINITIALIZED
and the location (0.0, 0.0). All pacdots are set to be uneaten. The game state is set to INITIALIZING
.
The game state previous to this request must not be INITIALIZING
.
See the possible game states.
PUT
/admin/gamestate
{
"state" : "INITIALIZING"
}
HTTP Status Code | Meanings |
---|---|
200 OK |
Reset the game successfully |
409 Conflict |
The game state is already INITIALIZING
|
500 Internal Server Error |
The server crapped itself |
Starts the game. May be used from a paused state to continue the game.
All players currently in the state READY
are set to the state ACTIVE
. The game state is set to IN_PROGRESS
.
The game state previous to this request must be INITIALIZING
or PAUSED
.
See the possible game states.
PUT
/admin/gamestate
{
"state" : "IN_PROGRESS"
}
HTTP Status Code | Meanings |
---|---|
200 OK |
Started the game successfully |
409 Conflict |
The game state is neither INITIALIZING nor PAUSED
|
500 Internal Server Error |
The server crapped itself |
Pauses the game. No players will be able to tag each other, and no pacdots can be eaten.
No player states will be changed. The game state is set to PAUSED
.
The game state previous to this request must be INITIALIZING
or PAUSED
.
See the possible game states.
PUT
/admin/gamestate
{
"state" : "PAUSED"
}
HTTP Status Code | Meanings |
---|---|
200 OK |
Paused the game successfully |
409 Conflict |
The game state is not IN_PROGRESS
|
500 Internal Server Error |
The server crapped itself |
Sets the winner to Pacman. No players can be tagged, and no pacdots can be eaten.
No player states will be changed. The game state is set to FINISHED_PACMAN_WIN
.
The game state previous to this request must be IN_PROGRESS
.
See the possible game states.
PUT
/admin/gamestate
{
"state" : "FINISHED_PACMAN_WIN"
}
HTTP Status Code | Meanings |
---|---|
200 OK |
Set the winner as Pacman successfully |
409 Conflict |
The game state is not IN_PROGRESS
|
500 Internal Server Error |
The server crapped itself |
Sets the winner to the Ghosts. No players can be tagged, and no pacdots can be eaten.
No player states will be changed. The game state is set to FINISHED_GHOSTS_WIN
.
The game state previous to this request must be IN_PROGRESS
.
See the possible game states.
PUT
/admin/gamestate
{
"state" : "FINISHED_GHOSTS_WIN"
}
HTTP Status Code | Meanings |
---|---|
200 OK |
Set the winner as Pacman successfully |
409 Conflict |
The game state is not IN_PROGRESS
|
500 Internal Server Error |
The server crapped itself |