Release v1.9.2 #54

Merged
hardi merged 15 commits from release/v1.9.2 into master 2019-02-17 19:46:25 +01:00
49 changed files with 1968 additions and 3174 deletions

200
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "opt-cc", "name": "opt-cc",
"version": "1.8.0", "version": "1.9.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -10,10 +10,10 @@
"integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
"dev": true, "dev": true,
"requires": { "requires": {
"co": "4.6.0", "co": "^4.6.0",
"fast-deep-equal": "1.1.0", "fast-deep-equal": "^1.0.0",
"fast-json-stable-stringify": "2.0.0", "fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "0.3.1" "json-schema-traverse": "^0.3.0"
} }
}, },
"ansi-styles": { "ansi-styles": {
@ -22,7 +22,7 @@
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true, "dev": true,
"requires": { "requires": {
"color-convert": "1.9.2" "color-convert": "^1.9.0"
} }
}, },
"asn1": { "asn1": {
@ -62,7 +62,7 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"tweetnacl": "0.14.5" "tweetnacl": "^0.14.3"
} }
}, },
"builtin-modules": { "builtin-modules": {
@ -83,9 +83,9 @@
"integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"ansi-styles": "3.2.1", "ansi-styles": "^3.2.1",
"escape-string-regexp": "1.0.5", "escape-string-regexp": "^1.0.5",
"supports-color": "5.4.0" "supports-color": "^5.3.0"
}, },
"dependencies": { "dependencies": {
"supports-color": { "supports-color": {
@ -94,7 +94,7 @@
"integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
"dev": true, "dev": true,
"requires": { "requires": {
"has-flag": "3.0.0" "has-flag": "^3.0.0"
} }
} }
} }
@ -126,7 +126,7 @@
"integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=",
"dev": true, "dev": true,
"requires": { "requires": {
"delayed-stream": "1.0.0" "delayed-stream": "~1.0.0"
} }
}, },
"commander": { "commander": {
@ -141,15 +141,15 @@
"integrity": "sha512-6XiIYtYzmGEccNZFkih5JOH92jLA4ulZArAYy5j1uDSdrPLB3KzdE8GW7t2fHPcg9ry2+5LP9IEYzXzxw9lFdA==", "integrity": "sha512-6XiIYtYzmGEccNZFkih5JOH92jLA4ulZArAYy5j1uDSdrPLB3KzdE8GW7t2fHPcg9ry2+5LP9IEYzXzxw9lFdA==",
"dev": true, "dev": true,
"requires": { "requires": {
"chalk": "2.4.1", "chalk": "^2.4.1",
"commander": "2.6.0", "commander": "2.6.0",
"date-fns": "1.29.0", "date-fns": "^1.23.0",
"lodash": "4.17.10", "lodash": "^4.5.1",
"read-pkg": "3.0.0", "read-pkg": "^3.0.0",
"rx": "2.3.24", "rx": "2.3.24",
"spawn-command": "0.0.2-1", "spawn-command": "^0.0.2-1",
"supports-color": "3.2.3", "supports-color": "^3.2.3",
"tree-kill": "1.2.0" "tree-kill": "^1.1.0"
} }
}, },
"core-js": { "core-js": {
@ -170,7 +170,7 @@
"integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
"dev": true, "dev": true,
"requires": { "requires": {
"assert-plus": "1.0.0" "assert-plus": "^1.0.0"
} }
}, },
"date-fns": { "date-fns": {
@ -192,7 +192,7 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"jsbn": "0.1.1" "jsbn": "~0.1.0"
} }
}, },
"error-ex": { "error-ex": {
@ -201,7 +201,7 @@
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
"dev": true, "dev": true,
"requires": { "requires": {
"is-arrayish": "0.2.1" "is-arrayish": "^0.2.1"
} }
}, },
"escape-string-regexp": { "escape-string-regexp": {
@ -246,9 +246,9 @@
"integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=",
"dev": true, "dev": true,
"requires": { "requires": {
"asynckit": "0.4.0", "asynckit": "^0.4.0",
"combined-stream": "1.0.6", "combined-stream": "1.0.6",
"mime-types": "2.1.18" "mime-types": "^2.1.12"
} }
}, },
"getpass": { "getpass": {
@ -257,7 +257,7 @@
"integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
"dev": true, "dev": true,
"requires": { "requires": {
"assert-plus": "1.0.0" "assert-plus": "^1.0.0"
} }
}, },
"graceful-fs": { "graceful-fs": {
@ -278,8 +278,8 @@
"integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=",
"dev": true, "dev": true,
"requires": { "requires": {
"ajv": "5.5.2", "ajv": "^5.1.0",
"har-schema": "2.0.0" "har-schema": "^2.0.0"
} }
}, },
"has-flag": { "has-flag": {
@ -306,9 +306,9 @@
"integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
"dev": true, "dev": true,
"requires": { "requires": {
"assert-plus": "1.0.0", "assert-plus": "^1.0.0",
"jsprim": "1.4.1", "jsprim": "^1.2.2",
"sshpk": "1.14.2" "sshpk": "^1.7.0"
} }
}, },
"is-arrayish": { "is-arrayish": {
@ -323,7 +323,7 @@
"integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=",
"dev": true, "dev": true,
"requires": { "requires": {
"builtin-modules": "1.1.1" "builtin-modules": "^1.0.0"
} }
}, },
"is-typedarray": { "is-typedarray": {
@ -356,11 +356,11 @@
"integrity": "sha1-M4WseQGSEwy+Iw6ALsAskhW7/to=", "integrity": "sha1-M4WseQGSEwy+Iw6ALsAskhW7/to=",
"dev": true, "dev": true,
"requires": { "requires": {
"hoek": "4.2.1", "hoek": "4.x.x",
"isemail": "2.2.1", "isemail": "2.x.x",
"items": "2.1.1", "items": "2.x.x",
"moment": "2.22.2", "moment": "2.x.x",
"topo": "2.0.2" "topo": "2.x.x"
} }
}, },
"jsbn": { "jsbn": {
@ -412,16 +412,16 @@
"integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=",
"dev": true, "dev": true,
"requires": { "requires": {
"graceful-fs": "4.1.11", "graceful-fs": "^4.1.2",
"parse-json": "4.0.0", "parse-json": "^4.0.0",
"pify": "3.0.0", "pify": "^3.0.0",
"strip-bom": "3.0.0" "strip-bom": "^3.0.0"
} }
}, },
"lodash": { "lodash": {
"version": "4.17.10", "version": "4.17.11",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
"integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==",
"dev": true "dev": true
}, },
"mime-db": { "mime-db": {
@ -436,7 +436,7 @@
"integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"mime-db": "1.33.0" "mime-db": "~1.33.0"
} }
}, },
"minimist": { "minimist": {
@ -457,10 +457,10 @@
"integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==",
"dev": true, "dev": true,
"requires": { "requires": {
"hosted-git-info": "2.6.1", "hosted-git-info": "^2.1.4",
"is-builtin-module": "1.0.0", "is-builtin-module": "^1.0.0",
"semver": "5.5.0", "semver": "2 || 3 || 4 || 5",
"validate-npm-package-license": "3.0.3" "validate-npm-package-license": "^3.0.1"
} }
}, },
"oauth-sign": { "oauth-sign": {
@ -475,8 +475,8 @@
"integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=",
"dev": true, "dev": true,
"requires": { "requires": {
"error-ex": "1.3.2", "error-ex": "^1.3.1",
"json-parse-better-errors": "1.0.2" "json-parse-better-errors": "^1.0.1"
} }
}, },
"path-type": { "path-type": {
@ -485,7 +485,7 @@
"integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
"dev": true, "dev": true,
"requires": { "requires": {
"pify": "3.0.0" "pify": "^3.0.0"
} }
}, },
"performance-now": { "performance-now": {
@ -518,9 +518,9 @@
"integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=",
"dev": true, "dev": true,
"requires": { "requires": {
"load-json-file": "4.0.0", "load-json-file": "^4.0.0",
"normalize-package-data": "2.4.0", "normalize-package-data": "^2.3.2",
"path-type": "3.0.0" "path-type": "^3.0.0"
} }
}, },
"request": { "request": {
@ -529,26 +529,26 @@
"integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==",
"dev": true, "dev": true,
"requires": { "requires": {
"aws-sign2": "0.7.0", "aws-sign2": "~0.7.0",
"aws4": "1.7.0", "aws4": "^1.6.0",
"caseless": "0.12.0", "caseless": "~0.12.0",
"combined-stream": "1.0.6", "combined-stream": "~1.0.5",
"extend": "3.0.1", "extend": "~3.0.1",
"forever-agent": "0.6.1", "forever-agent": "~0.6.1",
"form-data": "2.3.2", "form-data": "~2.3.1",
"har-validator": "5.0.3", "har-validator": "~5.0.3",
"http-signature": "1.2.0", "http-signature": "~1.2.0",
"is-typedarray": "1.0.0", "is-typedarray": "~1.0.0",
"isstream": "0.1.2", "isstream": "~0.1.2",
"json-stringify-safe": "5.0.1", "json-stringify-safe": "~5.0.1",
"mime-types": "2.1.18", "mime-types": "~2.1.17",
"oauth-sign": "0.8.2", "oauth-sign": "~0.8.2",
"performance-now": "2.1.0", "performance-now": "^2.1.0",
"qs": "6.5.2", "qs": "~6.5.1",
"safe-buffer": "5.1.2", "safe-buffer": "^5.1.1",
"tough-cookie": "2.3.4", "tough-cookie": "~2.3.3",
"tunnel-agent": "0.6.0", "tunnel-agent": "^0.6.0",
"uuid": "3.3.2" "uuid": "^3.1.0"
} }
}, },
"rx": { "rx": {
@ -587,8 +587,8 @@
"integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==",
"dev": true, "dev": true,
"requires": { "requires": {
"spdx-expression-parse": "3.0.0", "spdx-expression-parse": "^3.0.0",
"spdx-license-ids": "3.0.0" "spdx-license-ids": "^3.0.0"
} }
}, },
"spdx-exceptions": { "spdx-exceptions": {
@ -603,8 +603,8 @@
"integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==",
"dev": true, "dev": true,
"requires": { "requires": {
"spdx-exceptions": "2.1.0", "spdx-exceptions": "^2.1.0",
"spdx-license-ids": "3.0.0" "spdx-license-ids": "^3.0.0"
} }
}, },
"spdx-license-ids": { "spdx-license-ids": {
@ -619,15 +619,15 @@
"integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=",
"dev": true, "dev": true,
"requires": { "requires": {
"asn1": "0.2.3", "asn1": "~0.2.3",
"assert-plus": "1.0.0", "assert-plus": "^1.0.0",
"bcrypt-pbkdf": "1.0.2", "bcrypt-pbkdf": "^1.0.0",
"dashdash": "1.14.1", "dashdash": "^1.12.0",
"ecc-jsbn": "0.1.1", "ecc-jsbn": "~0.1.1",
"getpass": "0.1.7", "getpass": "^0.1.1",
"jsbn": "0.1.1", "jsbn": "~0.1.0",
"safer-buffer": "2.1.2", "safer-buffer": "^2.0.2",
"tweetnacl": "0.14.5" "tweetnacl": "~0.14.0"
} }
}, },
"strip-bom": { "strip-bom": {
@ -642,7 +642,7 @@
"integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=",
"dev": true, "dev": true,
"requires": { "requires": {
"has-flag": "1.0.0" "has-flag": "^1.0.0"
}, },
"dependencies": { "dependencies": {
"has-flag": { "has-flag": {
@ -659,7 +659,7 @@
"integrity": "sha1-zVYVdSU5BXwNwEkaYhw7xvvh0YI=", "integrity": "sha1-zVYVdSU5BXwNwEkaYhw7xvvh0YI=",
"dev": true, "dev": true,
"requires": { "requires": {
"hoek": "4.2.1" "hoek": "4.x.x"
} }
}, },
"tough-cookie": { "tough-cookie": {
@ -668,7 +668,7 @@
"integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==",
"dev": true, "dev": true,
"requires": { "requires": {
"punycode": "1.4.1" "punycode": "^1.4.1"
} }
}, },
"tree-kill": { "tree-kill": {
@ -683,7 +683,7 @@
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
"dev": true, "dev": true,
"requires": { "requires": {
"safe-buffer": "5.1.2" "safe-buffer": "^5.0.1"
} }
}, },
"tweetnacl": { "tweetnacl": {
@ -705,8 +705,8 @@
"integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==",
"dev": true, "dev": true,
"requires": { "requires": {
"spdx-correct": "3.0.0", "spdx-correct": "^3.0.0",
"spdx-expression-parse": "3.0.0" "spdx-expression-parse": "^3.0.0"
} }
}, },
"verror": { "verror": {
@ -715,9 +715,9 @@
"integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
"dev": true, "dev": true,
"requires": { "requires": {
"assert-plus": "1.0.0", "assert-plus": "^1.0.0",
"core-util-is": "1.0.2", "core-util-is": "1.0.2",
"extsprintf": "1.3.0" "extsprintf": "^1.2.0"
} }
}, },
"wait-on": { "wait-on": {
@ -726,11 +726,11 @@
"integrity": "sha512-hDwJ674+7dfiiK/cxtYCwPxlnjXDjto/pCz1PF02sXUhqCqCWsgvxZln0699PReWqXXgkxqkF6DDo5Rj9sjNvw==", "integrity": "sha512-hDwJ674+7dfiiK/cxtYCwPxlnjXDjto/pCz1PF02sXUhqCqCWsgvxZln0699PReWqXXgkxqkF6DDo5Rj9sjNvw==",
"dev": true, "dev": true,
"requires": { "requires": {
"core-js": "2.5.7", "core-js": "^2.4.1",
"joi": "9.2.0", "joi": "^9.2.0",
"minimist": "1.2.0", "minimist": "^1.2.0",
"request": "2.87.0", "request": "^2.78.0",
"rx": "4.1.0" "rx": "^4.1.0"
}, },
"dependencies": { "dependencies": {
"rx": { "rx": {

View File

@ -1,6 +1,6 @@
{ {
"name": "opt-cc", "name": "opt-cc",
"version": "1.9.1", "version": "1.9.2",
"author": "Florian Hartwich <hardi@noarch.de>", "author": "Florian Hartwich <hardi@noarch.de>",
"private": true, "private": true,
"scripts": { "scripts": {

View File

@ -3,7 +3,6 @@
+ _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
@ -74,14 +73,14 @@
#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 + 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, required) - class of shot vehicle + vehicleClass: `LIGHT` (enum[string], required) - class of shot vehicle
+ Members + Members
+ `LIGHT` + `LIGHT`
+ `HEAVY` + `HEAVY`

View File

@ -5,6 +5,11 @@ 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: {

View File

@ -3,7 +3,8 @@
const mongoose = require('mongoose'); const mongoose = require('mongoose');
const Schema = mongoose.Schema; const Schema = mongoose.Schema;
const LogBudgetSchema = new Schema({ const LogBudgetSchema = new Schema(
{
war: { war: {
type: mongoose.Schema.Types.ObjectId, type: mongoose.Schema.Types.ObjectId,
ref: 'War', ref: 'War',
@ -30,7 +31,18 @@ const LogBudgetSchema = new Schema({
set: (v) => Math.round(v), set: (v) => Math.round(v),
required: true, required: true,
}, },
}, { buy: {
type: Boolean,
required: true,
},
player: {
type: String,
},
item: {
type: String,
},
},
{
collection: 'logBudget', collection: 'logBudget',
versionKey: false, versionKey: false,
}); });

158
server/package-lock.json generated
View File

@ -1111,9 +1111,9 @@
"dev": true "dev": true
}, },
"bluebird": { "bluebird": {
"version": "3.5.0", "version": "3.5.1",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz",
"integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw=" "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA=="
}, },
"bmp-js": { "bmp-js": {
"version": "0.1.0", "version": "0.1.0",
@ -1267,9 +1267,9 @@
"dev": true "dev": true
}, },
"bson": { "bson": {
"version": "1.0.9", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/bson/-/bson-1.0.9.tgz", "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.0.tgz",
"integrity": "sha512-IQX9/h7WdMBIW/q/++tGd+emQr0XMdeZ6icnT/74Xk9fnabWn+gZgpE+9V+gujL3hhJOoNrnDVY7tWdzc7NUTg==" "integrity": "sha512-9Aeai9TacfNtWXOYarkFJRW2CWo+dRon+fuLZYJmvLV3+MiUp0bEI6IAZfXEIg7/Pl/7IWlLaDnhzTsD81etQA=="
}, },
"buffer": { "buffer": {
"version": "3.6.0", "version": "3.6.0",
@ -6312,9 +6312,9 @@
} }
}, },
"kareem": { "kareem": {
"version": "2.2.1", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/kareem/-/kareem-2.2.1.tgz", "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.0.tgz",
"integrity": "sha512-xpDFy8OxkFM+vK6pXy6JmH92ibeEFUuDWzas5M9L7MzVmHW3jzwAHxodCPV/BYkf4A31bVDLyonrMfp9RXb/oA==" "integrity": "sha512-6hHxsp9e6zQU8nXsP+02HGWXwTkOEw6IROhF2ZA28cYbUk4eJ6QbtZvdqZOdD9YPKghG3apk5eOCvs+tLl3lRg=="
}, },
"keypress": { "keypress": {
"version": "0.1.0", "version": "0.1.0",
@ -6605,9 +6605,9 @@
} }
}, },
"lodash": { "lodash": {
"version": "4.17.10", "version": "4.17.11",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
"integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg=="
}, },
"lodash._basecopy": { "lodash._basecopy": {
"version": "3.0.1", "version": "3.0.1",
@ -6671,7 +6671,8 @@
"lodash.get": { "lodash.get": {
"version": "4.4.2", "version": "4.4.2",
"resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
"integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=",
"dev": true
}, },
"lodash.isarguments": { "lodash.isarguments": {
"version": "3.1.0", "version": "3.1.0",
@ -6912,6 +6913,12 @@
"timers-ext": "^0.1.5" "timers-ext": "^0.1.5"
} }
}, },
"memory-pager": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz",
"integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==",
"optional": true
},
"meow": { "meow": {
"version": "3.7.0", "version": "3.7.0",
"resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
@ -7140,21 +7147,37 @@
} }
}, },
"mongodb": { "mongodb": {
"version": "3.1.0", "version": "3.1.13",
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.1.0.tgz", "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.1.13.tgz",
"integrity": "sha512-fSDZRq9FomRqeDSM7MpMTLa8sz+STs3nZ7Ib0+xvmaKZ6nquNDN4zGDsVhjto6UozFvHMDYJMAfJwhqUygXs9g==", "integrity": "sha512-sz2dhvBZQWf3LRNDhbd30KHVzdjZx9IKC0L+kSZ/gzYquCF5zPOgGqRz6sSCqYZtKP2ekB4nfLxhGtzGHnIKxA==",
"requires": { "requires": {
"mongodb-core": "3.1.0" "mongodb-core": "3.1.11",
"safe-buffer": "^5.1.2"
},
"dependencies": {
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
}
} }
}, },
"mongodb-core": { "mongodb-core": {
"version": "3.1.0", "version": "3.1.11",
"resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.1.0.tgz", "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.1.11.tgz",
"integrity": "sha512-qRjG62Fu//CZhkgn0jA/k8jh5MhACIq8cOJUryH6sck87pgt+C222MSD02tsCq5zNo/B6ZFHtNodZ2qpf8E86g==", "integrity": "sha512-rD2US2s5qk/ckbiiGFHeu+yKYDXdJ1G87F6CG3YdaZpzdOm5zpoAZd/EKbPmFO6cQZ+XVXBXBJ660sSI0gc6qg==",
"requires": { "requires": {
"bson": "~1.0.4", "bson": "^1.1.0",
"require_optional": "^1.0.1", "require_optional": "^1.0.1",
"safe-buffer": "^5.1.2",
"saslprep": "^1.0.0" "saslprep": "^1.0.0"
},
"dependencies": {
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
}
} }
}, },
"mongodb-memory-server": { "mongodb-memory-server": {
@ -7177,28 +7200,33 @@
} }
}, },
"mongoose": { "mongoose": {
"version": "5.2.0", "version": "5.4.13",
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.2.0.tgz", "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.13.tgz",
"integrity": "sha512-PCChMFJHO8C+M2JYqLhOzpiDD54VoW7XbS0V9V/R6PRJOZ4GNmT4KQzyFDaXZTNRpeQpSPlz5x5Szk/kpdYY9g==", "integrity": "sha512-4dgmFbtNECbW3ZMS6ha2pebinUzZo789scdccdyyajbmaunBPqZJqp6eO6pThIqDsgSOkRi4IrzkZm8kmhtZMA==",
"requires": { "requires": {
"async": "2.6.1", "async": "2.6.1",
"bson": "~1.0.5", "bson": "~1.1.0",
"kareem": "2.2.1", "kareem": "2.3.0",
"lodash.get": "4.4.2", "mongodb": "3.1.13",
"mongodb": "3.1.0", "mongodb-core": "3.1.11",
"mongodb-core": "3.1.0",
"mongoose-legacy-pluralize": "1.0.2", "mongoose-legacy-pluralize": "1.0.2",
"mpath": "0.4.1", "mpath": "0.5.1",
"mquery": "3.0.0", "mquery": "3.2.0",
"ms": "2.0.0", "ms": "2.1.1",
"regexp-clone": "0.0.1", "regexp-clone": "0.0.1",
"safe-buffer": "5.1.2",
"sliced": "1.0.1" "sliced": "1.0.1"
}, },
"dependencies": { "dependencies": {
"ms": { "ms": {
"version": "2.0.0", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
} }
} }
}, },
@ -7235,38 +7263,26 @@
} }
}, },
"mpath": { "mpath": {
"version": "0.4.1", "version": "0.5.1",
"resolved": "https://registry.npmjs.org/mpath/-/mpath-0.4.1.tgz", "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.5.1.tgz",
"integrity": "sha512-NNY/MpBkALb9jJmjpBlIi6GRoLveLUM0pJzgbp9vY9F7IQEb/HREC/nxrixechcQwd1NevOhJnWWV8QQQRE+OA==" "integrity": "sha512-H8OVQ+QEz82sch4wbODFOz+3YQ61FYz/z3eJ5pIdbMEaUzDqA268Wd+Vt4Paw9TJfvDgVKaayC0gBzMIw2jhsg=="
}, },
"mquery": { "mquery": {
"version": "3.0.0", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/mquery/-/mquery-3.0.0.tgz", "resolved": "https://registry.npmjs.org/mquery/-/mquery-3.2.0.tgz",
"integrity": "sha512-WL1Lk8v4l8VFSSwN3yCzY9TXw+fKVYKn6f+w86TRzOLSE8k1yTgGaLBPUByJQi8VcLbOdnUneFV/y3Kv874pnQ==", "integrity": "sha512-qPJcdK/yqcbQiKoemAt62Y0BAc0fTEKo1IThodBD+O5meQRJT/2HSe5QpBNwaa4CjskoGrYWsEyjkqgiE0qjhg==",
"requires": { "requires": {
"bluebird": "3.5.0", "bluebird": "3.5.1",
"debug": "2.6.9", "debug": "3.1.0",
"regexp-clone": "0.0.1", "regexp-clone": "0.0.1",
"sliced": "0.0.5" "safe-buffer": "5.1.2",
"sliced": "1.0.1"
}, },
"dependencies": { "dependencies": {
"debug": { "safe-buffer": {
"version": "2.6.9", "version": "5.1.2",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
"requires": {
"ms": "2.0.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"sliced": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/sliced/-/sliced-0.0.5.tgz",
"integrity": "sha1-XtwETKTrb3gW1Qui/GPiXY/kcH8="
} }
} }
}, },
@ -9018,10 +9034,13 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
}, },
"saslprep": { "saslprep": {
"version": "1.0.0", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.0.tgz", "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.2.tgz",
"integrity": "sha512-5lvKUEQ7lAN5/vPl5d3k8FQeDbEamu9kizfATfLLWV5h6Mkh1xcieR1FSsJkcSRUk49lF2tAW8gzXWVwtwZVhw==", "integrity": "sha512-4cDsYuAjXssUSjxHKRe4DTZC0agDwsCqcMqtJAQPzC74nJ7LfAJflAtC1Zed5hMzEQKj82d3tuzqdGNRsLJ4Gw==",
"optional": true "optional": true,
"requires": {
"sparse-bitfield": "^3.0.3"
}
}, },
"sax": { "sax": {
"version": "1.2.4", "version": "1.2.4",
@ -9520,6 +9539,15 @@
"resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz",
"integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==" "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw=="
}, },
"sparse-bitfield": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz",
"integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=",
"optional": true,
"requires": {
"memory-pager": "^1.0.2"
}
},
"spawn-args": { "spawn-args": {
"version": "0.2.0", "version": "0.2.0",
"resolved": "https://registry.npmjs.org/spawn-args/-/spawn-args-0.2.0.tgz", "resolved": "https://registry.npmjs.org/spawn-args/-/spawn-args-0.2.0.tgz",

View File

@ -31,9 +31,9 @@
"imagemin-pngquant": "^5.0.0", "imagemin-pngquant": "^5.0.0",
"jimp": "^0.6.0", "jimp": "^0.6.0",
"jsonwebtoken": "^7.4.3", "jsonwebtoken": "^7.4.3",
"lodash": "^4.17.4", "lodash": "^4.17.11",
"mkdirp": "^0.5.1", "mkdirp": "^0.5.1",
"mongoose": "^5.0.3", "mongoose": "^5.4.13",
"morgan": "^1.9.1", "morgan": "^1.9.1",
"multer": "^1.3.0", "multer": "^1.3.0",
"node-html-parser": "^1.1.10", "node-html-parser": "^1.1.10",

View File

@ -104,16 +104,16 @@ campaigns.route('/:id')
WarModel.find({campaign: req.params.id}, (err, wars) => { WarModel.find({campaign: req.params.id}, (err, wars) => {
wars.forEach((item) => { wars.forEach((item) => {
// delete linked appearances // delete linked appearances
PlayerModel.find({warId: item._id}).remove().exec(); PlayerModel.find({warId: item._id}).deleteMany();
LogKillModel.find({war: item._id}).remove().exec(); LogKillModel.find({war: item._id}).deleteMany();
LogVehicleKillModel.find({war: item._id}).remove().exec(); LogVehicleKillModel.find({war: item._id}).deleteMany();
LogRespawnModel.find({war: item._id}).remove().exec(); LogRespawnModel.find({war: item._id}).deleteMany();
LogReviveModel.find({war: item._id}).remove().exec(); LogReviveModel.find({war: item._id}).deleteMany();
LogFlagModel.find({war: item._id}).remove().exec(); LogFlagModel.find({war: item._id}).deleteMany();
LogBudgetModel.find({war: item._id}).remove().exec(); LogBudgetModel.find({war: item._id}).deleteMany();
LogTransportModel.find({war: item._id}).remove().exec(); LogTransportModel.find({war: item._id}).deleteMany();
LogPointsModel.find({war: item._id}).remove().exec(); LogPointsModel.find({war: item._id}).deleteMany();
LogPlayerCountModel.find({war: item._id}).remove().exec(); LogPlayerCountModel.find({war: item._id}).deleteMany();
// check if logfiles exist and delete from fs // check if logfiles exist and delete from fs
const warDir = resourceLocation + item.id; const warDir = resourceLocation + item.id;

View File

@ -170,7 +170,7 @@ decorationRouter.route('/:id')
} }
// deleted all awardings linked to this decoration // deleted all awardings linked to this decoration
AwardingsModel.find({decorationId: id}).remove().exec(); AwardingsModel.find({decorationId: id}).deleteMany();
// delete graphic // delete graphic
fs.unlink(resourceLocation.concat(id).concat('.png'), fs.unlink(resourceLocation.concat(id).concat('.png'),

View File

@ -43,7 +43,7 @@ logsRouter.route('/:warId')
const sort = {sort: {time: 1}}; const sort = {sort: {time: 1}};
const pointsObjects = LogPointsModel.find(filter, {}, sort); const pointsObjects = LogPointsModel.find(filter, {}, sort);
const budgetObjects = LogBudgetModel.find(filter, {}, sort); const budgetObjects = LogBudgetModel.find(filter, {player: 0, item: 0, buy: 0}, sort);
const respawnObjects = LogRespawnModel.find(filter, {}, sort); const respawnObjects = LogRespawnModel.find(filter, {}, sort);
const reviveObjects = LogReviveModel.find(filter, {}, sort); const reviveObjects = LogReviveModel.find(filter, {}, sort);
const killObjects = LogKillModel.find(filter, {}, sort); const killObjects = LogKillModel.find(filter, {}, sort);

View File

@ -191,7 +191,7 @@ users.route('/:id')
} }
// deleted all awardings linked to this user // deleted all awardings linked to this user
AwardingModel.find({userId: req.params.id}).remove().exec(); AwardingModel.find({userId: req.params.id}).deleteOne();
// check if signature exists and delete compressed and uncompressed file // check if signature exists and delete compressed and uncompressed file
const fileMinified = resourceLocation + req.params.id + '.png'; const fileMinified = resourceLocation + req.params.id + '.png';

View File

@ -115,9 +115,11 @@ errorResponseWare(app);
if (process.env.NODE_ENV === config.test.unit.env || process.env.NODE_ENV === config.test.dredd.env) { if (process.env.NODE_ENV === config.test.unit.env || process.env.NODE_ENV === config.test.dredd.env) {
const MongodbMemoryServer = require('mongodb-memory-server').default; const MongodbMemoryServer = require('mongodb-memory-server').default;
const mongoServer = new MongodbMemoryServer(); const mongoServer = new MongodbMemoryServer();
mongoose.Promise = Promise; mongoose.Promise = Promise;
mongoServer.getConnectionString().then((mongoUri) => { mongoServer.getConnectionString()
mongoose.connect(mongoUri, {useNewUrlParser: true}); .then((mongoUri) => {
mongoose.connect(mongoUri, config.database.mongooseConfig);
mongoose.connection.on('error', (e) => { mongoose.connection.on('error', (e) => {
if (e.message.code === 'ETIMEDOUT') { if (e.message.code === 'ETIMEDOUT') {
@ -148,7 +150,8 @@ if (process.env.NODE_ENV === config.test.unit.env || process.env.NODE_ENV === co
}); });
}); });
} else { } else {
mongoose.connect(config.database.uri + config.database.db, {useNewUrlParser: true}).then((db) => { mongoose.connect(config.database.uri + config.database.db, config.database.mongooseConfig)
.then((db) => {
let cronWorkerPID; let cronWorkerPID;
if (cluster.isMaster) { if (cluster.isMaster) {
// Fork workers // Fork workers

View File

@ -15,7 +15,7 @@ chai.use(chaiHttp);
// Our parent block // Our parent block
describe('Awardings', () => { describe('Awardings', () => {
beforeEach((done) => { // Before each test we empty the database beforeEach((done) => { // Before each test we empty the database
AwardingModel.remove({}, (err) => { AwardingModel.deleteMany({}, (err) => {
done(); done();
}); });
}); });

View File

@ -15,7 +15,7 @@ chai.use(chaiHttp);
// Our parent block // Our parent block
describe('Command', () => { describe('Command', () => {
beforeEach((done) => { // Before each test we empty the database beforeEach((done) => { // Before each test we empty the database
AwardingModel.remove({}, (err) => { AwardingModel.deleteMany({}, (err) => {
done(); done();
}); });
}); });

View File

@ -15,7 +15,7 @@ chai.use(chaiHttp);
// Our parent block // Our parent block
describe('Decorations', () => { describe('Decorations', () => {
beforeEach((done) => { // Before each test we empty the database beforeEach((done) => { // Before each test we empty the database
DecorationModel.remove({}, (err) => { DecorationModel.deleteMany({}, (err) => {
done(); done();
}); });
}); });

View File

@ -15,7 +15,7 @@ chai.use(chaiHttp);
// Our parent block // Our parent block
describe('Ranks', () => { describe('Ranks', () => {
beforeEach((done) => { // Before each test we empty the database beforeEach((done) => { // Before each test we empty the database
RankModel.remove({}, (err) => { RankModel.deleteMany({}, (err) => {
done(); done();
}); });
}); });

View File

@ -15,7 +15,7 @@ chai.use(chaiHttp);
// Our parent block // Our parent block
describe('Squads', () => { describe('Squads', () => {
beforeEach((done) => { // Before each test we empty the database beforeEach((done) => { // Before each test we empty the database
SquadModel.remove({}, (err) => { SquadModel.deleteMany({}, (err) => {
done(); done();
}); });
}); });

View File

@ -15,7 +15,7 @@ chai.use(chaiHttp);
// Our parent block // Our parent block
describe('Users', () => { describe('Users', () => {
beforeEach((done) => { // Before each test we empty the database beforeEach((done) => { // Before each test we empty the database
UserModel.remove({}, (err) => { UserModel.deleteMany({}, (err) => {
done(); done();
}); });
}); });

View File

@ -13,6 +13,12 @@ const VehicleClasses = Object.freeze({
const playerNameRegex = /(^|,\s)(.*?)\s\(/g; const playerNameRegex = /(^|,\s)(.*?)\s\(/g;
const budgetPlayerNameRegex = /\d*\.\s(.*)\s\(ver\)kaufte/;
const budgetItemNameRegex = /\(ver\)kaufte\s(.*)\"$/;
const budgetRespawnNameRegex = /Respawn\svon\s(.*)\"$/;
const vehicleNameEndRegex = /\s\(\w+:/; const vehicleNameEndRegex = /\s\(\w+:/;
const sideRegex = /(side:\s(.*?)\))/; const sideRegex = /(side:\s(.*?)\))/;
@ -178,7 +184,7 @@ const parseWarLog = (lineArray, war) => {
const playerName = line.substring(line.lastIndexOf('Respawn von ') + 12, line.lastIndexOf('"')); const playerName = line.substring(line.lastIndexOf('Respawn von ') + 12, line.lastIndexOf('"'));
stats.respawn.push(getRespawnEntry(budg, playerName, war._id, war.date)); stats.respawn.push(getRespawnEntry(budg, playerName, war._id, war.date));
} }
stats.budget.push(getBudgetEntry(budg, war._id, war.date)); stats.budget.push(getBudgetEntry(line, budg, war._id, war.date));
} }
} else if (line.includes('(Fahne)') && !line.includes('Dominator')) { } else if (line.includes('(Fahne)') && !line.includes('Dominator')) {
/** /**
@ -405,14 +411,37 @@ const getPointsEntry = (pt, line, warId, warDate) => {
}; };
}; };
const getBudgetEntry = (budg, warId, warDate) => { const getBudgetEntry = (line, budg, warId, warDate) => {
return { const timestamp = getFullTimeDate(warDate, budg[5]);
const oldBudget = transformMoneyString(budg[9]);
const newBudget = transformMoneyString(budg[12]);
const fraction = budg[7] === 'NATO' ? 'BLUFOR' : 'OPFOR';
const budgetEntry = {
war: warId, war: warId,
time: getFullTimeDate(warDate, budg[5]), time: timestamp,
fraction: budg[7] === 'NATO' ? 'BLUFOR' : 'OPFOR', fraction: fraction,
oldBudget: transformMoneyString(budg[9]), oldBudget: oldBudget,
newBudget: transformMoneyString(budg[12]), newBudget: newBudget,
buy: oldBudget <= newBudget,
}; };
const budgetRespawnMatch = budgetRespawnNameRegex.exec(line);
if (budgetRespawnMatch && budgetRespawnMatch.length > 1) {
budgetEntry.player = budgetRespawnMatch[1];
budgetEntry.item = 'Respawn';
} else {
const itemNameMatch = budgetItemNameRegex.exec(line);
const playerNameMatch = budgetPlayerNameRegex.exec(line);
if (playerNameMatch && playerNameMatch.length > 1) {
budgetEntry.player = playerNameMatch[1];
}
if (itemNameMatch && itemNameMatch.length > 1) {
budgetEntry.item = itemNameMatch[1];
}
}
return budgetEntry;
}; };
const getPlayerInfoFromString = (inputString) => { const getPlayerInfoFromString = (inputString) => {

3882
static/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -39,13 +39,13 @@
"jquery-ui-bundle": "^1.11.4", "jquery-ui-bundle": "^1.11.4",
"ngx-clipboard": "^11.1.1", "ngx-clipboard": "^11.1.1",
"ngx-cookie-service": "^1.0.10", "ngx-cookie-service": "^1.0.10",
"ngx-infinite-scroll": "^0.5.2", "ngx-infinite-scroll": "^7.0.1",
"rxjs-compat": "^6.2.1", "rxjs-compat": "^6.2.1",
"ts-helpers": "^1.1.2", "ts-helpers": "^1.1.2",
"zone.js": "^0.8.26" "zone.js": "^0.8.26"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "^0.8.3", "@angular-devkit/build-angular": "^0.13.1",
"@types/jasmine": "2.5.38", "@types/jasmine": "2.5.38",
"@types/node": "^6.0.89", "@types/node": "^6.0.89",
"codelyzer": "^4.4.2", "codelyzer": "^4.4.2",

View File

@ -137,7 +137,11 @@
</div> </div>
</div> </div>
<span *ngIf="loading" class="load-indicator load-arrow glyphicon-refresh-animate"></span> <div *ngIf="loading" class="load-indicator">
<div class="opt-loader"></div>
<mat-icon svgIcon="opt-logo-core" class="opt-logo-core"></mat-icon>
</div>
<button mat-icon-button <button mat-icon-button
mat-mini-fab mat-mini-fab

View File

@ -1,3 +1,5 @@
@import "style/load-indicator.scss";
ul { ul {
list-style-type: none; list-style-type: none;
margin: 0; margin: 0;
@ -43,7 +45,7 @@ li {
} }
#scrollTopBtn:hover { #scrollTopBtn:hover {
background: rgba(16, 16, 16); background: #101010;
} }
.unprocessed { .unprocessed {

View File

@ -18,7 +18,7 @@ declare function require(url: string);
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
templateUrl: 'app.component.html', templateUrl: 'app.component.html',
styleUrls: ['app.component.css', 'style/load-indicator.css'] styleUrls: ['app.component.scss']
}) })
export class AppComponent implements OnInit { export class AppComponent implements OnInit {
@ -36,7 +36,7 @@ export class AppComponent implements OnInit {
// to load from assets/icon folder // to load from assets/icon folder
svgIcons = { svgIcons = {
'opt-logo': 'general/opt-logo', 'opt-logo': 'general/opt-logo',
'loading-arrows': 'general/loading-arrows', 'opt-logo-core': 'general/opt-logo-core',
'add': 'outline-add_box-24px', 'add': 'outline-add_box-24px',
'add-user': 'twotone-person_add-24px', 'add-user': 'twotone-person_add-24px',
'award': 'award', 'award': 'award',

View File

@ -37,7 +37,8 @@
[xAxis]="xAxis" [xAxis]="xAxis"
[yAxis]="yAxis" [yAxis]="yAxis"
[showXAxisLabel]="showXAxisLabel" [showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel"> [showYAxisLabel]="showYAxisLabel"
[animations]="animations">
</ngx-charts-bar-horizontal> </ngx-charts-bar-horizontal>
</div> </div>
</div> </div>
@ -59,6 +60,7 @@
[yAxisLabel]="category.label" [yAxisLabel]="category.label"
[autoScale]="autoscale" [autoScale]="autoscale"
[timeline]="timeline" [timeline]="timeline"
[animations]="animations"
[roundDomains]="roundDomains"> [roundDomains]="roundDomains">
</ngx-charts-line-chart> </ngx-charts-line-chart>
</div> </div>

View File

@ -9,7 +9,7 @@ import {TranslateService} from '@ngx-translate/core';
@Component({ @Component({
selector: 'campaign-player-detail', selector: 'campaign-player-detail',
templateUrl: './campaign-player-detail.component.html', templateUrl: './campaign-player-detail.component.html',
styleUrls: ['./campaign-player-detail.component.css', '../../../style/list-entry.css', styleUrls: ['./campaign-player-detail.component.scss', '../../../style/list-entry.css',
'../../../style/hide-scrollbar.css', '../../../style/overview.css'] '../../../style/hide-scrollbar.css', '../../../style/overview.css']
}) })
export class CampaignPlayerDetailComponent implements OnInit { export class CampaignPlayerDetailComponent implements OnInit {
@ -46,6 +46,7 @@ export class CampaignPlayerDetailComponent implements OnInit {
autoscale = false; autoscale = false;
timeline = false; timeline = false;
roundDomains = true; roundDomains = true;
animations = false;
kdRatio = 0; kdRatio = 0;
maxKd = 1.7; maxKd = 1.7;
@ -53,7 +54,7 @@ export class CampaignPlayerDetailComponent implements OnInit {
respawnDeathRatio = 0; respawnDeathRatio = 0;
maxRespawnDeathRatio = 1; maxRespawnDeathRatio = 1;
playerAttributeNameMap = PlayerUtils.tmpAttributeDisplayNames.slice(2, PlayerUtils.tmpAttributeDisplayNames.length); playerAttributeNameMap = PlayerUtils.attributeDisplayNames.slice(2, PlayerUtils.attributeDisplayNames.length);
constructor(private playerService: PlayerService, constructor(private playerService: PlayerService,
private translate: TranslateService) { private translate: TranslateService) {
@ -81,18 +82,18 @@ export class CampaignPlayerDetailComponent implements OnInit {
this.initDataArray(); this.initDataArray();
const totalDeathDiv = this.graphData[7].total === 0 ? 1 : this.graphData[7].total; const totalDeathDiv = this.graphData[9].total === 0 ? 1 : this.graphData[9].total;
this.kdRatio = parseFloat((this.graphData[0].total / totalDeathDiv).toFixed(2)); this.kdRatio = parseFloat((this.graphData[0].total / totalDeathDiv).toFixed(2));
if (this.kdRatio > 1) { if (this.kdRatio > 1) {
this.maxKd = this.kdRatio * 1.7; this.maxKd = this.kdRatio * 1.7;
} }
this.respawnDeathRatio = parseFloat((this.graphData[8].total / totalDeathDiv).toFixed(2)); this.respawnDeathRatio = parseFloat((this.graphData[10].total / totalDeathDiv).toFixed(2));
// we can not directly push to target array, since only full reference changes trigger the refresh of data // we can not directly push to target array, since only full reference changes trigger the refresh of data
const tmpSumData = []; const tmpSumData = [];
this.graphData.forEach(dataSet => { this.graphData.forEach(dataSet => {
tmpSumData.push({name: dataSet.label, value: dataSet.total}); tmpSumData.push({name: dataSet.label, value: dataSet.total ? dataSet.total : 0});
}); });
this.sumData = tmpSumData; this.sumData = tmpSumData;
}); });
@ -100,7 +101,7 @@ export class CampaignPlayerDetailComponent implements OnInit {
private initDataArray() { private initDataArray() {
this.graphData.forEach(dataSet => { this.graphData.forEach(dataSet => {
const killObj = { const dataObj = {
name: dataSet.label, name: dataSet.label,
series: [] series: []
}; };
@ -108,15 +109,21 @@ export class CampaignPlayerDetailComponent implements OnInit {
let total = 0; let total = 0;
for (let i = 0; i < playerLength; i++) { for (let i = 0; i < playerLength; i++) {
const warDateString = ChartUtils.getShortDateString(this.campaignPlayer.players[i].warId.date); const warDateString = ChartUtils.getShortDateString(this.campaignPlayer.players[i].warId.date);
const value = this.campaignPlayer.players[i][dataSet.key];
killObj.series.push({ const valueField = this.campaignPlayer.players[i][dataSet.key];
let value = valueField ? valueField : 0;
if (dataSet.key === 'travelDistance' || dataSet.key === 'driverDistance') {
value = Math.round(value / 1000); // meters to km
}
dataObj.series.push({
name: warDateString, name: warDateString,
value: value value: value
}); });
total += value; total += value;
} }
dataSet.data = [killObj]; dataSet.data = [dataObj];
dataSet.refLine = [{value: total / playerLength, name: this.translations['stats.player.detail.graph.average']}]; dataSet.refLine = [{value: total / playerLength, name: this.translations['stats.player.detail.graph.average']}];
dataSet.total = total; dataSet.total = total;
}); });

View File

@ -20,7 +20,7 @@
[legendTitle]="legendTitle" [legendTitle]="legendTitle"
[showXAxisLabel]="showXAxisLabel" [showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel" [showYAxisLabel]="showYAxisLabel"
[yAxisLabel]="lineChartLabel" [yAxisLabel]="chartYAxisLabel"
[autoScale]="autoscale" [autoScale]="autoscale"
[timeline]="timeline" [timeline]="timeline"
[roundDomains]="roundDomains"> [roundDomains]="roundDomains">
@ -28,20 +28,25 @@
</div> </div>
<div *ngIf="!showLineChart" class="chart-container"> <div *ngIf="!showLineChart" class="chart-container">
<ngx-charts-area-chart <ngx-charts-bar-vertical-stacked
[scheme]="colorScheme" [scheme]="colorScheme"
[results]="areaChartData" [results]="barChartData"
[xAxis]="xAxis" [xAxis]="xAxis"
[yAxis]="yAxis" [yAxis]="yAxis"
[curve]="stepCurve"
[legend]="legend" [legend]="legend"
[legendTitle]="legendTitle" [legendTitle]="legendTitle"
[showXAxisLabel]="showXAxisLabel" [showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel" [showYAxisLabel]="showYAxisLabel"
[yAxisLabel]="labelFlag" [animations]="barAnimations"
[autoScale]="autoscale" [barPadding]="barPadding"
[timeline]="timeline" [xAxisTickFormatting]="axisFormatX"
[roundDomains]="false"> [yAxisTickFormatting]="axisFormatY">
</ngx-charts-area-chart> <ng-template #tooltipTemplate let-model="model">
<small>{{'stats.fraction.tooltip.flag.minute' | translate}} {{model.series}}</small>
<div>{{model.name}} {{'stats.fraction.tooltip.flag.flag' | translate}}</div>
<div *ngIf="model.value === 0">{{'stats.fraction.tooltip.flag.lost' | translate}}</div>
<div *ngIf="model.value !== 0">{{'stats.fraction.tooltip.flag.safe' | translate}}</div>
</ng-template>
</ngx-charts-bar-vertical-stacked>
</div> </div>
</div> </div>

View File

@ -0,0 +1,37 @@
.chart-select-group {
display: flex;
width: fit-content;
margin: auto;
}
:host /deep/ mat-button-toggle {
color: #666666;
background: #e7e7e7;
:hover {
background: #afafaf;
}
&.mat-button-toggle-checked {
background: #ffffff;
}
label.mat-button-toggle-label {
margin: 2px 0;
}
div.mat-button-toggle-label-content {
line-height: 25px;
margin-bottom: 0;
font-weight: normal;
}
}
.chart-container {
width: 95%;
margin: 2%;
min-width: 900px;
height: 50vh;
padding: 15px;
float: left;
}

View File

@ -1,5 +1,4 @@
import {Component, ElementRef, Input, OnChanges, OnInit, SimpleChanges, ViewChild} from '@angular/core'; import {Component, ElementRef, Input, OnChanges, OnInit, SimpleChanges, ViewChild} from '@angular/core';
import * as d3 from 'd3';
import {ChartUtils} from '../../../utils/chart-utils'; import {ChartUtils} from '../../../utils/chart-utils';
import {Fraction} from '../../../utils/fraction.enum'; import {Fraction} from '../../../utils/fraction.enum';
import {War} from '../../../models/model-interfaces'; import {War} from '../../../models/model-interfaces';
@ -9,7 +8,7 @@ import {TranslateService} from '@ngx-translate/core';
@Component({ @Component({
selector: 'war-detail-fraction', selector: 'war-detail-fraction',
templateUrl: './fraction-stats.component.html', templateUrl: './fraction-stats.component.html',
styleUrls: ['./fraction-stats.component.css', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css'] styleUrls: ['./fraction-stats.component.scss', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css']
}) })
export class FractionStatsComponent implements OnInit, OnChanges { export class FractionStatsComponent implements OnInit, OnChanges {
@ -28,7 +27,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
public activeChartSelect: string; public activeChartSelect: string;
lineChartData: any[] = []; lineChartData: any[] = [];
areaChartData: any[] = []; barChartData: any[] = [];
tmpPointData; tmpPointData;
tmpBudgetData; tmpBudgetData;
@ -38,7 +37,6 @@ export class FractionStatsComponent implements OnInit, OnChanges {
tmpTransportData; tmpTransportData;
tmpReviveData; tmpReviveData;
tmpStabilizeData; tmpStabilizeData;
tmpFlagCaptureData;
tmpPlayerCountData; tmpPlayerCountData;
colorScheme = { colorScheme = {
@ -49,10 +47,10 @@ export class FractionStatsComponent implements OnInit, OnChanges {
labels; labels;
labelsKeys; labelsKeys;
lineChartLabel: string; chartYAxisLabel: string;
// line chart
showLineChart = true; showLineChart = true;
stepCurve = d3.curveStepAfter;
gradient = false; gradient = false;
yAxis = true; yAxis = true;
xAxis = true; xAxis = true;
@ -64,11 +62,15 @@ export class FractionStatsComponent implements OnInit, OnChanges {
timeline = false; timeline = false;
roundDomains = true; roundDomains = true;
// bar chart
barPadding = 0;
barAnimations = false;
constructor(private translate: TranslateService) { constructor(private translate: TranslateService) {
} }
ngOnInit() { ngOnInit() {
this.setLineChartLabel(this.labels.points); this.setChartYAxisLabel(this.labels.points);
} }
ngOnChanges(changes: SimpleChanges) { ngOnChanges(changes: SimpleChanges) {
@ -84,7 +86,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
this.initializeToggleButtons(); this.initializeToggleButtons();
Object.assign(this, [this.lineChartData, this.areaChartData]); Object.assign(this, [this.lineChartData, this.barChartData]);
this.activeChartSelect = this.labels.points; this.activeChartSelect = this.labels.points;
this.startDateObj = new Date(this.war.date); this.startDateObj = new Date(this.war.date);
@ -134,7 +136,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
this.activeChartSelect = newSelection; this.activeChartSelect = newSelection;
if (this.activeChartSelect !== this.labels.flag) { if (this.activeChartSelect !== this.labels.flag) {
this.showLineChart = true; this.showLineChart = true;
this.setLineChartLabel(this.activeChartSelect); this.setChartYAxisLabel(this.activeChartSelect);
switch (this.activeChartSelect) { switch (this.activeChartSelect) {
case this.labels.points: case this.labels.points:
this.lineChartData = this.tmpPointData; this.lineChartData = this.tmpPointData;
@ -175,7 +177,6 @@ export class FractionStatsComponent implements OnInit, OnChanges {
} else { } else {
this.initFlagHoldData(); this.initFlagHoldData();
this.showLineChart = false; this.showLineChart = false;
this.areaChartData = this.tmpFlagCaptureData;
} }
} }
@ -205,7 +206,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
const fractionChange = budgetEntry.fraction === 'BLUFOR' ? 0 : 1; const fractionChange = budgetEntry.fraction === 'BLUFOR' ? 0 : 1;
const fractionOld = budgetEntry.fraction !== 'BLUFOR' ? 0 : 1; const fractionOld = budgetEntry.fraction !== 'BLUFOR' ? 0 : 1;
if (this.isTwoMinutesAhead(budgetEntryDate, this.tmpBudgetData)) { if (ChartUtils.isOneMinuteAhead(budgetEntryDate, this.tmpBudgetData)) {
this.tmpBudgetData[fractionChange].series.push(ChartUtils.getSeriesEntry(new Date(budgetEntry.time), budgetEntry.newBudget)); this.tmpBudgetData[fractionChange].series.push(ChartUtils.getSeriesEntry(new Date(budgetEntry.time), budgetEntry.newBudget));
this.tmpBudgetData[fractionOld].series.push(ChartUtils.getSeriesEntry(new Date(budgetEntry.time), this.tmpBudgetData[fractionOld].series.push(ChartUtils.getSeriesEntry(new Date(budgetEntry.time),
this.tmpBudgetData[fractionOld].series[this.tmpBudgetData[fractionOld].series.length - 1].value)); this.tmpBudgetData[fractionOld].series[this.tmpBudgetData[fractionOld].series.length - 1].value));
@ -230,7 +231,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
if (killEntry.fraction === 'OPFOR') { if (killEntry.fraction === 'OPFOR') {
killCountOpfor++; killCountOpfor++;
} }
if (this.isTwoMinutesAhead(killEntryDate, this.tmpKillData)) { if (ChartUtils.isOneMinuteAhead(killEntryDate, this.tmpKillData)) {
this.tmpKillData[0].series.push(ChartUtils.getSeriesEntry(killEntryDate, killCountBlufor)); this.tmpKillData[0].series.push(ChartUtils.getSeriesEntry(killEntryDate, killCountBlufor));
this.tmpKillData[1].series.push(ChartUtils.getSeriesEntry(killEntryDate, killCountOpfor)); this.tmpKillData[1].series.push(ChartUtils.getSeriesEntry(killEntryDate, killCountOpfor));
} }
@ -241,7 +242,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
if (killEntry.fraction === 'OPFOR') { if (killEntry.fraction === 'OPFOR') {
ffKillCountOpfor++; ffKillCountOpfor++;
} }
if (this.isTwoMinutesAhead(killEntryDate, this.tmpFrienlyFireData)) { if (ChartUtils.isOneMinuteAhead(killEntryDate, this.tmpFrienlyFireData)) {
this.tmpFrienlyFireData[0].series.push(ChartUtils.getSeriesEntry(killEntryDate, ffKillCountBlufor)); this.tmpFrienlyFireData[0].series.push(ChartUtils.getSeriesEntry(killEntryDate, ffKillCountBlufor));
this.tmpFrienlyFireData[1].series.push(ChartUtils.getSeriesEntry(killEntryDate, ffKillCountOpfor)); this.tmpFrienlyFireData[1].series.push(ChartUtils.getSeriesEntry(killEntryDate, ffKillCountOpfor));
} }
@ -272,7 +273,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
} else { } else {
reviveCountOpfor++; reviveCountOpfor++;
} }
if (this.isTwoMinutesAhead(reviveEntryDate, this.tmpReviveData)) { if (ChartUtils.isOneMinuteAhead(reviveEntryDate, this.tmpReviveData)) {
this.tmpReviveData[0].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, reviveCountBlufor)); this.tmpReviveData[0].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, reviveCountBlufor));
this.tmpReviveData[1].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, reviveCountOpfor)); this.tmpReviveData[1].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, reviveCountOpfor));
} }
@ -282,7 +283,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
} else { } else {
stabilizeCountOpfor++; stabilizeCountOpfor++;
} }
if (this.isTwoMinutesAhead(reviveEntryDate, this.tmpStabilizeData)) { if (ChartUtils.isOneMinuteAhead(reviveEntryDate, this.tmpStabilizeData)) {
this.tmpStabilizeData[0].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, stabilizeCountBlufor)); this.tmpStabilizeData[0].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, stabilizeCountBlufor));
this.tmpStabilizeData[1].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, stabilizeCountOpfor)); this.tmpStabilizeData[1].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, stabilizeCountOpfor));
} }
@ -341,7 +342,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
} }
} }
} }
if (this.isTwoMinutesAhead(vehicleEntryDate, this.tmpVehicleData) || index === this.logData.vehicle.length - 1) { if (ChartUtils.isOneMinuteAhead(vehicleEntryDate, this.tmpVehicleData) || index === this.logData.vehicle.length - 1) {
this.tmpVehicleData[0].series.push(ChartUtils.getSeriesEntry(vehicleEntryDate, vehicleKillCountBlufor)); this.tmpVehicleData[0].series.push(ChartUtils.getSeriesEntry(vehicleEntryDate, vehicleKillCountBlufor));
this.tmpVehicleData[1].series.push(ChartUtils.getSeriesEntry(vehicleEntryDate, vehicleKillCountOpfor)); this.tmpVehicleData[1].series.push(ChartUtils.getSeriesEntry(vehicleEntryDate, vehicleKillCountOpfor));
if (vehicleEntry.vehicleClass) { if (vehicleEntry.vehicleClass) {
@ -373,7 +374,8 @@ export class FractionStatsComponent implements OnInit, OnChanges {
} else { } else {
transportCountOpfor++; transportCountOpfor++;
} }
if (this.isTwoMinutesAhead(transportEntryDate, this.tmpTransportData) || index === this.logData.transport.length - 1) { if (ChartUtils.isOneMinuteAhead(transportEntryDate, this.tmpTransportData) ||
index === this.logData.transport.length - 1) {
this.tmpTransportData[0].series.push(ChartUtils.getSeriesEntry(transportEntryDate, transportCountBlufor)); this.tmpTransportData[0].series.push(ChartUtils.getSeriesEntry(transportEntryDate, transportCountBlufor));
this.tmpTransportData[1].series.push(ChartUtils.getSeriesEntry(transportEntryDate, transportCountOpfor)); this.tmpTransportData[1].series.push(ChartUtils.getSeriesEntry(transportEntryDate, transportCountOpfor));
} }
@ -402,26 +404,50 @@ export class FractionStatsComponent implements OnInit, OnChanges {
} }
let flagStatusBlufor = true; let flagStatusBlufor = true;
let flagStatusOpfor = true; let flagStatusOpfor = true;
this.tmpFlagCaptureData[0].series.push(ChartUtils.getSeriesEntry(this.startDateObj, flagStatusBlufor)); const flagStatusMap = {
this.tmpFlagCaptureData[1].series.push(ChartUtils.getSeriesEntry(this.startDateObj, flagStatusOpfor)); blufor: {0: flagStatusBlufor},
opfor: {0: flagStatusOpfor},
};
this.logData.flag.forEach(flagEntry => { this.logData.flag.forEach((flagEntry) => {
if (flagEntry.flagFraction === 'BLUFOR') { if (flagEntry.flagFraction === 'BLUFOR') {
flagStatusBlufor = !flagEntry.capture; flagStatusBlufor = !flagEntry.capture;
} else { } else {
flagStatusOpfor = !flagEntry.capture; flagStatusOpfor = !flagEntry.capture;
} }
this.tmpFlagCaptureData[flagEntry.flagFraction === 'BLUFOR' ? 0 : 1].series.push( const entryMinute = Math.round((new Date(flagEntry.time).getTime() - new Date(this.war.date).getTime()) / 60000);
ChartUtils.getSeriesEntry(new Date(flagEntry.time), flagEntry.flagFraction === 'BLUFOR' ? flagStatusBlufor : flagStatusOpfor) flagStatusMap.blufor[entryMinute] = flagStatusBlufor;
); flagStatusMap.opfor[entryMinute] = flagStatusOpfor;
}); });
this.addFinalTimeData(this.tmpFlagCaptureData); const data = [];
this.initialized.flag = true; let lastExistingIdx = 0;
const finishMinute = Math.round((new Date(this.war.endDate).getTime() - new Date(this.war.date).getTime()) / 60000);
for (let t = 0; t <= finishMinute; t++) {
if (flagStatusMap.blufor.hasOwnProperty(t) && flagStatusMap.opfor.hasOwnProperty(t)) {
lastExistingIdx = t;
} }
data.push({
protected isTwoMinutesAhead(entryDate: Date, tmpData: any): boolean { name: t,
return entryDate.getTime() >= tmpData[0].series[tmpData[0].series.length - 1].name.getTime() + (1.5 * 60000); series: [
{
name: Fraction.BLUFOR,
value: flagStatusMap.blufor[lastExistingIdx] ? 1 : 0
}
]
});
data.push({
name: t,
series: [
{
name: Fraction.OPFOR,
value: flagStatusMap.opfor[lastExistingIdx] ? -1 : 0
}
]
});
}
this.barChartData = data;
this.initialized.flag = true;
} }
initializeTempCollections() { initializeTempCollections() {
@ -435,7 +461,6 @@ export class FractionStatsComponent implements OnInit, OnChanges {
this.tmpTransportData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpTransportData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
this.tmpReviveData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpReviveData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
this.tmpStabilizeData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpStabilizeData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
this.tmpFlagCaptureData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
this.tmpPlayerCountData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpPlayerCountData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
[this.tmpKillData, this.tmpFrienlyFireData, this.tmpVehicleData, this.tmpReviveData, this.tmpStabilizeData, [this.tmpKillData, this.tmpFrienlyFireData, this.tmpVehicleData, this.tmpReviveData, this.tmpStabilizeData,
@ -466,9 +491,21 @@ export class FractionStatsComponent implements OnInit, OnChanges {
} }
} }
setLineChartLabel(i18n: string) { setChartYAxisLabel(i18n: string) {
this.translate.get(i18n).subscribe((translated) => { this.translate.get(i18n).subscribe((translated) => {
this.lineChartLabel = translated; this.chartYAxisLabel = translated;
}); });
} }
axisFormatX(val) {
if (val % 10 === 0) {
return val;
} else {
return '';
}
}
axisFormatY(val) {
return '';
}
} }

View File

@ -7,7 +7,8 @@
class="mat-elevation-z8"> class="mat-elevation-z8">
<ng-container matColumnDef="{{tableHead[0].prop}}"> <ng-container matColumnDef="{{tableHead[0].prop}}">
<mat-header-cell *matHeaderCellDef mat-sort-header="{{tableHead[0].prop}}">{{tableHead[0].head | translate}}</mat-header-cell> <mat-header-cell *matHeaderCellDef
mat-sort-header="{{tableHead[0].prop}}">{{tableHead[0].head | translate}}</mat-header-cell>
<mat-cell *matCellDef="let element" <mat-cell *matCellDef="let element"
[style.color]="element['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR"> [style.color]="element['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR">
{{element.name}} {{element.name}}
@ -15,8 +16,10 @@
</ng-container> </ng-container>
<ng-container matColumnDef="{{tableHead[1].prop}}"> <ng-container matColumnDef="{{tableHead[1].prop}}">
<mat-header-cell *matHeaderCellDef mat-sort-header="{{tableHead[1].prop}}">{{tableHead[1].head | translate}}</mat-header-cell> <mat-header-cell *matHeaderCellDef
<mat-cell *matCellDef="let element">{{element.fraction === 'BLUFOR' ? fraction.BLUFOR : fraction.OPFOR}}</mat-cell> mat-sort-header="{{tableHead[1].prop}}">{{tableHead[1].head | translate}}</mat-header-cell>
<mat-cell *matCellDef="let element">{{element.fraction ===
'BLUFOR' ? fraction.BLUFOR : fraction.OPFOR}}</mat-cell>
</ng-container> </ng-container>
<ng-container *ngFor="let column of tableHead.slice(2, tableHead.length)" matColumnDef="{{column.prop}}"> <ng-container *ngFor="let column of tableHead.slice(2, tableHead.length)" matColumnDef="{{column.prop}}">

View File

@ -26,10 +26,6 @@ export class ScoreboardComponent implements OnChanges {
isSteamUUID = PlayerUtils.isSteamUUID; isSteamUUID = PlayerUtils.isSteamUUID;
cellHeight = 40;
columnWidth = 65;
rows = []; rows = [];
sortedRows = []; sortedRows = [];
@ -52,10 +48,15 @@ export class ScoreboardComponent implements OnChanges {
ngOnChanges(changes: SimpleChanges) { ngOnChanges(changes: SimpleChanges) {
if (changes.war) { if (changes.war) {
this.war.players.forEach(player => {
changes.war.currentValue.players
.filter(player => !player.initalized)
.forEach(player => {
// meters to kilometer or fill with null, since optional // meters to kilometer or fill with null, since optional
player.travelDistance = player.travelDistance ? Math.round(player.travelDistance / 1000) : 0; player.travelDistance = player.travelDistance ? Math.round(player.travelDistance / 1000) : 0;
player.driverDistance = player.driverDistance ? Math.round(player.driverDistance / 1000) : 0; player.driverDistance = player.driverDistance ? Math.round(player.driverDistance / 1000) : 0;
// mark initialized to avoid processing again on navigation
player.initalized = true;
}); });
this.rows = changes.war.currentValue.players; this.rows = changes.war.currentValue.players;

View File

@ -1,37 +0,0 @@
.chart-select-group {
display: flex;
width: fit-content;
margin: auto;
}
:host /deep/ mat-button-toggle {
color: #666666;
background: #e7e7e7;
}
:host /deep/ mat-button-toggle:hover {
background: #afafaf;
}
:host /deep/ mat-button-toggle.mat-button-toggle-checked {
background: #ffffff;
}
:host /deep/ label.mat-button-toggle-label {
margin: 2px 0;
}
:host /deep/ div.mat-button-toggle-label-content {
line-height: 25px;
margin-bottom: 0;
font-weight: normal;
}
.chart-container {
width: 95%;
margin: 2%;
min-width: 900px;
height: 50vh;
padding: 15px;
float: left;
}

View File

@ -21,7 +21,7 @@
[showXAxisLabel]="showXAxisLabel" [showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel" [showYAxisLabel]="showYAxisLabel"
[yAxisLabel]="barChartLabel" [yAxisLabel]="barChartLabel"
[barPadding]="2" [barPadding]="barPadding"
[roundDomains]="roundDomains"> [roundDomains]="roundDomains">
</ngx-charts-bar-vertical> </ngx-charts-bar-vertical>
</div> </div>

View File

@ -7,15 +7,15 @@
:host /deep/ mat-button-toggle { :host /deep/ mat-button-toggle {
color: #666666; color: #666666;
background: #e7e7e7; background: #e7e7e7;
}
:host /deep/ mat-button-toggle:hover { :hover {
background: #afafaf; background: #afafaf;
} }
:host /deep/ mat-button-toggle.mat-button-toggle-checked { &.mat-button-toggle-checked {
background: #ffffff; background: #ffffff;
} }
}
:host /deep/ label.mat-button-toggle-label { :host /deep/ label.mat-button-toggle-label {
margin: 2px 0; margin: 2px 0;

View File

@ -7,7 +7,7 @@ import {ChartUtils} from '../../../utils/chart-utils';
@Component({ @Component({
selector: 'cc-server-statistics', selector: 'cc-server-statistics',
templateUrl: './server-stats.component.html', templateUrl: './server-stats.component.html',
styleUrls: ['./server-stats.component.css', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css'] styleUrls: ['./server-stats.component.scss', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css']
}) })
export class ServerStatsComponent implements OnInit, OnChanges { export class ServerStatsComponent implements OnInit, OnChanges {
@ -17,8 +17,6 @@ export class ServerStatsComponent implements OnInit, OnChanges {
@Input() performanceData: any; @Input() performanceData: any;
startDateObj: Date;
public activeChartSelect: string; public activeChartSelect: string;
showBarChart = true; showBarChart = true;
@ -42,7 +40,6 @@ export class ServerStatsComponent implements OnInit, OnChanges {
}; };
readonly labelsAsString = Object.keys(this.labels) readonly labelsAsString = Object.keys(this.labels)
.map((key) => this.labels[key]); .map((key) => this.labels[key]);
lineChartSeriesLabels: string[];
gradient = false; gradient = false;
yAxis = true; yAxis = true;
@ -54,6 +51,7 @@ export class ServerStatsComponent implements OnInit, OnChanges {
autoscale = true; autoscale = true;
timeline = false; timeline = false;
roundDomains = true; roundDomains = true;
barPadding = 2;
colorScheme = { colorScheme = {
name: 'nightLights', name: 'nightLights',
selectable: false, selectable: false,

View File

@ -1,77 +0,0 @@
.war-header-container {
width: 920px;
min-height: 165px;
padding-top: 12px;
margin: auto;
}
.head-field {
font-size: 22px;
margin-top: 10px;
margin-bottom: 10px;
}
form.tab-control {
padding: 10px;
}
span.tab-control {
margin: 4px 30px 4px 55px;
padding: 4px 16px;
}
.nav-tabs > li.active > a {
background: #ffffff;
border-bottom: none;
}
.nav-tabs > li.active {
position: relative;
top: 1px;
z-index: 10;
}
.nav-tabs mat-icon {
color: #666666;
height: 26px;
width: 26px;
display: inline-block;
vertical-align: middle;
}
:host/deep/.mat-icon-stats-performance g {
stroke: #666666;
}
.nav-tabs {
width: 1000px;
margin: auto;
clear: both;
border-bottom: 0;
}
.nav-tab-hidden {
visibility: hidden;
}
.nav-tabs > li > a {
background: #e7e7e7;
border: 1px solid #dadada;
}
.nav-tabs > li:not(.active) > a:hover {
background: #afafaf;
}
.nav-tabs > li:last-child {
margin-left: 65px;
}
.nav-link {
cursor: pointer !important;
color: #666666 !important;
}
.nav-tabs > li.deactivated > a.nav-link {
cursor: not-allowed !important;
}

View File

@ -0,0 +1,79 @@
.war-header-container {
width: 920px;
min-height: 165px;
padding-top: 12px;
margin: auto;
}
.head-field {
font-size: 22px;
margin-top: 10px;
margin-bottom: 10px;
}
form.tab-control {
padding: 10px;
}
span.tab-control {
margin: 4px 30px 4px 55px;
padding: 4px 16px;
}
:host /deep/ .mat-icon-stats-performance g {
stroke: #666666;
}
.nav-tabs {
width: 1000px;
margin: auto;
clear: both;
border-bottom: 0;
mat-icon {
color: #666666;
height: 26px;
width: 26px;
display: inline-block;
vertical-align: middle;
}
> li {
> a {
background: #e7e7e7;
border: 1px solid #dadada;
}
}
> li.active {
position: relative;
top: 1px;
z-index: 10;
> a {
background: #ffffff;
border-bottom: none;
}
}
> li:not(.active) > a:hover {
background: #afafaf;
}
> li.deactivated > a.nav-link {
cursor: not-allowed !important;
}
> li:last-child {
margin-left: 65px;
}
}
.nav-tab-hidden {
visibility: hidden;
}
.nav-link {
cursor: pointer !important;
color: #666666 !important;
}

View File

@ -11,7 +11,7 @@ import {ScoreboardComponent} from '../scoreboard/scoreboard.component';
@Component({ @Component({
selector: 'war-detail', selector: 'war-detail',
templateUrl: './war-header.component.html', templateUrl: './war-header.component.html',
styleUrls: ['./war-header.component.css', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css'] styleUrls: ['./war-header.component.scss', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css']
}) })
export class WarHeaderComponent implements OnInit { export class WarHeaderComponent implements OnInit {

View File

@ -1,49 +0,0 @@
.load-indicator {
position: absolute;
top: 50%;
z-index: 10000;
left: 46%;
filter: drop-shadow(3px 1px 2px #dadada);
}
@media only screen and (min-width: 1200px) {
.load-indicator {
left: 47.4%;
}
}
@media only screen and (min-width: 1376px) {
.load-indicator {
left: 48%;
}
}
@media only screen and (min-width: 1600px) {
.load-indicator {
left: 48.2%;
}
}
@media only screen and (min-width: 1925px) {
.load-indicator {
left: 48.7%;
}
}
.load-arrow {
background: url(../../assets/icon/general/loading-arrows.svg) no-repeat;
display: block;
width: 70px;
height: 70px;
}
/* Loading Animation */
.glyphicon-refresh-animate {
animation: spin 1.5s linear infinite;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}

View File

@ -0,0 +1,51 @@
$primary-color: #dadada;
$secondary-color: #666666;
$indicator-width: 100px;
$indicator-height: 100px;
.load-indicator {
width: $indicator-width;
height: $indicator-height;
position: absolute;
top: calc(50% - (#{$indicator-height} / 2));
left: calc(50% - (#{$indicator-width} / 2));
z-index: 10000;
filter: drop-shadow(3px 1px 2px $secondary-color);
.opt-loader {
border: 3px solid $secondary-color;
border-top: 3px solid $primary-color;
border-radius: 50%;
display: inline-block;
position: absolute;
width: 100%;
height: 100%;
animation: spin 2s linear infinite, fade 2s linear infinite;
}
.opt-logo-core {
width: $indicator-width * 0.85;
height: $indicator-height * 0.85;
margin: 6px 8px;
stroke: $secondary-color;
color: $primary-color;
}
}
@keyframes fade {
0%, 100% {
opacity: 0.5;
}
50% {
opacity: 1;
}
}
@keyframes spin {
0% {
transform: rotate(0deg)
}
100% {
transform: rotate(360deg)
}
}

View File

@ -34,4 +34,8 @@ export class ChartUtils {
'value': value2 'value': value2
}]; }];
} }
public static isOneMinuteAhead(entryDate: Date, tmpData: any): boolean {
return entryDate.getTime() >= tmpData[0].series[tmpData[0].series.length - 1].name.getTime() + 60000;
}
} }

View File

@ -28,6 +28,10 @@
"stats.fraction.select.stabilize": "Stabilisiert", "stats.fraction.select.stabilize": "Stabilisiert",
"stats.fraction.select.flag": "Flaggenbesitz", "stats.fraction.select.flag": "Flaggenbesitz",
"stats.fraction.select.player.count": "Spieleranzahl", "stats.fraction.select.player.count": "Spieleranzahl",
"stats.fraction.tooltip.flag.minute": "Minute",
"stats.fraction.tooltip.flag.flag": "Flagge",
"stats.fraction.tooltip.flag.safe": "Gesichert",
"stats.fraction.tooltip.flag.lost": "Verloren",
"stats.performance.select.single.avg": "Spieler FPS Durchschnitt", "stats.performance.select.single.avg": "Spieler FPS Durchschnitt",
"stats.performance.select.single.min": "Spieler FPS Minimum", "stats.performance.select.single.min": "Spieler FPS Minimum",

View File

@ -36,6 +36,10 @@
"stats.fraction.select.stabilize": "Stabilized", "stats.fraction.select.stabilize": "Stabilized",
"stats.fraction.select.flag": "Flag Possession", "stats.fraction.select.flag": "Flag Possession",
"stats.fraction.select.player.count": "Player Count", "stats.fraction.select.player.count": "Player Count",
"stats.fraction.tooltip.flag.minute": "Minute",
"stats.fraction.tooltip.flag.flag": "Flag",
"stats.fraction.tooltip.flag.safe": "Safe",
"stats.fraction.tooltip.flag.lost": "Lost",
"stats.performance.select.single.avg": "Player FPS Average", "stats.performance.select.single.avg": "Player FPS Average",
"stats.performance.select.single.min": "Player FPS Minimum", "stats.performance.select.single.min": "Player FPS Minimum",

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="70px" height="70px" version="1.1" viewBox="0 0 70 70" xmlns="http://www.w3.org/2000/svg">
<path d="m0.25 34.88c0-3.06 0.25-6.77 0.94-9.69 2.43-10.28 12.69-20.77 22.75-23.75 3.65-1.09 5.7-0.92 11.12-1.19 3.64 0.02 10.15 0.2 16.63 3.81 2.22 1.24 8 5.32 10.31 7.44 1.69-1.38 6.06-6.12 8-7.5l-0.06 21.75s-22.13 0.37-22.13 0.37 7.13-7.31 7.13-7.31c-5.69-4.69-10.77-8.5-17.94-9.33-3.4-0.4-8.56-1.04-15 2.96-5.63 3.87-7.5 5.87-10.38 10.87-2.75 6.88-2.18 8.94-2.62 11.69l-8.75-0.12zm-0.25 8.12m69.75-7.88c0 3.06-0.25 6.77-0.94 9.69-2.43 10.28-12.69 20.77-22.75 23.75-3.65 1.09-5.7 0.92-11.12 1.19-3.64-0.02-10.15-0.2-16.63-3.81-2.22-1.24-8-5.32-10.31-7.44-1.69 1.38-6.06 6.12-8 7.5l0.06-21.75s22.13-0.37 22.13-0.37-7.13 7.31-7.13 7.31c5.69 4.69 10.77 8.5 17.94 9.33 3.4 0.4 8.56 1.04 15-2.96 5.62-3.87 7.5-5.87 10.38-10.87 2.74-6.88 2.18-8.94 2.62-11.69l8.75 0.12zm0.25-8.12"/>
</svg>

Before

Width:  |  Height:  |  Size: 929 B

View File

@ -0,0 +1 @@
<svg width="2.3in" height="2.2in" version="1.1" viewBox="0 0 168 160" xmlns="http://www.w3.org/2000/svg"><path id="Selection" d="m85 4c5.5 42 15 65 26 104 5-1.7 9.1-2.7 13-7 4.1-5.2 3.1-12 2.1-18-1.8-11-14-34-20-44-3-4.8-6.6-9.5-8.3-15 0 0-0.39-1.6 1-1 6.8 3.5 16 17 21 23 13 18 28 44 28 66-0.13 7.5-1.5 9-3 11-2.5 2.6-3.3 2.6-11 1.7l-20-4.7c0 6.8 0.47 12-2.3 18-7.6 18-28 23-41 8.8-7.8-7.7-10-18-10-29-4.8 2.2-9.8 4.2-15 5.3-8 1.8-21 3.4-24-6.3-0.81-2.3-0.76-5.6-0.71-8 0.48-21 18-50 31-66 4.8-6.2 12-17 19-19-1.7 5.4-5.3 10-8.3 15l-6.5 11c-6.5 11-14 27-15 40-0.56 7.9 3.2 14 11 17 3.3 1.1 5.6 1.2 9 1.2 0-8.2 0.04-13 3.1-21 0.76-2 2.3-5.8 4.3-6.8 4.2-2.1 5 9.4 5.5 12 3 15 7.8 30 16 43l-8.6-31c-6.2-22-11-51-7.2-73 1.7-9.8 3.9-19 9.8-27 0.19-0.31 2.6-2.9 3 0z"/></svg>

After

Width:  |  Height:  |  Size: 771 B