Game server to handle maelstrom dynamic world and game logic
- To install the service and necessary dependencies:
npm install --production
- If you want also the dev-dependencies (for testing and development of Mäelstrom-world):
npm install
- To test the service using mocha:
npm test
- If you want also the dev-dependencies (for testing and development of Mäelstrom-world):
- To start the service:
npm start
The actions are performed through a RESTful API with plain http request and json responses:
Method | URL | Usage |
---|---|---|
GET | /map |
Returns an array of all cities, code 200 if success |
GET | /city/:city_name |
Returns the given city information, code 200 |
GET | /city/products/:city_name |
Returns a list of the given city products with code 200 |
GET | /ship_models |
Returns the list of ship models, code 200 |
GET | /products |
Returns the full list of products on the game and basic prices with code 200 |
GET | /user/ships |
Returns the full list of ships of the authenticated user, code 200 |
GET | /user/ship/:ship_id |
Returns the full information of given ship of the authenticated user {name,owner,model,life,city,status,cargo,slug} , code 200 |
GET | /user/data |
Returns id and money of authenticated user, code 200 |
POST | /user/signup |
Will create new user in world if don't exists, code 201 |
PUT | /user/build/ship |
Will build new user ship if possible, with the given data {model,ship_name,city} , return 201 and ship data if success |
PUT | /user/move/ship |
Move ship to given city if possible {ship,city} , return 200 if successful |
PUT | /user/buy |
Buy a product from a city to a ship with data {ship,product,quantity} , returns 200 if successful |
PUT | /user/sell |
Sell product from ship to city {ship,product,quantity} |
All urls under
restricted/*
requires a valid token, auth header must beBearer [token]
to get access. Code 401 otherwise
Licensed under GNU AFFERO GENERAL PUBLIC LICENSE Version 3 Maelström logo by @iblancasa under CC-by-sa