mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-09 02:10:18 +01:00
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:
@@ -252,6 +252,11 @@ export default {
|
|||||||
for (let team of this.teams) {
|
for (let team of this.teams) {
|
||||||
team.lastSentLocation = team.currentLocation;
|
team.lastSentLocation = team.currentLocation;
|
||||||
team.locationSendDeadline = Number(new Date()) + penaltyController.settings.allowedTimeBetweenPositionUpdate * 60 * 1000;
|
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);
|
sendUpdatedTeamInformations(team.id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ export function initTeamSocket() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
game.updateTeamChasing();
|
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")
|
teamBroadcast(teamId, "success", "Position udpated")
|
||||||
secureAdminBroadcast("teams", game.teams)
|
secureAdminBroadcast("teams", game.teams)
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user