mirror of
https://github.com/AlecM33/Werewolf.git
synced 2025-12-26 15:57:50 +01:00
refactor GameStateRenderer, split functionality by game state
This commit is contained in:
@@ -45,7 +45,7 @@ class SocketManager {
|
||||
};
|
||||
|
||||
registerHandlers = (namespace, socket, gameManager) => {
|
||||
socket.on(globals.SOCKET_EVENTS.IN_GAME_MESSAGE, async (eventId, accessCode, args, ackFn) => {
|
||||
socket.on(globals.SOCKET_EVENTS.IN_GAME_MESSAGE, async (eventId, accessCode, args=null, ackFn=null) => {
|
||||
const game = gameManager.activeGameRunner.activeGames.get(accessCode);
|
||||
if (game) {
|
||||
switch (eventId) {
|
||||
@@ -63,6 +63,7 @@ class SocketManager {
|
||||
break;
|
||||
case EVENT_IDS.START_GAME:
|
||||
gameManager.startGame(game, namespace);
|
||||
ackFn();
|
||||
break;
|
||||
case EVENT_IDS.PAUSE_TIMER:
|
||||
gameManager.pauseTimer(game, this.logger);
|
||||
@@ -91,6 +92,7 @@ class SocketManager {
|
||||
break;
|
||||
case EVENT_IDS.END_GAME:
|
||||
gameManager.endGame(game);
|
||||
ackFn();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user