An API for lobby, inventory and in-game economy.
Clone this repository
git clone https://github.com/blairjordan/Lobster.git
From the Lobster directory, run:
npm install
Start the application:
npm start
Run in prod:
forever start dist/server.js
Database
Run the docker container for PostgreSQL:
docker network create pegleg
docker run --name lobster --rm -e POSTGRES_PASSWORD=lobster -p 5432:5432 -itd --network=pegleg -d postgres:latest
docker run -p 80:80 -itd --network=pegleg -e "[email protected]" -e "PGADMIN_DEFAULT_PASSWORD=postgres" -d dpage/pgadmin4
You can fetch your Postgres IP using the following command:
docker network inspect pegleg
Request type: GET Get a list of all available items.
Request type: POST
Name | Type | Mandatory |
---|---|---|
player_name | string | yes |
Get a player's inventory.
Request type: POST
Name | Type | Mandatory |
---|---|---|
type | string | yes |
name | string | yes |
description | string | yes |
Add an item to the system.
Request type: POST
Name | Type | Mandatory |
---|---|---|
player_name | string | yes |
item_id | int | yes |
item_count | int | yes |
Add an item to player's inventory.
Request type: DELETE
Name | Type | Mandatory |
---|---|---|
player_name | string | yes |
item_id | int | yes |
Removes an item from player's inventory.
Request type: POST
Name | Type | Mandatory |
---|---|---|
item_id | int | yes |
name | string | yes |
description | string | yes |
Updates an item name and description.
Request type: DELETE
Name | Type | Mandatory |
---|---|---|
item_id | int | yes |
Deletes an item from the system.
Request type: POST
Name | Type | Mandatory |
---|---|---|
player_name | string | yes |
Get all offers for this player.
Request type: POST
Name | Type | Mandatory |
---|---|---|
source_player_name | string | yes |
target_player_name | string | yes |
Opens a new offer between source and target players.
Request type: POST
Name | Type | Mandatory |
---|---|---|
source_player_name | string | yes |
target_player_name | string | yes |
status | string | yes |
Set the status of an individual offer.
Status types:
ID | Description |
---|---|
O | Open |
A | Accepted |
Request type: POST
Name | Type | Mandatory |
---|---|---|
source_player_name | string | yes |
target_player_name | string | yes |
item_id | int | yes |
quantity | int | yes |
Add item to a an active offer.
Request type: GET Return a list of all offers in the system.
Request type: GET
Request type: GET
Reads all tiles in the assets directory and inserts them into the tile table.
Request type: POST
Stitches selected tiles together into one image.
The final image is currently written to temp/[random ID]/final.png
Request type: POST
Request type: GET
Fills in missing tiles in your tile directory from your default tile.
Tiles are missing if they are specified in the database, but do not have an associated image file.
Request type: GET
Request type: POST
Request type: POST
Request type: POST