Compare commits
No commits in common. "master" and "v1.7.2" have entirely different histories.
|
@ -4,7 +4,7 @@
|
||||||
dist/
|
dist/
|
||||||
tmp/
|
tmp/
|
||||||
etc/
|
etc/
|
||||||
server/apib/documentation.apib
|
api/apib/documentation.apib
|
||||||
|
|
||||||
# dependencies
|
# dependencies
|
||||||
node_modules
|
node_modules
|
||||||
|
@ -45,11 +45,11 @@ Thumbs.db
|
||||||
.directory
|
.directory
|
||||||
|
|
||||||
# Internal Data
|
# Internal Data
|
||||||
/public/
|
public/
|
||||||
server/resource/
|
mongodb-data/
|
||||||
server/apib/dredd/data/tmp-resource
|
api/resource/
|
||||||
|
api/apib/dredd/data/tmp-resource
|
||||||
backup/
|
backup/
|
||||||
!backup.sh
|
|
||||||
|
|
||||||
# System
|
# System
|
||||||
.npm/
|
.npm/
|
||||||
|
@ -59,3 +59,4 @@ backup/
|
||||||
.cache/motd.legal-displayed
|
.cache/motd.legal-displayed
|
||||||
.profile
|
.profile
|
||||||
.ssh/
|
.ssh/
|
||||||
|
|
||||||
|
|
18
README.md
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
# Operation Pandora Trigger Commandcenter
|
# Operation Pandora Trigger Commandcenter
|
||||||
|
|
||||||
A [MEAN Stack](http://mean.io/) application created for [https://www.opt4.net](https://www.opt4.net) Arma3 Community
|
A [MEAN Application](http://mean.io/) created for [operation-pandora.com](https://www.operation-pandora.com) Arma3 Community
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
@ -14,9 +14,7 @@ All steps described here are working with a Debian based Linux system
|
||||||
|
|
||||||
Run the installation script located in the docs folder:
|
Run the installation script located in the docs folder:
|
||||||
|
|
||||||
```text
|
|
||||||
./docs/opt-cc-environment/3rd-party-install.sh
|
./docs/opt-cc-environment/3rd-party-install.sh
|
||||||
```
|
|
||||||
|
|
||||||
It installs NPM, Node and MongoDB on latest versions.
|
It installs NPM, Node and MongoDB on latest versions.
|
||||||
In addition, it sets up the mongo deamon to start up automatically with the system.
|
In addition, it sets up the mongo deamon to start up automatically with the system.
|
||||||
|
@ -27,9 +25,7 @@ In addition, it sets up the mongo deamon to start up automatically with the syst
|
||||||
|
|
||||||
For production setup run the script, described in _Setup for development_, adding the parameter `prod`
|
For production setup run the script, described in _Setup for development_, adding the parameter `prod`
|
||||||
|
|
||||||
```text
|
|
||||||
./docs/opt-cc-environment/3rd-party-install.sh prod
|
./docs/opt-cc-environment/3rd-party-install.sh prod
|
||||||
```
|
|
||||||
|
|
||||||
This adds the [`pm2` process manager](http://pm2.keymetrics.io/) to be installed and start the _opt-cc_ server as `pm2` process.
|
This adds the [`pm2` process manager](http://pm2.keymetrics.io/) to be installed and start the _opt-cc_ server as `pm2` process.
|
||||||
Run the `sudo` command printed as last output to configure the `pm2` process for automatic start on the system.
|
Run the `sudo` command printed as last output to configure the `pm2` process for automatic start on the system.
|
||||||
|
@ -41,25 +37,19 @@ Run the `sudo` command printed as last output to configure the `pm2` process for
|
||||||
|
|
||||||
Before triggering the environment execution run
|
Before triggering the environment execution run
|
||||||
|
|
||||||
```text
|
|
||||||
npm install
|
npm install
|
||||||
```
|
|
||||||
|
|
||||||
inside the main folder, to process all needed npm package installations for the program execution.
|
inside the main folder, to process all needed npm package installations for the program execution.
|
||||||
|
|
||||||
To compile the Angular code and afterwards start the Express server with `nodemon` for development purpose run
|
To compile the Angular code and afterwards start the Express server with `nodemon` for development purpose run
|
||||||
|
|
||||||
```text
|
|
||||||
npm run dev
|
npm run dev
|
||||||
```
|
|
||||||
|
|
||||||
Any changes on `server` code will trigger an automatic restart of the Express server.
|
Any changes on `api` code will trigger an automatic restart of the Express server.
|
||||||
|
|
||||||
Changes on `static` code can be submitted with
|
Changes on `static` code can be submitted with
|
||||||
|
|
||||||
```text
|
|
||||||
npm run deploy-static
|
npm run deploy-static
|
||||||
```
|
|
||||||
|
|
||||||
The page must be reloaded after this build step is finished, in order to make changes visible.
|
The page must be reloaded after this build step is finished, in order to make changes visible.
|
||||||
|
|
||||||
|
@ -69,10 +59,10 @@ _TODO_
|
||||||
## License Information
|
## License Information
|
||||||
|
|
||||||
|
|
||||||
### NodeJS Express Server (`/server`)
|
### Express API (`/api`)
|
||||||
published under [CC BY-SA 4.0 License](https://creativecommons.org/licenses/by-sa/4.0/legalcode.txt) \
|
published under [CC BY-SA 4.0 License](https://creativecommons.org/licenses/by-sa/4.0/legalcode.txt) \
|
||||||
Main concept for API Server, pagination and MongoDB usage by [Prof. Dr.-Ing. Johannes Konert](https://prof.beuth-hochschule.de/konert/) \
|
Main concept for API Server, pagination and MongoDB usage by [Prof. Dr.-Ing. Johannes Konert](https://prof.beuth-hochschule.de/konert/) \
|
||||||
All endpoints, signature image builder and Arma3 RPT-Log parsing by [Florian Hartwich](https://de.linkedin.com/in/florian-hartwich-b67b02125)
|
All endpoints, signature image builder and Arma3 RPT-Log parsing by [Florian Hartwich](https://de.linkedin.com/in/florian-hartwich-b67b02125)
|
||||||
|
|
||||||
### Angular 6 Frontend (`/static`)
|
### Angular 5 Frontend (`/static`)
|
||||||
published under [MIT License](https://opensource.org/licenses/MIT)
|
published under [MIT License](https://opensource.org/licenses/MIT)
|
||||||
|
|
|
@ -5,13 +5,10 @@ Update an army members signature image
|
||||||
**Permission: 4**
|
**Permission: 4**
|
||||||
|
|
||||||
+ Parameters
|
+ Parameters
|
||||||
|
|
||||||
+ userId: `5ab68d42f547ed304064e5f7` (string, required) - army members unique user id
|
+ userId: `5ab68d42f547ed304064e5f7` (string, required) - army members unique user id
|
||||||
|
|
||||||
+ Request (application/json)
|
+ Request (application/json)
|
||||||
|
{}
|
||||||
+ Attributes (object)
|
|
||||||
|
|
||||||
|
|
||||||
+ Response 200 (application/json; charset=utf-8)
|
+ Response 200 (application/json; charset=utf-8)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
### Get Awardings [GET /awardings{?userId,inProgress,fractFilter,squadId}]
|
### Get Awardings [GET /awardings{?userId,inProgress,fractFilter}]
|
||||||
|
|
||||||
List all awardings
|
List all awardings
|
||||||
|
|
||||||
|
@ -19,9 +19,6 @@ List all awardings
|
||||||
+ `OPFOR`
|
+ `OPFOR`
|
||||||
+ `GLOBAL`
|
+ `GLOBAL`
|
||||||
|
|
||||||
+ squadId: `5aba54eaeadcce6332c6a774` (string, optional)
|
|
||||||
unique id of the squad
|
|
||||||
|
|
||||||
|
|
||||||
+ Response 200 (application/json; charset=utf-8)
|
+ Response 200 (application/json; charset=utf-8)
|
||||||
|
|
|
@ -63,9 +63,8 @@ Create a new decoration
|
||||||
Content-Type: image/png
|
Content-Type: image/png
|
||||||
Content-Transfer-Encoding: base64
|
Content-Transfer-Encoding: base64
|
||||||
|
|
||||||
iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
|
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA
|
||||||
B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH
|
QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII=
|
||||||
AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg==
|
|
||||||
-----BOUNDARY--
|
-----BOUNDARY--
|
||||||
|
|
||||||
+ Response 201 (application/json; charset=utf-8)
|
+ Response 201 (application/json; charset=utf-8)
|
||||||
|
@ -108,9 +107,8 @@ Update decoration, identified by its id
|
||||||
Content-Type: image/png
|
Content-Type: image/png
|
||||||
Content-Transfer-Encoding: base64
|
Content-Transfer-Encoding: base64
|
||||||
|
|
||||||
iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
|
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA
|
||||||
B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH
|
QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII=
|
||||||
AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg==
|
|
||||||
-----BOUNDARY--
|
-----BOUNDARY--
|
||||||
|
|
||||||
+ Response 200 (application/json; charset=utf-8)
|
+ Response 200 (application/json; charset=utf-8)
|
|
@ -57,9 +57,8 @@ Create a new rank
|
||||||
Content-Type: image/png
|
Content-Type: image/png
|
||||||
Content-Transfer-Encoding: base64
|
Content-Transfer-Encoding: base64
|
||||||
|
|
||||||
iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
|
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA
|
||||||
B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH
|
QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII=
|
||||||
AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg==
|
|
||||||
-----BOUNDARY--
|
-----BOUNDARY--
|
||||||
|
|
||||||
+ Response 201 (application/json; charset=utf-8)
|
+ Response 201 (application/json; charset=utf-8)
|
||||||
|
@ -97,9 +96,8 @@ Update rank, identified by its id
|
||||||
Content-Type: image/png
|
Content-Type: image/png
|
||||||
Content-Transfer-Encoding: base64
|
Content-Transfer-Encoding: base64
|
||||||
|
|
||||||
iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
|
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA
|
||||||
B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH
|
QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII=
|
||||||
AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg==
|
|
||||||
-----BOUNDARY--
|
-----BOUNDARY--
|
||||||
|
|
||||||
+ Response 200 (application/json; charset=utf-8)
|
+ Response 200 (application/json; charset=utf-8)
|
|
@ -51,9 +51,8 @@ Create a new squad
|
||||||
Content-Type: image/png
|
Content-Type: image/png
|
||||||
Content-Transfer-Encoding: base64
|
Content-Transfer-Encoding: base64
|
||||||
|
|
||||||
iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
|
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA
|
||||||
B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH
|
QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII=
|
||||||
AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg==
|
|
||||||
-----BOUNDARY--
|
-----BOUNDARY--
|
||||||
|
|
||||||
+ Response 201 (application/json; charset=utf-8)
|
+ Response 201 (application/json; charset=utf-8)
|
||||||
|
@ -91,9 +90,8 @@ Update squad, identified by its id
|
||||||
Content-Type: image/png
|
Content-Type: image/png
|
||||||
Content-Transfer-Encoding: base64
|
Content-Transfer-Encoding: base64
|
||||||
|
|
||||||
iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
|
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA
|
||||||
B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH
|
QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII=
|
||||||
AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg==
|
|
||||||
-----BOUNDARY--
|
-----BOUNDARY--
|
||||||
|
|
||||||
+ Response 200 (application/json; charset=utf-8)
|
+ Response 200 (application/json; charset=utf-8)
|
|
@ -1,27 +1,25 @@
|
||||||
### List Users [GET /users{?q,fractFilter,squadId,decorationId,limit,offset}]
|
### List Users [GET /users{?q,fractFilter,limit,offset}]
|
||||||
|
|
||||||
Get single army member information
|
Get single army member information
|
||||||
|
|
||||||
+ Parameters
|
+ Parameters
|
||||||
|
|
||||||
+ q: `hardi` (string, optional) - filter string which filters for partial username
|
+ q: `hardi` (string, optional) - filter string which filters for partial username
|
||||||
|
|
||||||
+ fractFilter: `BLUFOR` (enum[string], optional) - Field to filter by fraction
|
+ fractFilter: `BLUFOR` (enum[string], optional)
|
||||||
|
Field to filter by fraction
|
||||||
|
|
||||||
+ Members
|
+ Members
|
||||||
+ `BLUFOR`
|
+ `BLUFOR`
|
||||||
+ `OPFOR`
|
+ `OPFOR`
|
||||||
+ `GLOBAL`
|
+ `GLOBAL`
|
||||||
|
|
||||||
+ squadId: `5aba54eaeadcce6332c6a774` (string, optional) - Field to filter by membership of certain squad
|
+ limit: 20 (number, optional)
|
||||||
|
Maximum number of users to return
|
||||||
+ decorationId: `5abd3dff6e6a0334d95b8ba0` (string, optional) - Field to filter by ownership of certain decoration
|
|
||||||
|
|
||||||
+ limit: 20 (number, optional) - Maximum number of users to return
|
|
||||||
|
|
||||||
+ Default: Infinity
|
+ Default: Infinity
|
||||||
|
|
||||||
+ offset: 0 (number, optional) - Offset into result-set (useful for pagination)
|
+ offset: 0 (number, optional)
|
||||||
|
Offset into result-set (useful for pagination)
|
||||||
|
|
||||||
+ Default: 0
|
+ Default: 0
|
||||||
|
|
||||||
|
@ -39,7 +37,6 @@ Get single army member information
|
||||||
Get single army member information
|
Get single army member information
|
||||||
|
|
||||||
+ Parameters
|
+ Parameters
|
||||||
|
|
||||||
+ id: `5ab68d42f547ed304064e5f7` (string, required) - unique id of army-member
|
+ id: `5ab68d42f547ed304064e5f7` (string, required) - unique id of army-member
|
||||||
|
|
||||||
+ Response 200 (application/json; charset=utf-8)
|
+ Response 200 (application/json; charset=utf-8)
|
|
@ -15,9 +15,8 @@ Awarding associating a decoration to a user
|
||||||
|
|
||||||
|
|
||||||
# AwardingPopulated (Awarding)
|
# AwardingPopulated (Awarding)
|
||||||
Awarding with populated decoration, proposer and army-user
|
Awarding with populated decoration and proposer
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
+ proposer (Proposer, required) - app user who requested this awarding
|
+ proposer (Proposer, required) - app user who requested this awarding
|
||||||
+ decorationId (Decoration, required) - populated decoration object that is given with the awarding
|
+ decorationId (Decoration, required) - populated decoration object that is given with the awarding
|
||||||
+ userId (User, required) - populated user who gets this awarding
|
|
|
@ -1,5 +1,4 @@
|
||||||
# Campaign (object)
|
# Campaign (object)
|
||||||
|
|
||||||
Campaign entity
|
Campaign entity
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
@ -10,10 +9,8 @@ Campaign entity
|
||||||
+ __v: 0 (number, required) - version number
|
+ __v: 0 (number, required) - version number
|
||||||
|
|
||||||
#WarCampaign (object)
|
#WarCampaign (object)
|
||||||
|
|
||||||
Cmpaign entity with attached War collection
|
Cmpaign entity with attached War collection
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
+ _id: `5abd55ea9e30a76bfef747d6` (string, required) - unique id of the campaign
|
+ _id: `5abd55ea9e30a76bfef747d6` (string, required) - unique id of the campaign
|
||||||
+ title: `Ein Kessel Buntes` (string, required) - display title of the campaign
|
+ title: `Ein Kessel Buntes` (string, required) - display title of the campaign
|
||||||
+ wars: WarWithPlayers (array[WarWithPlayers], required)
|
+ wars (array[WarWithPlayers], requied)
|
|
@ -3,6 +3,7 @@
|
||||||
+ _id: `` (string, required) - log entry id
|
+ _id: `` (string, required) - log entry id
|
||||||
+ war: `` (string, required) - warId
|
+ war: `` (string, required) - warId
|
||||||
+ time: `` (string, required) - logging timestamp
|
+ time: `` (string, required) - logging timestamp
|
||||||
|
+ __v: 0 (number, required) - object version number
|
||||||
|
|
||||||
# LogPoints (Log)
|
# LogPoints (Log)
|
||||||
## Properties
|
## Properties
|
||||||
|
@ -42,9 +43,6 @@
|
||||||
+ `BLUFOR`
|
+ `BLUFOR`
|
||||||
+ `OPFOR`
|
+ `OPFOR`
|
||||||
+ `NONE`
|
+ `NONE`
|
||||||
+ shooterVehicle: `FV-720 Mora` (string, optional) - vehicle in whiock the shooting player sat
|
|
||||||
+ targetVehicle: `Ifrit-GMG` (string, optional) - vehicle in which the target player sat
|
|
||||||
+ magazine: `30 mm APFSDS` (string, optional) - magazine name used to execute the kill
|
|
||||||
|
|
||||||
#LogRespawn (Log)
|
#LogRespawn (Log)
|
||||||
## Properties
|
## Properties
|
||||||
|
@ -73,19 +71,9 @@
|
||||||
#LogVehicle (Log)
|
#LogVehicle (Log)
|
||||||
## Properties
|
## Properties
|
||||||
+ shooter: `HardiReady` (string, required) - name of player who shot the vehicle
|
+ shooter: `HardiReady` (string, required) - name of player who shot the vehicle
|
||||||
+ additionalShooter: `[GNC]Paolo`, `Dominik` (array[string], required) - additional crew members of shooter vehicle
|
|
||||||
+ target: `T-100` (string, required) - name of the vehicle
|
+ target: `T-100` (string, required) - name of the vehicle
|
||||||
+ fraction: `BLUFOR` (enum, required) - fraction of the shooter
|
+ fraction: `BLUFOR` (enum, required) - fraction of the shooter
|
||||||
+ Members
|
+ Members
|
||||||
+ `BLUFOR`
|
+ `BLUFOR`
|
||||||
+ `OPFOR`
|
+ `OPFOR`
|
||||||
+ `NONE`
|
+ `NONE`
|
||||||
+ vehicleClass: `LIGHT` (enum[string], required) - class of shot vehicle
|
|
||||||
+ Members
|
|
||||||
+ `LIGHT`
|
|
||||||
+ `HEAVY`
|
|
||||||
+ `AIR`
|
|
||||||
+ `BOAT`
|
|
||||||
+ `UNKNOWN`
|
|
||||||
+ shooterVehicle: `FV-720 Mora` (string, optional) - vehicle in whiock the shooting player sat
|
|
||||||
+ magazine: `30 mm APFSDS` (string, optional) - magazine name used to execute the kill
|
|
|
@ -7,15 +7,11 @@ Basic player statistic information object
|
||||||
+ fraction: `OPFOR` (string, required) - fraction of the player
|
+ fraction: `OPFOR` (string, required) - fraction of the player
|
||||||
+ kill: 5 (number, required) - sum of kills
|
+ kill: 5 (number, required) - sum of kills
|
||||||
+ friendlyFire: 0 (number, required) - sum of friendly fire kills
|
+ friendlyFire: 0 (number, required) - sum of friendly fire kills
|
||||||
+ vehicleLight: 1 (number, required) - sum of light vehicle kills
|
+ vehicle: 1 (number, required) - sum of vehicle kills
|
||||||
+ vehicleHeavy: 1 (number, required) - sum of heavy vehicle kills
|
|
||||||
+ vehicleAir: 0 (number, required) - sum of air vehicle kills
|
|
||||||
+ death: 3 (number, required) - sum of deaths
|
+ death: 3 (number, required) - sum of deaths
|
||||||
+ respawn: 2 (number, required) - sum of respawns
|
+ respawn: 2 (number, required) - sum of respawns
|
||||||
+ flagTouch: 1 (number, required) - sum of flag captures
|
+ flagTouch: 1 (number, required) - sum of flag captures
|
||||||
+ revive: 0 (number, required) - sum of revives
|
+ revive: 0 (number, required) - sum of revives
|
||||||
+ travelDistance: 16535 (number, optional) - sum of transport meters as passenger
|
|
||||||
+ driverDistance: 1250 (number, optional) - sum of transport meters as pilot/driver
|
|
||||||
|
|
||||||
|
|
||||||
# WarPlayer (BasicPlayer)
|
# WarPlayer (BasicPlayer)
|
||||||
|
@ -24,16 +20,15 @@ A player campaign statistics object
|
||||||
## Properties
|
## Properties
|
||||||
+ _id: `5ab68d42f547ed304064e5f7` (string, required) - unique id of the army member
|
+ _id: `5ab68d42f547ed304064e5f7` (string, required) - unique id of the army member
|
||||||
+ warId: `5abf65ae3fc5fa349ffd5ca3` (string, required) - war in which this player took part
|
+ warId: `5abf65ae3fc5fa349ffd5ca3` (string, required) - war in which this player took part
|
||||||
+ steamUUID: 76561192214911200 (number, optional) - unique ID for STEAM platform account
|
+ steamUUID: `76561192214911200` (string, required) - unique ID for STEAM platform account
|
||||||
+ performance: `5abf65ae3fc5fa349ffd5cs2` (string, optional) - id of corresponding performance log entry
|
+ sort: 1 (number, required) - sorting number calculated by (kill + revive + flagTouch - friendlyFire - death - respawn)
|
||||||
+ timestamp: `2018-02-24T01:01:25.825Z` - the entity creation timestamp
|
+ timestamp: `2018-02-24T01:01:25.825Z` - the entity creation timestamp
|
||||||
+ updatedAt: `2018-02-24T01:01:25.825Z` - the version timestamp
|
+ updatedAt: `2018-02-24T01:01:25.825Z` - the version timestamp
|
||||||
+ __v: 0 (number, required) - the version number of the object
|
+ __v: 0 (number, required) - the version number of the object
|
||||||
|
|
||||||
|
|
||||||
# HighscorePlayer (BasicPlayer)
|
# HighscorePlayer (BasicPlayer)
|
||||||
A player object as returned for the highscore arrays
|
A player object as resturned for the highscore arrays
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
+ warId: War (War, required) - war in which this player took part
|
|
||||||
+ num: 1
|
+ num: 1
|
|
@ -6,8 +6,6 @@ A war as used in statistics
|
||||||
+ title: `Battle No.1` (string, required) - the display neme of the war
|
+ title: `Battle No.1` (string, required) - the display neme of the war
|
||||||
+ date: `2018-02-24T20:01:25.825Z` (string, required) - war start timestamp
|
+ date: `2018-02-24T20:01:25.825Z` (string, required) - war start timestamp
|
||||||
+ endDate: `2018-02-24T22:31:26.855Z` (string, required) - war end timestamp
|
+ endDate: `2018-02-24T22:31:26.855Z` (string, required) - war end timestamp
|
||||||
+ fractionMappingBlufor: `BLUFOR` (enum[string], required) - display name mapping for Blufor fraction
|
|
||||||
+ fractionMappingOpfor: `OPFOR` (enum[string], required) - display name mapping for Opfor fraction
|
|
||||||
+ ptBlufor: 11 (number, required) - final points fraction Blufor
|
+ ptBlufor: 11 (number, required) - final points fraction Blufor
|
||||||
+ ptOpfor: 12 (number, required) - final points fraction Opfor
|
+ ptOpfor: 12 (number, required) - final points fraction Opfor
|
||||||
+ playersBlufor: 36 (number, required) - player count of fraction Blufor
|
+ playersBlufor: 36 (number, required) - player count of fraction Blufor
|
||||||
|
@ -25,4 +23,4 @@ A war as used in statistics
|
||||||
A war response object on creation
|
A war response object on creation
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
+ players (array[WarPlayer], required, fixed-type) - collection of all participating players with their statistics
|
+ players (array[WarPlayer], required) - collection of all participating players with their statistics
|
|
@ -16,66 +16,56 @@ FORMAT: 1A
|
||||||
|
|
||||||
# Group Access
|
# Group Access
|
||||||
|
|
||||||
## Endpoints [/auth]
|
|
||||||
|
|
||||||
:[Gists](auth/signup.apib)
|
:[Gists](auth/signup.apib)
|
||||||
|
|
||||||
:[Gists](auth/login.apib)
|
:[Gists](auth/login.apib)
|
||||||
|
|
||||||
# Group Admin
|
# Group Admin
|
||||||
|
|
||||||
## Account [/account]
|
|
||||||
|
|
||||||
:[Gists](admin/account.apib)
|
:[Gists](admin/account.apib)
|
||||||
|
|
||||||
## Commands [/cmd]
|
|
||||||
|
|
||||||
:[Gists](admin/signature.apib)
|
:[Gists](admin/signature.apib)
|
||||||
|
|
||||||
# Group Army Management
|
# Group Army Overview
|
||||||
|
|
||||||
## Army [/overview]
|
|
||||||
|
|
||||||
:[Gists](army-management/army.apib)
|
:[Gists](army-management/army.apib)
|
||||||
|
|
||||||
## Awardings [/awarding]
|
# Group Awardings
|
||||||
|
|
||||||
:[Gists](army-management/awardings.apib)
|
:[Gists](army-management/awardings.apib)
|
||||||
|
|
||||||
## Decorations [/decorations]
|
# Group Campaigns
|
||||||
|
|
||||||
:[Gists](army-management/decorations.apib)
|
|
||||||
|
|
||||||
## Promotion [/promotions]
|
|
||||||
|
|
||||||
:[Gists](army-management/promotions.apib)
|
|
||||||
|
|
||||||
## Ranks [/ranks]
|
|
||||||
|
|
||||||
:[Gists](army-management/ranks.apib)
|
|
||||||
|
|
||||||
## Squads [/squads]
|
|
||||||
|
|
||||||
:[Gists](army-management/squads.apib)
|
|
||||||
|
|
||||||
## Users [/user]
|
|
||||||
|
|
||||||
:[Gists](army-management/users.apib)
|
|
||||||
|
|
||||||
# Group Statistics
|
|
||||||
|
|
||||||
## Campaigns [/campaigns]
|
|
||||||
|
|
||||||
:[Gists](statistics/campaigns.apib)
|
:[Gists](statistics/campaigns.apib)
|
||||||
|
|
||||||
## Logs [/logs]
|
# Group Decorations
|
||||||
|
|
||||||
|
:[Gists](army-management/decorations.apib)
|
||||||
|
|
||||||
|
# Group Logs
|
||||||
|
|
||||||
:[Gists](statistics/logs.apib)
|
:[Gists](statistics/logs.apib)
|
||||||
|
|
||||||
## Players [/players]
|
# Group Players
|
||||||
|
|
||||||
:[Gists](statistics/players.apib)
|
:[Gists](statistics/players.apib)
|
||||||
|
|
||||||
## Wars [/wars]
|
# Group Promotion
|
||||||
|
|
||||||
|
:[Gists](army-management/promotions.apib)
|
||||||
|
|
||||||
|
# Group Ranks
|
||||||
|
|
||||||
|
:[Gists](army-management/ranks.apib)
|
||||||
|
|
||||||
|
# Group Squads
|
||||||
|
|
||||||
|
:[Gists](army-management/squads.apib)
|
||||||
|
|
||||||
|
# Group Users
|
||||||
|
|
||||||
|
:[Gists](army-management/users.apib)
|
||||||
|
|
||||||
|
# Group Wars
|
||||||
|
|
||||||
:[Gists](statistics/wars.apib)
|
:[Gists](statistics/wars.apib)
|
|
@ -1,3 +1,2 @@
|
||||||
{"_id":{"$oid":"5abd55ea9e30a76bfef747d6"},"title":"Ein Kessel Buntes","timestamp":{"$date":"2018-03-29T21:08:58.123Z"},"updatedAt":{"$date":"2018-03-29T21:08:58.123Z"},"__v":0}
|
{"_id":{"$oid":"5abd55ea9e30a76bfef747d6"},"title":"Ein Kessel Buntes","timestamp":{"$date":"2018-03-29T21:08:58.123Z"},"updatedAt":{"$date":"2018-03-29T21:08:58.123Z"},"__v":0}
|
||||||
{"_id":{"$oid":"5abd58989e30a76bfef747e6"},"title":"This Is The End","timestamp":{"$date":"2018-03-29T21:20:24.558Z"},"updatedAt":{"$date":"2018-03-29T21:20:24.558Z"},"__v":0}
|
{"_id":{"$oid":"5abd58989e30a76bfef747e6"},"title":"This Is The End","timestamp":{"$date":"2018-03-29T21:20:24.558Z"},"updatedAt":{"$date":"2018-03-29T21:20:24.558Z"},"__v":0}
|
||||||
{"_id":{"$oid":"5abd55ea9e32a76afef777d6"},"title":"Placeholder","timestamp":{"$date":"2018-03-30T21:08:58.123Z"},"updatedAt":{"$date":"2018-03-30T21:08:58.123Z"},"__v":0}
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
{"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca4"},"name":"Pumarang","fraction":"BLUFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.656119805032149e+16,"respawn":1,"kill":0,"vehicle":0,"friendlyFire":0,"death":1,"revive":0,"flagTouch":0,"sort":-2,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0}
|
||||||
|
{"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca5"},"name":"Mercurat","fraction":"BLUFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.65611982788425e+16,"respawn":0,"kill":0,"vehicle":0,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0}
|
||||||
|
{"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca6"},"name":"KalleK","fraction":"OPFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.656119797767603e+16,"respawn":0,"kill":0,"vehicle":0,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0}
|
||||||
|
{"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca7"},"name":"MAPster","fraction":"OPFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.656119800988213e+16,"respawn":0,"kill":0,"vehicle":0,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0}
|
||||||
|
{"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca8"},"name":"LyrikEmu","fraction":"BLUFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.65611982189104e+16,"respawn":0,"kill":0,"vehicle":0,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0}
|
||||||
|
{"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca9"},"name":"Philipp","fraction":"OPFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.656119804179206e+16,"respawn":0,"kill":0,"vehicle":0,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0}
|
||||||
|
{"_id":{"$oid":"5abf65ae3fc5fa349ffd5caa"},"name":"Wiesl","fraction":"BLUFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.65611980596481e+16,"respawn":0,"kill":1,"vehicle":0,"friendlyFire":1,"death":0,"revive":1,"flagTouch":1,"sort":2,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0}
|
||||||
|
{"_id":{"$oid":"5abf65ae3fc5fa349ffd5cab"},"name":"Murda]X[","fraction":"OPFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.656119797112163e+16,"respawn":0,"kill":0,"vehicle":1,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0}
|
||||||
|
{"_id":{"$oid":"5abf65d83fc5fa349ffd5cbc"},"name":"Pumarang","fraction":"BLUFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.656119805032149e+16,"respawn":1,"kill":0,"vehicle":0,"friendlyFire":0,"death":1,"revive":0,"flagTouch":0,"sort":-2,"timestamp":{"$date":"2018-03-31T10:41:28.459Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.459Z"},"__v":0}
|
||||||
|
{"_id":{"$oid":"5abf65d83fc5fa349ffd5cbd"},"name":"Mercurat","fraction":"BLUFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.65611982788425e+16,"respawn":0,"kill":0,"vehicle":0,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:41:28.459Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.459Z"},"__v":0}
|
||||||
|
{"_id":{"$oid":"5abf65d83fc5fa349ffd5cbe"},"name":"KalleK","fraction":"OPFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.656119797767603e+16,"respawn":0,"kill":0,"vehicle":0,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:41:28.459Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.459Z"},"__v":0}
|
||||||
|
{"_id":{"$oid":"5abf65d83fc5fa349ffd5cc1"},"name":"Philipp","fraction":"OPFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.656119804179206e+16,"respawn":0,"kill":0,"vehicle":0,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:41:28.459Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.459Z"},"__v":0}
|
||||||
|
{"_id":{"$oid":"5abf65d83fc5fa349ffd5cc0"},"name":"LyrikEmu","fraction":"BLUFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.65611982189104e+16,"respawn":0,"kill":0,"vehicle":0,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:41:28.459Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.459Z"},"__v":0}
|
||||||
|
{"_id":{"$oid":"5abf65d83fc5fa349ffd5cc2"},"name":"Wiesl","fraction":"BLUFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.65611980596481e+16,"respawn":0,"kill":1,"vehicle":0,"friendlyFire":1,"death":0,"revive":1,"flagTouch":1,"sort":2,"timestamp":{"$date":"2018-03-31T10:41:28.460Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.460Z"},"__v":0}
|
||||||
|
{"_id":{"$oid":"5abf65d83fc5fa349ffd5cc3"},"name":"Murda]X[","fraction":"OPFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.656119797112163e+16,"respawn":0,"kill":0,"vehicle":1,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:41:28.460Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.460Z"},"__v":0}
|
||||||
|
{"_id":{"$oid":"5abf65d83fc5fa349ffd5cbf"},"name":"MAPster","fraction":"OPFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.656119800988213e+16,"respawn":0,"kill":0,"vehicle":0,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:41:28.459Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.459Z"},"__v":0}
|
Before Width: | Height: | Size: 95 B After Width: | Height: | Size: 95 B |
Before Width: | Height: | Size: 95 B After Width: | Height: | Size: 95 B |
Before Width: | Height: | Size: 95 B After Width: | Height: | Size: 95 B |
Before Width: | Height: | Size: 95 B After Width: | Height: | Size: 95 B |
Before Width: | Height: | Size: 95 B After Width: | Height: | Size: 95 B |
Before Width: | Height: | Size: 95 B After Width: | Height: | Size: 95 B |
Before Width: | Height: | Size: 95 B After Width: | Height: | Size: 95 B |
Before Width: | Height: | Size: 95 B After Width: | Height: | Size: 95 B |
Before Width: | Height: | Size: 95 B After Width: | Height: | Size: 95 B |
|
@ -1,3 +1,2 @@
|
||||||
{"_id":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"playersBlufor":4,"playersOpfor":4,"budgetBlufor":4535500,"budgetOpfor":4221250,"endBudgetBlufor":997000,"endBudgetOpfor":512000,"title":"Battle #1","campaign":{"$oid":"5abd55ea9e30a76bfef747d6"},"date":{"$date":"2018-03-19T23:00:00.000Z"},"endDate":{"$date":"2018-03-20T01:30:00.000Z"},"ptBlufor":34,"ptOpfor":25,"timestamp":{"$date":"2018-03-31T10:41:28.451Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.451Z"},"__v":0}
|
{"_id":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"playersBlufor":4,"playersOpfor":4,"budgetBlufor":4535500,"budgetOpfor":4221250,"endBudgetBlufor":997000,"endBudgetOpfor":512000,"title":"Battle #1","campaign":{"$oid":"5abd55ea9e30a76bfef747d6"},"date":{"$date":"2018-03-19T23:00:00.000Z"},"endDate":{"$date":"2018-03-20T01:30:00.000Z"},"ptBlufor":34,"ptOpfor":25,"timestamp":{"$date":"2018-03-31T10:41:28.451Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.451Z"},"__v":0}
|
||||||
{"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"playersBlufor":4,"playersOpfor":4,"budgetBlufor":4535500,"budgetOpfor":4221250,"endBudgetBlufor":997000,"endBudgetOpfor":512000,"title":"Test Battle #0","campaign":{"$oid":"5abd55ea9e30a76bfef747d6"},"date":{"$date":"2018-03-19T23:00:00.000Z"},"endDate":{"$date":"2018-03-20T01:30:00.000Z"},"ptBlufor":34,"ptOpfor":25,"timestamp":{"$date":"2018-03-31T10:40:46.695Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.695Z"},"__v":0}
|
{"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"playersBlufor":4,"playersOpfor":4,"budgetBlufor":4535500,"budgetOpfor":4221250,"endBudgetBlufor":997000,"endBudgetOpfor":512000,"title":"Test Battle #0","campaign":{"$oid":"5abd55ea9e30a76bfef747d6"},"date":{"$date":"2018-03-19T23:00:00.000Z"},"endDate":{"$date":"2018-03-20T01:30:00.000Z"},"ptBlufor":34,"ptOpfor":25,"timestamp":{"$date":"2018-03-31T10:40:46.695Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.695Z"},"__v":0}
|
||||||
{"_id":{"$oid":"5abf65ae2df5fa349ffd5ca3"},"playersBlufor":20,"playersOpfor":20,"budgetBlufor":4535500,"budgetOpfor":4535500,"endBudgetBlufor":0,"endBudgetOpfor":20000,"title":"Test Battle XY","campaign":{"$oid":"5abd55ea9e30a76bfef747d6"},"date":{"$date":"2018-03-02T23:00:00.000Z"},"endDate":{"$date":"2018-03-02T01:30:00.000Z"},"ptBlufor":34,"ptOpfor":25,"timestamp":{"$date":"2018-03-02T10:40:46.695Z"},"updatedAt":{"$date":"2018-03-02T10:40:46.695Z"},"__v":0}
|
|
|
@ -4,7 +4,7 @@
|
||||||
###-------------------------------------------------------------###
|
###-------------------------------------------------------------###
|
||||||
###------------------- HOW TO USE THIS FILE --------------------###
|
###------------------- HOW TO USE THIS FILE --------------------###
|
||||||
###-------------------------------------------------------------###
|
###-------------------------------------------------------------###
|
||||||
### 1. start express server with `npm run start-api-test` ###
|
### 1. start express server with `npm run start-test` ###
|
||||||
### 2. import data by executing script: `./populate-data.sh` ###
|
### 2. import data by executing script: `./populate-data.sh` ###
|
||||||
### 3. change data in app as you need for tests ###
|
### 3. change data in app as you need for tests ###
|
||||||
### 4. export data state with: `./populate-data.sh -m save` ###
|
### 4. export data state with: `./populate-data.sh -m save` ###
|
|
@ -0,0 +1,37 @@
|
||||||
|
### Get Campaign [GET /campaigns/{id}]
|
||||||
|
|
||||||
|
Get single campaign information
|
||||||
|
|
||||||
|
+ Parameters
|
||||||
|
+ id: `5abd55ea9e30a76bfef747d6` (string, required) - unique id of campaign
|
||||||
|
|
||||||
|
+ Response 200 (application/json; charset=utf-8)
|
||||||
|
|
||||||
|
+ Attributes (Campaign, fixed-type)
|
||||||
|
|
||||||
|
### Create Campaign [POST /campaigns]
|
||||||
|
|
||||||
|
Create a new campaign
|
||||||
|
|
||||||
|
**Permission: 3**
|
||||||
|
|
||||||
|
+ Request Create new army member (application/json)
|
||||||
|
|
||||||
|
+ Attributes
|
||||||
|
+ title: `Return To Kessel In A Schmelz` (string, required) - display name of the campaign
|
||||||
|
|
||||||
|
+ Response 201 (application/json; charset=utf-8)
|
||||||
|
|
||||||
|
+ Attributes (Campaign, fixed-type)
|
||||||
|
|
||||||
|
### Delete Campaign [DELETE /campaigns/{id}]
|
||||||
|
|
||||||
|
Delete a campaign
|
||||||
|
|
||||||
|
**Permission: 3**
|
||||||
|
|
||||||
|
+ Parameters
|
||||||
|
+ id: `5abd58989e30a76bfef747e6` (string, required) - unique id of campaign
|
||||||
|
|
||||||
|
+ Response 204
|
||||||
|
|
|
@ -12,9 +12,7 @@ Every highscore player object contains a field *sum*, representing its order num
|
||||||
+ kill (array[HighscorePlayer],required) - player highscore for kill
|
+ kill (array[HighscorePlayer],required) - player highscore for kill
|
||||||
+ death (array[HighscorePlayer],required) - player highscore for death
|
+ death (array[HighscorePlayer],required) - player highscore for death
|
||||||
+ friendlyFire (array[HighscorePlayer],required) - player highscore for friendly fire
|
+ friendlyFire (array[HighscorePlayer],required) - player highscore for friendly fire
|
||||||
+ vehicleLight (array[HighscorePlayer],required) - player highscore for light vehicle
|
+ vehicle (array[HighscorePlayer],required) - player highscore for vehicle
|
||||||
+ vehicleHeavy (array[HighscorePlayer],required) - player highscore for heavy vehicle
|
|
||||||
+ vehicleAir (array[HighscorePlayer],required) - player highscore for air vehicle
|
|
||||||
+ revive (array[HighscorePlayer],required) - player highscore for revive
|
+ revive (array[HighscorePlayer],required) - player highscore for revive
|
||||||
+ respawn (array[HighscorePlayer],required) - player highscore for respawn
|
+ respawn (array[HighscorePlayer],required) - player highscore for respawn
|
||||||
+ flagTouch (array[HighscorePlayer],required) - player highscore for flag captures
|
+ flagTouch (array[HighscorePlayer],required) - player highscore for flag captures
|
||||||
|
@ -33,4 +31,4 @@ Get statistics for a single player for all wars of a campaign he took part at
|
||||||
+ Attributes
|
+ Attributes
|
||||||
+ name: `Pumarang` (string, required) - latest used playername
|
+ name: `Pumarang` (string, required) - latest used playername
|
||||||
+ campaign (Campaign,required) - campaign reflected from request is
|
+ campaign (Campaign,required) - campaign reflected from request is
|
||||||
+ players (array[HighscorePlayer],required, fixed-type) - collection of player instances in the campaign
|
+ players (array[WarPlayer],required) - collection of player instances in the campaign
|
|
@ -1,13 +1,10 @@
|
||||||
### List Wars [GET /wars{?campaignId}]
|
### List Wars [GET /wars]
|
||||||
|
|
||||||
List all wars
|
List all wars, subordinate to their campaign
|
||||||
|
|
||||||
+ Parameters
|
|
||||||
+ campaignId: `5abd55ea9e30a76bfef747d6` (string, optional) - show only wars from campaign with this id
|
|
||||||
|
|
||||||
+ Response 200 (application/json; charset=utf-8)
|
+ Response 200 (application/json; charset=utf-8)
|
||||||
|
|
||||||
+ Attributes (array[War], fixed-type)
|
+ Attributes (array[WarCampaign], fixed-type)
|
||||||
|
|
||||||
### Get War [GET /wars/{id}]
|
### Get War [GET /wars/{id}]
|
||||||
|
|
||||||
|
@ -79,35 +76,6 @@ Create a new war
|
||||||
|
|
||||||
+ Attributes (War, fixed-type)
|
+ Attributes (War, fixed-type)
|
||||||
|
|
||||||
### Update War [PATCH /wars/{id}]
|
|
||||||
|
|
||||||
Update a war, identified by its id
|
|
||||||
|
|
||||||
**Permission: 3**
|
|
||||||
|
|
||||||
+ Parameters
|
|
||||||
+ id: `5abf65ae2df5fa349ffd5ca3` (string, required) - unique id of campaign
|
|
||||||
|
|
||||||
+ Request (application/json)
|
|
||||||
|
|
||||||
+ Attributes
|
|
||||||
+ _id: `5abf65ae2df5fa349ffd5ca3` (string, required) - unique id of war
|
|
||||||
+ title: `Final Touchdown` (string, optional) - display name of the war
|
|
||||||
+ date: `2017-05-11T20:00:00.471Z` (string, optional) - starting date
|
|
||||||
+ endDate: `2017-05-12T00:30:32.471Z` (string, optional) - end date
|
|
||||||
+ ptBlufor: 5 (number, optional) - points Blufor
|
|
||||||
+ ptOpfor: 5 (number, optional) - points Opfor
|
|
||||||
+ playersBlufor: 20 (number, optional) - number of players Blufor
|
|
||||||
+ playersOpfor: 20 (number, optional) - number of players Opfor
|
|
||||||
+ budgetBlufor: 3000000 (number, optional) - start budget Blufor
|
|
||||||
+ budgetOpfor: 3000000 (number, optional) - start budget Opfor
|
|
||||||
+ endBudgetBlufor: 10000 (number, optional) - end budget Blufor
|
|
||||||
+ endBudgetOpfor: 12000 (number, optional) - end budget Opfor
|
|
||||||
|
|
||||||
+ Response 200 (application/json; charset=utf-8)
|
|
||||||
|
|
||||||
+ Attributes (War, fixed-type)
|
|
||||||
|
|
||||||
### Delete War [DELETE /wars/{id}]
|
### Delete War [DELETE /wars/{id}]
|
||||||
|
|
||||||
Delete a war
|
Delete a war
|
|
@ -15,7 +15,6 @@ module.exports = {
|
||||||
request: rootRoute + '/request',
|
request: rootRoute + '/request',
|
||||||
signatures: '/signatures',
|
signatures: '/signatures',
|
||||||
signUp: rootRoute + '/authenticate/signup',
|
signUp: rootRoute + '/authenticate/signup',
|
||||||
slotting: rootRoute + '/slotting',
|
|
||||||
squads: rootRoute + '/squads',
|
squads: rootRoute + '/squads',
|
||||||
users: rootRoute + '/users',
|
users: rootRoute + '/users',
|
||||||
wars: rootRoute + '/wars',
|
wars: rootRoute + '/wars',
|
|
@ -5,11 +5,6 @@ module.exports = {
|
||||||
database: {
|
database: {
|
||||||
uri: 'mongodb://localhost:27017/',
|
uri: 'mongodb://localhost:27017/',
|
||||||
db: 'cc',
|
db: 'cc',
|
||||||
mongooseConfig: {
|
|
||||||
useNewUrlParser: true,
|
|
||||||
useCreateIndex: true,
|
|
||||||
useFindAndModify: false,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
prod: {
|
prod: {
|
|
@ -3,9 +3,6 @@
|
||||||
// HTTP status codes by name
|
// HTTP status codes by name
|
||||||
const codes = require('../routes/http-codes');
|
const codes = require('../routes/http-codes');
|
||||||
|
|
||||||
// library to check image dimensions from file buffer
|
|
||||||
const sizeOf = require('buffer-image-size');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check if id has valid UUID format
|
* check if id has valid UUID format
|
||||||
*
|
*
|
||||||
|
@ -25,14 +22,4 @@ const idValidator = (req, res, next) => {
|
||||||
next();
|
next();
|
||||||
};
|
};
|
||||||
|
|
||||||
const imageDimensionValidator = (imageFileBuf, maxWidth, maxHeight) => {
|
|
||||||
const dimensions = sizeOf(imageFileBuf);
|
|
||||||
if (dimensions.width > maxWidth || dimensions.height > maxHeight) {
|
|
||||||
let err = new Error(`Image exceeds maximum dimensions of ${maxWidth}px width and ${maxHeight}px height`);
|
|
||||||
err.status = codes.wrongrequest;
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.idValidator = idValidator;
|
exports.idValidator = idValidator;
|
||||||
exports.imageDimensionValidator = imageDimensionValidator;
|
|
|
@ -10,7 +10,7 @@ const DecorationSchema = new Schema({
|
||||||
},
|
},
|
||||||
fraction: {
|
fraction: {
|
||||||
type: String,
|
type: String,
|
||||||
enum: ['BLUFOR', 'OPFOR', 'ARF', 'SWORD', 'GLOBAL'],
|
enum: ['BLUFOR', 'OPFOR', 'GLOBAL'],
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
|
@ -3,7 +3,7 @@
|
||||||
const mongoose = require('mongoose');
|
const mongoose = require('mongoose');
|
||||||
const Schema = mongoose.Schema;
|
const Schema = mongoose.Schema;
|
||||||
|
|
||||||
const LogPlayerCountSchema = new Schema({
|
const LogBudgetSchema = new Schema({
|
||||||
war: {
|
war: {
|
||||||
type: mongoose.Schema.Types.ObjectId,
|
type: mongoose.Schema.Types.ObjectId,
|
||||||
ref: 'War',
|
ref: 'War',
|
||||||
|
@ -13,23 +13,27 @@ const LogPlayerCountSchema = new Schema({
|
||||||
type: Date,
|
type: Date,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
countBlufor: {
|
fraction: {
|
||||||
|
type: String,
|
||||||
|
enum: ['BLUFOR', 'OPFOR'],
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
oldBudget: {
|
||||||
type: Number,
|
type: Number,
|
||||||
get: (v) => Math.round(v),
|
get: (v) => Math.round(v),
|
||||||
set: (v) => Math.round(v),
|
set: (v) => Math.round(v),
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
countOpfor: {
|
newBudget: {
|
||||||
type: Number,
|
type: Number,
|
||||||
get: (v) => Math.round(v),
|
get: (v) => Math.round(v),
|
||||||
set: (v) => Math.round(v),
|
set: (v) => Math.round(v),
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
collection: 'logPlayerCount',
|
collection: 'logBudget',
|
||||||
versionKey: false,
|
|
||||||
});
|
});
|
||||||
// optional more indices
|
// optional more indices
|
||||||
LogPlayerCountSchema.index({war: 1});
|
LogBudgetSchema.index({war: 1});
|
||||||
|
|
||||||
module.exports = mongoose.model('LogPlayerCount', LogPlayerCountSchema);
|
module.exports = mongoose.model('LogBudget', LogBudgetSchema);
|
|
@ -28,7 +28,6 @@ const LogFlagSchema = new Schema({
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
collection: 'logFlag',
|
collection: 'logFlag',
|
||||||
versionKey: false,
|
|
||||||
});
|
});
|
||||||
// optional more indices
|
// optional more indices
|
||||||
LogFlagSchema.index({war: 1, player: 1});
|
LogFlagSchema.index({war: 1, player: 1});
|
|
@ -24,15 +24,6 @@ const LogKillSchema = new Schema({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
magazine: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
shooterVehicle: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
targetVehicle: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
fraction: {
|
fraction: {
|
||||||
type: String,
|
type: String,
|
||||||
enum: ['BLUFOR', 'OPFOR', 'NONE'],
|
enum: ['BLUFOR', 'OPFOR', 'NONE'],
|
||||||
|
@ -40,7 +31,6 @@ const LogKillSchema = new Schema({
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
collection: 'logKill',
|
collection: 'logKill',
|
||||||
versionKey: false,
|
|
||||||
});
|
});
|
||||||
// optional more indices
|
// optional more indices
|
||||||
LogKillSchema.index({war: 1, shooter: 1, target: 1});
|
LogKillSchema.index({war: 1, shooter: 1, target: 1});
|
|
@ -32,7 +32,6 @@ const LogKillSchema = new Schema({
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
collection: 'logPoints',
|
collection: 'logPoints',
|
||||||
versionKey: false,
|
|
||||||
});
|
});
|
||||||
// optional more indices
|
// optional more indices
|
||||||
LogKillSchema.index({war: 1, shooter: 1, target: 1});
|
LogKillSchema.index({war: 1, shooter: 1, target: 1});
|
|
@ -19,7 +19,6 @@ const LogRespawnSchema = new Schema({
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
collection: 'logRespawn',
|
collection: 'logRespawn',
|
||||||
versionKey: false,
|
|
||||||
});
|
});
|
||||||
// optional more indices
|
// optional more indices
|
||||||
LogRespawnSchema.index({war: 1, player: 1});
|
LogRespawnSchema.index({war: 1, player: 1});
|
|
@ -32,7 +32,6 @@ const LogReviveSchema = new Schema({
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
collection: 'logRevive',
|
collection: 'logRevive',
|
||||||
versionKey: false,
|
|
||||||
});
|
});
|
||||||
// optional more indices
|
// optional more indices
|
||||||
LogReviveSchema.index({war: 1, medic: 1});
|
LogReviveSchema.index({war: 1, medic: 1});
|
|
@ -34,7 +34,6 @@ const LogTransportSchema = new Schema({
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
collection: 'logTransport',
|
collection: 'logTransport',
|
||||||
versionKey: false,
|
|
||||||
});
|
});
|
||||||
// optional more indices
|
// optional more indices
|
||||||
LogTransportSchema.index({war: 1, driver: 1});
|
LogTransportSchema.index({war: 1, driver: 1});
|
|
@ -16,9 +16,6 @@ const LogVehicleKillSchema = new Schema({
|
||||||
shooter: {
|
shooter: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
additionalShooter: {
|
|
||||||
type: [String],
|
|
||||||
},
|
|
||||||
target: {
|
target: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -28,20 +25,8 @@ const LogVehicleKillSchema = new Schema({
|
||||||
enum: ['BLUFOR', 'OPFOR', 'NONE'],
|
enum: ['BLUFOR', 'OPFOR', 'NONE'],
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
vehicleClass: {
|
|
||||||
type: String,
|
|
||||||
enum: ['LIGHT', 'HEAVY', 'AIR', 'BOAT', 'UNKNOWN'],
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
magazine: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
shooterVehicle: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
}, {
|
}, {
|
||||||
collection: 'logVehicle',
|
collection: 'logVehicle',
|
||||||
versionKey: false,
|
|
||||||
});
|
});
|
||||||
// optional more indices
|
// optional more indices
|
||||||
LogVehicleKillSchema.index({war: 1, shooter: 1, target: 1});
|
LogVehicleKillSchema.index({war: 1, shooter: 1, target: 1});
|
|
@ -24,25 +24,7 @@ const PlayerSchema = new Schema({
|
||||||
set: (v) => Math.round(v),
|
set: (v) => Math.round(v),
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
vehicleLight: {
|
vehicle: {
|
||||||
type: Number,
|
|
||||||
get: (v) => Math.round(v),
|
|
||||||
set: (v) => Math.round(v),
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
vehicleHeavy: {
|
|
||||||
type: Number,
|
|
||||||
get: (v) => Math.round(v),
|
|
||||||
set: (v) => Math.round(v),
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
vehicleAir: {
|
|
||||||
type: Number,
|
|
||||||
get: (v) => Math.round(v),
|
|
||||||
set: (v) => Math.round(v),
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
vehicleBoat: {
|
|
||||||
type: Number,
|
type: Number,
|
||||||
get: (v) => Math.round(v),
|
get: (v) => Math.round(v),
|
||||||
set: (v) => Math.round(v),
|
set: (v) => Math.round(v),
|
||||||
|
@ -78,30 +60,17 @@ const PlayerSchema = new Schema({
|
||||||
set: (v) => Math.round(v),
|
set: (v) => Math.round(v),
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
sort: {
|
||||||
|
type: Number,
|
||||||
|
get: (v) => Math.round(v),
|
||||||
|
set: (v) => Math.round(v),
|
||||||
|
},
|
||||||
steamUUID: {
|
steamUUID: {
|
||||||
type: Number,
|
type: Number,
|
||||||
get: (v) => Math.round(v),
|
get: (v) => Math.round(v),
|
||||||
set: (v) => Math.round(v),
|
set: (v) => Math.round(v),
|
||||||
},
|
},
|
||||||
performance: {
|
}, {
|
||||||
type: mongoose.Schema.Types.ObjectId,
|
|
||||||
ref: 'LogServerFps',
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
travelDistance: {
|
|
||||||
type: Number,
|
|
||||||
get: (v) => Math.round(v),
|
|
||||||
set: (v) => Math.round(v),
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
driverDistance: {
|
|
||||||
type: Number,
|
|
||||||
get: (v) => Math.round(v),
|
|
||||||
set: (v) => Math.round(v),
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
collection: 'player',
|
collection: 'player',
|
||||||
timestamps: {createdAt: 'timestamp'},
|
timestamps: {createdAt: 'timestamp'},
|
||||||
});
|
});
|
|
@ -14,16 +14,6 @@ const WarSchema = new Schema({
|
||||||
endDate: {
|
endDate: {
|
||||||
type: Date,
|
type: Date,
|
||||||
},
|
},
|
||||||
fractionMappingBlufor: {
|
|
||||||
type: String,
|
|
||||||
enum: ['BLUFOR', 'OPFOR', 'ARF', 'SWORD'],
|
|
||||||
default: 'BLUFOR',
|
|
||||||
},
|
|
||||||
fractionMappingOpfor: {
|
|
||||||
type: String,
|
|
||||||
enum: ['BLUFOR', 'OPFOR', 'ARF', 'SWORD'],
|
|
||||||
default: 'OPFOR',
|
|
||||||
},
|
|
||||||
ptBlufor: {
|
ptBlufor: {
|
||||||
type: Number,
|
type: Number,
|
||||||
get: (v) => Math.round(v),
|
get: (v) => Math.round(v),
|