Skip to content
Snippets Groups Projects
Commit 3d0060de authored by Ronnie Friman's avatar Ronnie Friman
Browse files

moved mockdata scoreticks

parent 4a16057a
No related branches found
No related tags found
3 merge requests!59Development to master,!54Development to testing,!50Mockdata replay
......@@ -57,7 +57,7 @@ export class ReplayService {
async replayData(gameId) {
//
// this block returs all player data from the game
// this block returns all player data from the game
//
let playerdata = await this.trackingRepository.find({
where: { game: gameId },
......@@ -78,7 +78,7 @@ export class ReplayService {
}),
);
//
// this block return all faction data from the game
// this block returns all faction data from the game
//
let factions = await this.factionRepository.find({ game: gameId });
let currentFactions = factions.map(faction => {
......@@ -111,7 +111,6 @@ export class ReplayService {
);
}),
);
console.log(currentScore);
return {
players: currentdata,
......@@ -137,6 +136,7 @@ export class ReplayService {
const LAT = 62.24147;
const LNG = 25.72088;
// set the score tick amount
// not used at the moment
const SCORE_TICKS = 10;
// setup the arrays for users, gamepersons and groups
const users = [];
......@@ -195,6 +195,9 @@ export class ReplayService {
for (let i = 1; i < USER_LOCATIONS + 1; i++) {
let date: number = Date.now();
let x = 1;
// score ticks with players to sync them
await this.scoreService.scoreTick(gameId);
// add location entry for each gameperson
await Promise.all(
gamepersons.map(async gameperson => {
// format player locations with x-modifier that same factions are closer to each other
......@@ -214,10 +217,6 @@ export class ReplayService {
}),
);
}
// generate x-amount of score tick
for (let i = 0; i < SCORE_TICKS; i++) {
await this.scoreService.scoreTick(gameId);
}
return {
message: 'all done',
......
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