From 57254b0ff5aceaa2f42235464514cc98df16f431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rivi=C3=A8re?= Date: Sat, 31 May 2025 17:11:29 +0200 Subject: [PATCH] =?UTF-8?q?Envoi=20de=20la=20position=20ennemie=20au=20d?= =?UTF-8?q?=C3=A9but=20du=20jeu=20et=20mise=20=C3=A0=20jour=20de=20la=20de?= =?UTF-8?q?rni=C3=A8re=20position=20envoy=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- traque-back/game.js | 5 +++++ traque-back/team_socket.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/traque-back/game.js b/traque-back/game.js index 7a7b6d1..6fe5b74 100644 --- a/traque-back/game.js +++ b/traque-back/game.js @@ -252,6 +252,11 @@ export default { for (let team of this.teams) { team.lastSentLocation = team.currentLocation; team.locationSendDeadline = Number(new Date()) + penaltyController.settings.allowedTimeBetweenPositionUpdate * 60 * 1000; + this.getTeam(team.chasing).enemyLocation = team.lastSentLocation; + sendUpdatedTeamInformations(team.id); + } + for (let team of this.teams) { + team.enemyLocation = this.getTeam(team.chasing).lastSentLocation; sendUpdatedTeamInformations(team.id); } }, diff --git a/traque-back/team_socket.js b/traque-back/team_socket.js index 479a718..dcec1a1 100644 --- a/traque-back/team_socket.js +++ b/traque-back/team_socket.js @@ -131,7 +131,7 @@ export function initTeamSocket() { return; } game.updateTeamChasing(); - teamBroadcast(teamId, "update_team", { enemyLocation: team.enemyLocation, locationSendDeadline: team.locationSendDeadline }); + teamBroadcast(teamId, "update_team", { enemyLocation: team.enemyLocation, locationSendDeadline: team.locationSendDeadline, lastSentLocation: team.lastSentLocation }); teamBroadcast(teamId, "success", "Position udpated") secureAdminBroadcast("teams", game.teams) });