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

insert initial status to objectivepoint_history

parent 99f6b11e
No related branches found
No related tags found
3 merge requests!59Development to master,!58Development to testing,!55Flagbox replay
...@@ -141,6 +141,13 @@ export class GameService { ...@@ -141,6 +141,13 @@ export class GameService {
game: gameId, game: gameId,
}); });
await this.objectivePointRepository.save(newFlagbox); await this.objectivePointRepository.save(newFlagbox);
// create base status for flagbox
this.flagboxEvent(gameId, {
node_id: flagbox.objectivePointDescription,
owner: 0,
action: 0,
capture: 0,
});
}); });
} else { } else {
await this.objectivePointRepository.delete({ game: id }); await this.objectivePointRepository.delete({ game: id });
...@@ -289,7 +296,7 @@ export class GameService { ...@@ -289,7 +296,7 @@ export class GameService {
const objectiveRef = await this.objectivePointRepository.findOne({ const objectiveRef = await this.objectivePointRepository.findOne({
where: { objectivePointDescription: data.node_id, game: gameId }, where: { objectivePointDescription: data.node_id, game: gameId },
}); });
data.oP_HistoryTimestamp = new Date(Date.now()).toLocaleString(); data.oP_HistoryTimestamp = Date.now();
const eventUpdate = await this.objectivePoint_HistoryRepository.create({ const eventUpdate = await this.objectivePoint_HistoryRepository.create({
oP_HistoryTimestamp: data.oP_HistoryTimestamp, oP_HistoryTimestamp: data.oP_HistoryTimestamp,
action: data.action, action: data.action,
......
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