-
Notifications
You must be signed in to change notification settings - Fork 0
Documentation
The API provides a variety of routes that support both the online Blade-based configuration screens as well as the Xamarin-based cross-platform mobile app. The API is used to send data from the configuration screens to the clients and vice versa. In order to achieve client synchronization, data pushing is used as opposed to data polling. Pusher App is used to achieve this goal. The API currently does not support any user authentication platforms using tokens.
- API language: php ^7.3|^8.0 (Laravel)
- API structure: REST
- Security platforms: CSRF tokens, TLS support
- Supported database engine: MySQL
- Database setup-structure: Laravel migrations
Returns information regarding a singular user (user specified by id).
- Parameters: $user: User
- Associated Route: GET /api/users/{user}
Creates and stores a new user.
- Parameters: $request: UserStoreRequest
- Associated Route: POST /api/users
Updates the location of a user (user specified by id).
- Parameters: $request: UpdateLocationRequest, $user: User
- Associated Route: PUT /api/users/{user}
Updates a user's status from 'playing' to 'caught'. (user specified by id).
- Parameters: $user: User
- Associated Route: PATCH /api/users/{user}/catch
Updates the location of a user (user specified by id).
- Parameters: $request: UpdateLocationRequest, $user: User
- Associated Route: PUT /api/users/{user}
Returns one of three options regarding invite keys (invite key specified by invite key value):
- Error message: "The given invite key is in use"
- Error message: "The given key has expired since its parent game has ended"
- The given key object as JSON
- Parameters: $key: InviteKey
- Associated Route: GET /api/invite-keys/{key}
Returns a game's details (game specified by id).
- Parameters: $game: Game
- Associated Route: GET /api/games/{game}
Returns all the users that belong to a game (game specified by id).
- Parameters: $game: Game
- Associated Route: GET /api/games/{game}/users
Returns all non-disconnected, including their roles, that belong to a game (game specified by id).
- Parameters: $game: Game
- Associated Route: GET /api/games/{game}/users-with-role
Returns all the users, including their roles, that belong to a game (game specified by id).
- Parameters: $game: Game
- Associated Route: GET /api/games/{game}/users-with-role-unfiltered
Returns all the loot that belongs to a game (game specified by id).
- Parameters: $game: Game
- Associated Route: GET /api/games/{game}/loot
Returns a game's invite keys (game specified by id).
- Parameters: $game: Game
- Associated Route: GET /api/games/{game}/invite-keys
Returns a game's border markers (game specified by id).
- Parameters: $game: Game
- Associated Route: GET /api/games/{game}/border-markers
Returns a game's sent notifications (game specified by id).
- Parameters: $game: Game
- Associated Route: GET /api/games/{game}/notifications
Returns a game's logo as 'image/png'. If no logo was specified, this route will return a blank screen instead. (game specified by id).
- Parameters: $game: Game
- Associated Route: GET /api/games/{game}/logo
Allows for app-side notifications to be sent back to the server and stored in the database for a specific game. (game specified by id).
- Parameters: $request: StoreNotificationRequest, $game: Game
- Associated Route: POST /api/games/{game}/notifications
Stores supplied error in the database (for debugging purposes).
- Parameters: $request: StoreAppErrorRequest
- Associated Route: POST /api/app-errors
Updates the thieves team's score for a game. (game specified by id).
- Parameters: $game: Game, $score: int
- Associated Route: PATCH /api/games/{game}/thieves-score/{score}
Updates the police team's score for a game. (game specified by id).
- Parameters: $game: Game, $score: int
- Associated Route: PATCH /api/games/{game}/police-score/{score}
Reduces the amount of gadgets the specified user has of given type and uses the gadget (user and gadget specified by id).
- Parameters: $user: User, $gadget: Gadget
- Associated Route: PATCH /api/users/{user}/gadgets/{gadget}
Deletes a piece of loot from the database. (loot specified by id).
- Parameters: $loot: Loot
- Associated Route: DELETE /api/loot/{loot}
Fetches the icon for loot.
- Associated Route: GET /images/money-bag.png
Fetches the icon for the police station.
- Associated Route: GET /images/police-badge.png
Firstly, the configuration screens allow a game leader to specify certain game details such as game duration or game area. The invite keys for a game are also generated here. After all of the game settings have been set to the game leader's preferred values, a game can be started with the click of a button. Secondly, after a game has been started, the configuration screens provide the game leader with certain game details and interactions, such as an overview of the players' last known locations and buttons for pausing, resuming and ending a game.
- Configuration screens language: Blade HTML
- Supported browsers: any
Returns a view for creating a new game or selecting / deleting an existing game.
- Parameters: none
- Associated Route: GET /games
Sends a request to the server to create a new game. Redirects the user to the new game's configuration screen.
- Parameters: none
- Associated Route: POST /games
Returns the configuration screen for a game (game specified by name). If a game has already started, this route will redirect the user to the game's in-game configuration page instead.
- Parameters: $game: Game
- Associated Route: GET /games/{game_name}
Sends a request to the server to update a game's status (game specified by id).
- Parameters: $request: UpdateGameStateRequest, $game: Game
- Associated Route: PUT /games/{game}
Sends a request to the server to store specified border markers. This route is not to be called manually, and is instead designed to be called via AJAX.
- Parameters: $request: StoreBorderMarkerRequest, $game: Game
- Associated Route: POST /games/{game}/border-markers
Sends a request to the server to store specified loot. This route is not to be called manually, and is instead designed to be called via AJAX. (game specified by id).
- Parameters: $request: StoreLootRequest, $game: Game
- Associated Route: POST /games/{game}/loot
Sends a request to the server to store the police station's location. This route is not to be called manually, and is instead designed to be called via AJAX. (game specified by id).
- Parameters: $request: UpdatePoliceStationLocationRequest, $game: Game
- Associated Route: PATCH /games/{game}/police-station
Sends a request to the server to broadcast a new notification (game specified by id).
- Parameters: $request: StoreNotificationRequest, $game: Game
- Associated Route: POST /games/{game}/notifications
Checks whether or not the supplied password is equal to the game's password (game specified by id).
- Parameters: $game: Game
- Associated Route: GET /games/{game}/password
Assigns supplied user the double agent role (user specified by id).
- Parameters: $request: UpdateSpecialRoleRequest, $user: User
- Associated Route: PATCH /users/{user}/special-role
Sends a request to the server to store a new preset based on the current game. This route is not to be called manually, and is instead designed to be called via AJAX.
- Parameters: $request: StorePresetRequest
- Associated Route: POST /presets
Returns all loot for a game preset. (game preset specified by id).
- Parameters: $preset: GamePreset
- Associated Route: GET /presets/{preset}/loot
Removes all loot for a game. This route is not to be called manually, and is instead designed to be called via AJAX. (game specified by id).
- Parameters: $game: Game
- Associated Route: DELETE /games/{game}/loot
Returns all border markers for a game preset. (game preset specified by id).
- Parameters: $preset: GamePreset
- Associated Route: GET /presets/{preset}/border-markers
Removes all border markers for a game. This route is not to be called manually, and is instead designed to be called via AJAX. (game specified by id).
- Parameters: $game: Game
- Associated Route: DELETE /games/{game}/border-markers