further redis effort

This commit is contained in:
AlecM33
2023-01-12 18:07:33 -05:00
parent a0607d2c9a
commit 91fbed7859
16 changed files with 452 additions and 413 deletions

View File

@@ -5,7 +5,7 @@ class Game {
people,
deck,
hasTimer,
moderator,
currentModeratorId,
hasDedicatedModerator,
originalModeratorId,
createTime,
@@ -13,7 +13,7 @@ class Game {
) {
this.accessCode = accessCode;
this.status = status;
this.moderator = moderator;
this.currentModeratorId = currentModeratorId;
this.people = people;
this.deck = deck;
this.gameSize = deck.reduce(
@@ -23,11 +23,11 @@ class Game {
this.hasTimer = hasTimer;
this.hasDedicatedModerator = hasDedicatedModerator;
this.originalModeratorId = originalModeratorId;
this.previousModeratorId = null;
this.createTime = createTime;
this.timerParams = timerParams;
this.isFull = this.gameSize === 1 && !this.hasDedicatedModerator;
this.timeRemaining = null;
this.spectators = [];
}
}

View File

@@ -1,4 +1,6 @@
// noinspection DuplicatedCode
const globals = require('../config/globals');
class Person {
constructor (id, cookie, name, userType, gameRole = null, gameRoleDescription = null, alignment = null, assigned = false) {
this.id = id;
@@ -10,7 +12,8 @@ class Person {
this.gameRoleDescription = gameRoleDescription;
this.alignment = alignment;
this.assigned = assigned;
this.out = false;
this.out = userType === globals.USER_TYPES.MODERATOR || userType === globals.USER_TYPES.SPECTATOR;
this.killed = false;
this.revealed = false;
this.hasEnteredName = false;
}