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