Compare commits

..

No commits in common. "master" and "v1.7.2" have entirely different histories.

518 changed files with 17007 additions and 26074 deletions

11
.gitignore vendored
View File

@ -4,7 +4,7 @@
dist/
tmp/
etc/
server/apib/documentation.apib
api/apib/documentation.apib
# dependencies
node_modules
@ -45,11 +45,11 @@ Thumbs.db
.directory
# Internal Data
/public/
server/resource/
server/apib/dredd/data/tmp-resource
public/
mongodb-data/
api/resource/
api/apib/dredd/data/tmp-resource
backup/
!backup.sh
# System
.npm/
@ -59,3 +59,4 @@ backup/
.cache/motd.legal-displayed
.profile
.ssh/

View File

@ -1,7 +1,7 @@
# 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
@ -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:
```text
./docs/opt-cc-environment/3rd-party-install.sh
```
It installs NPM, Node and MongoDB on latest versions.
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`
```text
./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.
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
```text
npm install
```
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
```text
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
```text
npm run deploy-static
```
The page must be reloaded after this build step is finished, in order to make changes visible.
@ -69,10 +59,10 @@ _TODO_
## 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) \
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)
### Angular 6 Frontend (`/static`)
### Angular 5 Frontend (`/static`)
published under [MIT License](https://opensource.org/licenses/MIT)

View File

@ -5,13 +5,10 @@ Update an army members signature image
**Permission: 4**
+ Parameters
+ userId: `5ab68d42f547ed304064e5f7` (string, required) - army members unique user id
+ Request (application/json)
+ Attributes (object)
{}
+ Response 200 (application/json; charset=utf-8)

View File

@ -1,4 +1,4 @@
### Get Awardings [GET /awardings{?userId,inProgress,fractFilter,squadId}]
### Get Awardings [GET /awardings{?userId,inProgress,fractFilter}]
List all awardings
@ -19,9 +19,6 @@ List all awardings
+ `OPFOR`
+ `GLOBAL`
+ squadId: `5aba54eaeadcce6332c6a774` (string, optional)
unique id of the squad
+ Response 200 (application/json; charset=utf-8)

View File

@ -63,9 +63,8 @@ Create a new decoration
Content-Type: image/png
Content-Transfer-Encoding: base64
iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH
AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg==
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA
QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII=
-----BOUNDARY--
+ Response 201 (application/json; charset=utf-8)
@ -108,9 +107,8 @@ Update decoration, identified by its id
Content-Type: image/png
Content-Transfer-Encoding: base64
iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH
AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg==
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA
QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII=
-----BOUNDARY--
+ Response 200 (application/json; charset=utf-8)

View File

@ -57,9 +57,8 @@ Create a new rank
Content-Type: image/png
Content-Transfer-Encoding: base64
iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH
AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg==
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA
QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII=
-----BOUNDARY--
+ Response 201 (application/json; charset=utf-8)
@ -97,9 +96,8 @@ Update rank, identified by its id
Content-Type: image/png
Content-Transfer-Encoding: base64
iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH
AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg==
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA
QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII=
-----BOUNDARY--
+ Response 200 (application/json; charset=utf-8)

View File

@ -51,9 +51,8 @@ Create a new squad
Content-Type: image/png
Content-Transfer-Encoding: base64
iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH
AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg==
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA
QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII=
-----BOUNDARY--
+ Response 201 (application/json; charset=utf-8)
@ -91,9 +90,8 @@ Update squad, identified by its id
Content-Type: image/png
Content-Transfer-Encoding: base64
iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH
AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg==
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA
QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII=
-----BOUNDARY--
+ Response 200 (application/json; charset=utf-8)

View File

@ -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
+ Parameters
+ 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
+ `BLUFOR`
+ `OPFOR`
+ `GLOBAL`
+ squadId: `5aba54eaeadcce6332c6a774` (string, optional) - Field to filter by membership of certain squad
+ decorationId: `5abd3dff6e6a0334d95b8ba0` (string, optional) - Field to filter by ownership of certain decoration
+ limit: 20 (number, optional) - Maximum number of users to return
+ limit: 20 (number, optional)
Maximum number of users to return
+ 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
@ -39,7 +37,6 @@ Get single army member information
Get single army member information
+ Parameters
+ id: `5ab68d42f547ed304064e5f7` (string, required) - unique id of army-member
+ Response 200 (application/json; charset=utf-8)

View File

@ -15,9 +15,8 @@ Awarding associating a decoration to a user
# AwardingPopulated (Awarding)
Awarding with populated decoration, proposer and army-user
Awarding with populated decoration and proposer
## Properties
+ proposer (Proposer, required) - app user who requested this awarding
+ decorationId (Decoration, required) - populated decoration object that is given with the awarding
+ userId (User, required) - populated user who gets this awarding

View File

@ -1,5 +1,4 @@
# Campaign (object)
Campaign entity
## Properties
@ -10,10 +9,8 @@ Campaign entity
+ __v: 0 (number, required) - version number
#WarCampaign (object)
Cmpaign entity with attached War collection
## Properties
+ _id: `5abd55ea9e30a76bfef747d6` (string, required) - unique id of the campaign
+ title: `Ein Kessel Buntes` (string, required) - display title of the campaign
+ wars: WarWithPlayers (array[WarWithPlayers], required)
+ wars (array[WarWithPlayers], requied)

View File

@ -3,6 +3,7 @@
+ _id: `` (string, required) - log entry id
+ war: `` (string, required) - warId
+ time: `` (string, required) - logging timestamp
+ __v: 0 (number, required) - object version number
# LogPoints (Log)
## Properties
@ -42,9 +43,6 @@
+ `BLUFOR`
+ `OPFOR`
+ `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)
## Properties
@ -73,19 +71,9 @@
#LogVehicle (Log)
## Properties
+ 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
+ fraction: `BLUFOR` (enum, required) - fraction of the shooter
+ Members
+ `BLUFOR`
+ `OPFOR`
+ `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

View File

@ -7,15 +7,11 @@ Basic player statistic information object
+ fraction: `OPFOR` (string, required) - fraction of the player
+ kill: 5 (number, required) - sum of kills
+ friendlyFire: 0 (number, required) - sum of friendly fire kills
+ vehicleLight: 1 (number, required) - sum of light vehicle kills
+ vehicleHeavy: 1 (number, required) - sum of heavy vehicle kills
+ vehicleAir: 0 (number, required) - sum of air vehicle kills
+ vehicle: 1 (number, required) - sum of vehicle kills
+ death: 3 (number, required) - sum of deaths
+ respawn: 2 (number, required) - sum of respawns
+ flagTouch: 1 (number, required) - sum of flag captures
+ 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)
@ -24,16 +20,15 @@ A player campaign statistics object
## Properties
+ _id: `5ab68d42f547ed304064e5f7` (string, required) - unique id of the army member
+ warId: `5abf65ae3fc5fa349ffd5ca3` (string, required) - war in which this player took part
+ steamUUID: 76561192214911200 (number, optional) - unique ID for STEAM platform account
+ performance: `5abf65ae3fc5fa349ffd5cs2` (string, optional) - id of corresponding performance log entry
+ steamUUID: `76561192214911200` (string, required) - unique ID for STEAM platform account
+ 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
+ updatedAt: `2018-02-24T01:01:25.825Z` - the version timestamp
+ __v: 0 (number, required) - the version number of the object
# HighscorePlayer (BasicPlayer)
A player object as returned for the highscore arrays
A player object as resturned for the highscore arrays
## Properties
+ warId: War (War, required) - war in which this player took part
+ num: 1

View File

@ -6,8 +6,6 @@ A war as used in statistics
+ title: `Battle No.1` (string, required) - the display neme of the war
+ date: `2018-02-24T20:01:25.825Z` (string, required) - war start 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
+ ptOpfor: 12 (number, required) - final points fraction Opfor
+ 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
## 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

View File

@ -16,66 +16,56 @@ FORMAT: 1A
# Group Access
## Endpoints [/auth]
:[Gists](auth/signup.apib)
:[Gists](auth/login.apib)
# Group Admin
## Account [/account]
:[Gists](admin/account.apib)
## Commands [/cmd]
:[Gists](admin/signature.apib)
# Group Army Management
## Army [/overview]
# Group Army Overview
:[Gists](army-management/army.apib)
## Awardings [/awarding]
# Group Awardings
:[Gists](army-management/awardings.apib)
## Decorations [/decorations]
:[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]
# Group Campaigns
:[Gists](statistics/campaigns.apib)
## Logs [/logs]
# Group Decorations
:[Gists](army-management/decorations.apib)
# Group Logs
:[Gists](statistics/logs.apib)
## Players [/players]
# Group Players
:[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)

View File

@ -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":"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}

View File

@ -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}

View File

Before

Width:  |  Height:  |  Size: 95 B

After

Width:  |  Height:  |  Size: 95 B

View File

Before

Width:  |  Height:  |  Size: 95 B

After

Width:  |  Height:  |  Size: 95 B

View File

Before

Width:  |  Height:  |  Size: 95 B

After

Width:  |  Height:  |  Size: 95 B

View File

Before

Width:  |  Height:  |  Size: 95 B

After

Width:  |  Height:  |  Size: 95 B

View File

Before

Width:  |  Height:  |  Size: 95 B

After

Width:  |  Height:  |  Size: 95 B

View File

Before

Width:  |  Height:  |  Size: 95 B

After

Width:  |  Height:  |  Size: 95 B

View File

@ -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":"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}

View File

@ -4,7 +4,7 @@
###-------------------------------------------------------------###
###------------------- 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` ###
### 3. change data in app as you need for tests ###
### 4. export data state with: `./populate-data.sh -m save` ###

View File

@ -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

View File

@ -12,9 +12,7 @@ Every highscore player object contains a field *sum*, representing its order num
+ kill (array[HighscorePlayer],required) - player highscore for kill
+ death (array[HighscorePlayer],required) - player highscore for death
+ friendlyFire (array[HighscorePlayer],required) - player highscore for friendly fire
+ vehicleLight (array[HighscorePlayer],required) - player highscore for light vehicle
+ vehicleHeavy (array[HighscorePlayer],required) - player highscore for heavy vehicle
+ vehicleAir (array[HighscorePlayer],required) - player highscore for air vehicle
+ vehicle (array[HighscorePlayer],required) - player highscore for vehicle
+ revive (array[HighscorePlayer],required) - player highscore for revive
+ respawn (array[HighscorePlayer],required) - player highscore for respawn
+ 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
+ name: `Pumarang` (string, required) - latest used playername
+ 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

View File

@ -1,13 +1,10 @@
### List Wars [GET /wars{?campaignId}]
### List Wars [GET /wars]
List all wars
+ Parameters
+ campaignId: `5abd55ea9e30a76bfef747d6` (string, optional) - show only wars from campaign with this id
List all wars, subordinate to their campaign
+ Response 200 (application/json; charset=utf-8)
+ Attributes (array[War], fixed-type)
+ Attributes (array[WarCampaign], fixed-type)
### Get War [GET /wars/{id}]
@ -79,35 +76,6 @@ Create a new war
+ 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 a war

View File

@ -15,7 +15,6 @@ module.exports = {
request: rootRoute + '/request',
signatures: '/signatures',
signUp: rootRoute + '/authenticate/signup',
slotting: rootRoute + '/slotting',
squads: rootRoute + '/squads',
users: rootRoute + '/users',
wars: rootRoute + '/wars',

View File

@ -5,11 +5,6 @@ module.exports = {
database: {
uri: 'mongodb://localhost:27017/',
db: 'cc',
mongooseConfig: {
useNewUrlParser: true,
useCreateIndex: true,
useFindAndModify: false,
},
},
prod: {

View File

@ -3,9 +3,6 @@
// HTTP status codes by name
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
*
@ -25,14 +22,4 @@ const idValidator = (req, res, 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.imageDimensionValidator = imageDimensionValidator;

View File

@ -10,7 +10,7 @@ const DecorationSchema = new Schema({
},
fraction: {
type: String,
enum: ['BLUFOR', 'OPFOR', 'ARF', 'SWORD', 'GLOBAL'],
enum: ['BLUFOR', 'OPFOR', 'GLOBAL'],
required: true,
},
description: {

View File

@ -3,7 +3,7 @@
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const LogPlayerCountSchema = new Schema({
const LogBudgetSchema = new Schema({
war: {
type: mongoose.Schema.Types.ObjectId,
ref: 'War',
@ -13,23 +13,27 @@ const LogPlayerCountSchema = new Schema({
type: Date,
required: true,
},
countBlufor: {
fraction: {
type: String,
enum: ['BLUFOR', 'OPFOR'],
required: true,
},
oldBudget: {
type: Number,
get: (v) => Math.round(v),
set: (v) => Math.round(v),
required: true,
},
countOpfor: {
newBudget: {
type: Number,
get: (v) => Math.round(v),
set: (v) => Math.round(v),
required: true,
},
}, {
collection: 'logPlayerCount',
versionKey: false,
collection: 'logBudget',
});
// optional more indices
LogPlayerCountSchema.index({war: 1});
LogBudgetSchema.index({war: 1});
module.exports = mongoose.model('LogPlayerCount', LogPlayerCountSchema);
module.exports = mongoose.model('LogBudget', LogBudgetSchema);

View File

@ -28,7 +28,6 @@ const LogFlagSchema = new Schema({
},
}, {
collection: 'logFlag',
versionKey: false,
});
// optional more indices
LogFlagSchema.index({war: 1, player: 1});

View File

@ -24,15 +24,6 @@ const LogKillSchema = new Schema({
type: Boolean,
required: true,
},
magazine: {
type: String,
},
shooterVehicle: {
type: String,
},
targetVehicle: {
type: String,
},
fraction: {
type: String,
enum: ['BLUFOR', 'OPFOR', 'NONE'],
@ -40,7 +31,6 @@ const LogKillSchema = new Schema({
},
}, {
collection: 'logKill',
versionKey: false,
});
// optional more indices
LogKillSchema.index({war: 1, shooter: 1, target: 1});

View File

@ -32,7 +32,6 @@ const LogKillSchema = new Schema({
},
}, {
collection: 'logPoints',
versionKey: false,
});
// optional more indices
LogKillSchema.index({war: 1, shooter: 1, target: 1});

View File

@ -19,7 +19,6 @@ const LogRespawnSchema = new Schema({
},
}, {
collection: 'logRespawn',
versionKey: false,
});
// optional more indices
LogRespawnSchema.index({war: 1, player: 1});

View File

@ -32,7 +32,6 @@ const LogReviveSchema = new Schema({
},
}, {
collection: 'logRevive',
versionKey: false,
});
// optional more indices
LogReviveSchema.index({war: 1, medic: 1});

View File

@ -34,7 +34,6 @@ const LogTransportSchema = new Schema({
},
}, {
collection: 'logTransport',
versionKey: false,
});
// optional more indices
LogTransportSchema.index({war: 1, driver: 1});

View File

@ -16,9 +16,6 @@ const LogVehicleKillSchema = new Schema({
shooter: {
type: String,
},
additionalShooter: {
type: [String],
},
target: {
type: String,
required: true,
@ -28,20 +25,8 @@ const LogVehicleKillSchema = new Schema({
enum: ['BLUFOR', 'OPFOR', 'NONE'],
required: true,
},
vehicleClass: {
type: String,
enum: ['LIGHT', 'HEAVY', 'AIR', 'BOAT', 'UNKNOWN'],
required: true,
},
magazine: {
type: String,
},
shooterVehicle: {
type: String,
},
}, {
collection: 'logVehicle',
versionKey: false,
});
// optional more indices
LogVehicleKillSchema.index({war: 1, shooter: 1, target: 1});

View File

@ -24,25 +24,7 @@ const PlayerSchema = new Schema({
set: (v) => Math.round(v),
required: true,
},
vehicleLight: {
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: {
vehicle: {
type: Number,
get: (v) => Math.round(v),
set: (v) => Math.round(v),
@ -78,30 +60,17 @@ const PlayerSchema = new Schema({
set: (v) => Math.round(v),
required: true,
},
sort: {
type: Number,
get: (v) => Math.round(v),
set: (v) => Math.round(v),
},
steamUUID: {
type: Number,
get: (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',
timestamps: {createdAt: 'timestamp'},
});

View File

@ -14,16 +14,6 @@ const WarSchema = new Schema({
endDate: {
type: Date,
},
fractionMappingBlufor: {
type: String,
enum: ['BLUFOR', 'OPFOR', 'ARF', 'SWORD'],
default: 'BLUFOR',
},
fractionMappingOpfor: {
type: String,
enum: ['BLUFOR', 'OPFOR', 'ARF', 'SWORD'],
default: 'OPFOR',
},
ptBlufor: {
type: Number,
get: (v) => Math.round(v),

Some files were not shown because too many files have changed in this diff Show More