Skip to content
Snippets Groups Projects
Commit 9b724314 authored by Samuli Virtapohja's avatar Samuli Virtapohja
Browse files

score folder audited

parent 7cfed59c
No related branches found
No related tags found
2 merge requests!59Development to master,!58Development to testing
import {
Entity,
PrimaryGeneratedColumn,
Column,
ManyToOne,
Timestamp,
CreateDateColumn,
} from 'typeorm';
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne } from 'typeorm';
import { FactionEntity } from '../faction/faction.entity';
@Entity('Score')
......
import {
Injectable,
HttpException,
HttpStatus,
Logger,
OnModuleInit,
} from '@nestjs/common';
import { Injectable, HttpException, HttpStatus } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
......@@ -57,6 +51,7 @@ export class ScoreService {
};
}
// function to run on timer tick
async scoreTick(gameId) {
// get game's flagboxes
const flagboxes = await this.flagRepository.find({ game: gameId });
......@@ -110,7 +105,6 @@ export class ScoreService {
});
//if score was found, put info to scores array
if (score.faction) {
let index = await scores.findIndex(i => i.faction === score.faction);
scores.push(score);
}
}),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment