mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-09 18:20:17 +01:00
send zone info on socket connexion
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { secureAdminBroadcast } from "./admin_socket.js";
|
||||
import { penaltyController } from "./index.js";
|
||||
import { isInCircle } from "./map_utils.js";
|
||||
import { playersBroadcast, sendUpdatedTeamInformations } from "./team_socket.js";
|
||||
@@ -38,6 +39,14 @@ export default class Game {
|
||||
this.zone.reset();
|
||||
penaltyController.stop();
|
||||
}
|
||||
//Game reset
|
||||
if(newState == GameState.SETUP) {
|
||||
for(let team of this.teams) {
|
||||
team.penalties = 0;
|
||||
team.captured = false;
|
||||
}
|
||||
this.updateTeamChasing();
|
||||
}
|
||||
this.state = newState;
|
||||
return true;
|
||||
}
|
||||
@@ -111,6 +120,7 @@ export default class Game {
|
||||
this.getTeam(firstTeam).chased = previousTeam;
|
||||
this.getTeam(previousTeam).chasing = firstTeam;
|
||||
this.getTeam(previousTeam).enemyName = this.getTeam(firstTeam).name;
|
||||
secureAdminBroadcast("teams", this.teams)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user