fix no faction war submit 500
parent
a7412af2ef
commit
4d72a7d02f
|
@ -82,7 +82,6 @@ wars.route('/')
|
||||||
if (err) {
|
if (err) {
|
||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
//TODO: combine run and clean in one script, so log file gets touched only once
|
|
||||||
exec(__dirname + '/../war-parser/run.sh ' + folderName + ' ' + war._id, (error, stdout) => {
|
exec(__dirname + '/../war-parser/run.sh ' + folderName + ' ' + war._id, (error, stdout) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
return next(error);
|
return next(error);
|
||||||
|
@ -93,7 +92,9 @@ wars.route('/')
|
||||||
}
|
}
|
||||||
let obj = JSON.parse(`${stdout}`);
|
let obj = JSON.parse(`${stdout}`);
|
||||||
for (let i = 0; i < obj.length; i++) {
|
for (let i = 0; i < obj.length; i++) {
|
||||||
if (obj[i].fraction === 'BLUFOR') {
|
if (!obj[i].fraction) {
|
||||||
|
obj.splice(i, 1);
|
||||||
|
} else if (obj[i].fraction === 'BLUFOR') {
|
||||||
war.playersBlufor++;
|
war.playersBlufor++;
|
||||||
} else {
|
} else {
|
||||||
war.playersOpfor++;
|
war.playersOpfor++;
|
||||||
|
|
Loading…
Reference in New Issue