Envoi de la position ennemie au début du jeu et mise à jour de la dernière position envoyée

This commit is contained in:
Sébastien Rivière
2025-05-31 17:11:29 +02:00
parent 27f365b694
commit 57254b0ff5
2 changed files with 6 additions and 1 deletions

View File

@@ -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);
}
},

View File

@@ -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)
});