Compare commits

..

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

514 changed files with 16116 additions and 25024 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
@ -53,7 +53,7 @@ To compile the Angular code and afterwards start the Express server with `nodemo
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
@ -69,10 +69,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

@ -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,15 @@
#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
+ vehicleClass: `LIGHT` (enum, 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

@ -14,8 +14,6 @@ Basic player statistic information object
+ 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 +22,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

@ -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,11 +1,3 @@
### Get Campaigns [GET /campaigns]
Get all campaigns information
+ Response 200 (application/json; charset=utf-8)
+ Attributes (array[Campaign], fixed-type)
### Get Campaign [GET /campaigns/{id}]
Get single campaign information
@ -16,18 +8,6 @@ Get single campaign information
+ Response 200 (application/json; charset=utf-8)
+ Attributes (Campaign, fixed-type)
### Get Campaign Containing Specific War [GET /campaigns/with/war/{warId}]
Get a single campaign, containing a specific war
+ Parameters
+ warId: `5abf65ae3fc5fa349ffd5ca3` (string, required) - unique id of war that has to be part of campaign
+ Response 200 (application/json; charset=utf-8)
+ Attributes (Campaign, fixed-type)
### Create Campaign [POST /campaigns]

View File

@ -33,4 +33,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}]

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,
@ -30,18 +27,11 @@ const LogVehicleKillSchema = new Schema({
},
vehicleClass: {
type: String,
enum: ['LIGHT', 'HEAVY', 'AIR', 'BOAT', 'UNKNOWN'],
enum: ['LIGHT', 'HEAVY', 'AIR', '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

@ -42,12 +42,6 @@ const PlayerSchema = new Schema({
set: (v) => Math.round(v),
required: true,
},
vehicleBoat: {
type: Number,
get: (v) => Math.round(v),
set: (v) => Math.round(v),
required: true,
},
death: {
type: Number,
get: (v) => Math.round(v),
@ -78,30 +72,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