Added placement zones

This commit is contained in:
Sebastien Riviere
2025-09-07 17:24:29 +02:00
parent 93f9a05b1a
commit 75f8b10ecd
17 changed files with 436 additions and 201 deletions

View File

@@ -75,9 +75,14 @@ export function initAdminSocketHandler() {
game.reorderTeams(newOrder);
});
socket.on("capture_team", (teamId, newTeam) => {
socket.on("capture_team", (teamId) => {
if (!loggedIn) return;
game.captureTeam(teamId, newTeam);
game.captureTeam(teamId);
});
socket.on("placement_team", (teamId, placementZone) => {
if (!loggedIn) return;
game.placementTeam(teamId, placementZone);
});
socket.on("change_state", (state) => {

View File

@@ -114,6 +114,7 @@ export default {
team.finishDate = null;
sendUpdatedTeamInformations(team.id);
}
this.updateChasingChain();
secureAdminBroadcast("teams", this.teams);
},
@@ -317,6 +318,19 @@ export default {
return true;
},
placementTeam(teamId, placementZone) {
// Test of parameters
if (!this.hasTeam(teamId)) return false;
// Variables
const team = this.getTeam(teamId);
// Make the capture
team.startingArea = placementZone;
// Broadcast new infos
secureAdminBroadcast("teams", this.teams);
sendUpdatedTeamInformations(team.id);
return true;
},
reorderTeams(newOrder) {
// Update teams
const teamMap = new Map(this.teams.map(team => [team.id, team]));