mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-09 02:10:18 +01:00
back end elimination
This commit is contained in:
@@ -18,7 +18,7 @@ export default class Game {
|
||||
return false;
|
||||
}
|
||||
//The game has started
|
||||
if(this.state == GameState.PLACEMENT && newState == GameState.PLAYING) {
|
||||
if(newState == GameState.PLAYING) {
|
||||
this.initLastSentLocations();
|
||||
}
|
||||
this.state = newState;
|
||||
|
||||
@@ -245,9 +245,10 @@ io.of("player").on("connection", (socket) => {
|
||||
});
|
||||
|
||||
socket.on('capture', (captureCode) => {
|
||||
let capturedTeam = game.getTeam(teamId).chasing
|
||||
if(game.capture(teamId, captureCode)) {
|
||||
sendUpdatedTeamInformations(teamId)
|
||||
sendUpdatedTeamInformations(game.getTeam(teamId).chasing)
|
||||
sendUpdatedTeamInformations(capturedTeam)
|
||||
secureBroadcast("teams", game.teams);
|
||||
}else {
|
||||
socket.emit("error", "Incorrect code")
|
||||
|
||||
Reference in New Issue
Block a user