Skip to content

Commit

Permalink
feat: Add ended field
Browse files Browse the repository at this point in the history
  • Loading branch information
Sup3rFire committed Jan 28, 2024
1 parent 497ed6d commit 2c9f85e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/game/Game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export default class Game extends EventEmitter {
if (me_) this.me = new ClientPlayer(ws, me_);
}

public ended = false;

public me?: ClientPlayer;

public players: Map<string, Player>;
Expand Down
2 changes: 2 additions & 0 deletions src/ws/commands/game.end.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export default async function (ws: WebSocketManager, { data }: any) {
});
});

ws.client.room.game.ended = true;

ws.client.room.game.emit("score", leaderboard, victor);

ws.client.room.game.me?.end();
Expand Down

0 comments on commit 2c9f85e

Please sign in to comment.