diff --git a/api/models/player.js b/api/models/player.js index 9fbad1b..fcf4b07 100644 --- a/api/models/player.js +++ b/api/models/player.js @@ -36,6 +36,12 @@ const PlayerSchema = new Schema({ set: v => Math.round(v), required: true }, + revive: { + type: Number, + get: v => Math.round(v), + set: v => Math.round(v), + required: true + }, respawn: { type: Number, get: v => Math.round(v), @@ -46,7 +52,7 @@ const PlayerSchema = new Schema({ type: Number, get: v => Math.round(v), set: v => Math.round(v), - default: 0 + required: true } }, { collection: 'player', diff --git a/api/models/war.js b/api/models/war.js index e0b8de7..ad0cd43 100644 --- a/api/models/war.js +++ b/api/models/war.js @@ -35,11 +35,6 @@ const WarSchema = new Schema({ get: v => Math.round(v), set: v => Math.round(v), default: 0 - }, - bestPlayerId: { - type: mongoose.Schema.Types.ObjectId, - ref: 'Player', - default: null } }, { collection: 'war', diff --git a/api/war-parser/clean.sh b/api/war-parser/clean.sh index 7f7ed42..fb31374 100755 --- a/api/war-parser/clean.sh +++ b/api/war-parser/clean.sh @@ -4,7 +4,7 @@ FILE="$1/war.log" while IFS='' read -r line || [[ -n "$line" ]]; do case "$line" in - *"Budget"* | *"Mission"* | *"Abschuss"* | *"Respawn"* | *"Punkte"* | *"Flagge"*) + *"Budget"* | *"Mission"* | *"Abschuss"* | *"Respawn"* | *"Punkte"* | *"Flagge"* | *"Revive"*) echo $line; echo "" ;; diff --git a/api/war-parser/run.sh b/api/war-parser/run.sh index ce40067..12ec658 100755 --- a/api/war-parser/run.sh +++ b/api/war-parser/run.sh @@ -7,6 +7,7 @@ createScoreboard() { KILL=0 FF=0 + REVIVE=0 DEATH=0 RESPAWN=0 FLAG=0 @@ -23,6 +24,9 @@ createScoreboard() { *\(EAST\)[" "]von:[" "]${ESC_NAME}[" "]\(EAST\)* | *\(WEST\)[" "]von:[" "]${ESC_NAME}[" "]\(WEST\)*) ((FF++)) ;; + *\(EAST\)[" "]wurde[" "]von[" "]${ESC_NAME}[" "]\(EAST\)[" "]wiederbelebt* | *\(WEST\)[" "]wurde[" "]von[" "]${ESC_NAME}[" "]\(WEST\)[" "]wiederbelebt*) + ((REVIVE++)) + ;; *${ESC_NAME}[" "]*von:*) ((DEATH++)) ;; @@ -42,7 +46,7 @@ createScoreboard() { fi done < <(grep -- "${ESC_NAME}" ${FILE}) - printf "\t{\"name\":\"$NAME\", \"fraction\":\"$FRACTION\", \"kill\":${KILL}, \"friendlyFire\":${FF}, \"death\":${DEATH}, \"respawn\":${RESPAWN}, \"flagTouch\":${FLAG}, \"warId\":\"${WAR_ID}\"} " + printf "\t{\"name\":\"$NAME\", \"fraction\":\"$FRACTION\", \"kill\":${KILL}, \"friendlyFire\":${FF}, \"revive\":${REVIVE}, \"death\":${DEATH}, \"respawn\":${RESPAWN}, \"flagTouch\":${FLAG}, \"warId\":\"${WAR_ID}\"} " if [[ -z ${4} ]]; then printf ",\n" else diff --git a/minify.sh b/minify.sh index 57adc87..18454d0 100755 --- a/minify.sh +++ b/minify.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# execute script in its location folder +cd $(dirname $0) + # array of files to minify FILES=(inline main polyfills scripts styles vendor) OPTIONS="-c toplevel,dead_code=true,unused=true" diff --git a/package.json b/package.json index dd81bac..cb794c5 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,7 @@ "start": "npm run deploy-static-prod && npm start --prefix ./api", "dev": "npm run deploy-static && npm run dev --prefix ./api", "deploy-static": "cd ./static && $(npm bin)/ng build && ln -s ../api/resource/ ../public/resource", - "deploy-static-prod": "cd ./static && $(npm bin)/ng build --env=prod && ln -s ../api/resource/ ../public/resource && cd .. && npm run deploy-minify", - "deploy-minify": "./minify.sh", + "deploy-static-prod": "cd ./static && $(npm bin)/ng build --env=prod && ln -s ../api/resource/ ../public/resource && .././minify.sh", "postinstall": "npm install --prefix ./static && npm install --prefix ./api", "mongodb": "mkdir -p mongodb-data && mongod --dbpath ./mongodb-data", "test": "npm test --prefix ./api", diff --git a/static/src/app/models/model-interfaces.ts b/static/src/app/models/model-interfaces.ts index cfc4ca3..4f564af 100644 --- a/static/src/app/models/model-interfaces.ts +++ b/static/src/app/models/model-interfaces.ts @@ -24,6 +24,7 @@ export interface Player { kill?: number; death?: number; friendlyFire?: number; + revive?: number; respawn?: number; flagTouch?: number; } @@ -35,7 +36,6 @@ export interface War { ptOpfor?: number; playersBlufor?: number; playersOpfor?: number; - bestPlayerId?: Player; players: Player[]; } diff --git a/static/src/app/wars/war-detail.component.css b/static/src/app/wars/war-detail.component.css index bc262ad..b96dc82 100644 --- a/static/src/app/wars/war-detail.component.css +++ b/static/src/app/wars/war-detail.component.css @@ -22,11 +22,9 @@ .scoreboard-table-container { min-width: 920px; max-width: 920px; - margin-left: 5% } .table-container { - margin-top: 10px; overflow-x: auto; } diff --git a/static/src/app/wars/war-detail.component.html b/static/src/app/wars/war-detail.component.html index aa00c49..83759d4 100644 --- a/static/src/app/wars/war-detail.component.html +++ b/static/src/app/wars/war-detail.component.html @@ -1,7 +1,7 @@
- |
- |
+
+ |
| {{player.friendlyFire}} | ++ {{player.revive}} + | {{player.flagTouch}} |
---|