From 10a9c9606112c0412fa948974998e477404e39da Mon Sep 17 00:00:00 2001 From: AlecM33 Date: Wed, 14 Dec 2022 20:54:48 -0500 Subject: [PATCH] lower minimum playercount --- README.md | 8 ++++---- .../src/modules/game_creation/GameCreationStepManager.js | 8 +++++--- server/model/Game.js | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 1704728..9fab6c4 100644 --- a/README.md +++ b/README.md @@ -76,12 +76,12 @@ commands defined in `package.json`. If you simply want to run the app on the default port of **5000**: -`npm start:dev` (if developing on a linux machine)
-`npm start:dev:windows` (if developing on a windows machine) +`npm run start:dev` (if developing on a linux machine)
+`npm run start:dev:windows` (if developing on a windows machine) This command uses nodemon to listen for changes to **server-side code** (Node.js modules) and automatically restart the server. If you do not want -this, run instead `npm start:dev:no-hot-reload` or `npm start:dev:windows:no-hot-reload`. +this, run instead `npm run start:dev:no-hot-reload` or `npm run start:dev:windows:no-hot-reload`. If you are making changes to client-side javascript, in a separate terminal, execute `npm build:dev`. This uses Webpack to bundle javascript from the `client/src` directory and place it in the `client/dist` directory, which is ignored by Git. @@ -131,7 +131,7 @@ Have a question that isn't covered here? Email me at Jasmine. End-to-end tests are run using Karma. -Execute all tests by running `npm test`. Execute unit tests by running `npm test:unit`. Execute end-to-end tests by running `npm test:e2e`. +Execute all tests by running `npm run test`. Execute unit tests by running `npm run test:unit`. Execute end-to-end tests by running `npm run test:e2e`. Unit tests map 1:1 to the application directory structure - i.e. unit tests for `server/modules/GameManager` are found in `spec/unit/server/modules/GameManager_Spec.js` diff --git a/client/src/modules/game_creation/GameCreationStepManager.js b/client/src/modules/game_creation/GameCreationStepManager.js index 8aa88dc..e9a8dc4 100644 --- a/client/src/modules/game_creation/GameCreationStepManager.js +++ b/client/src/modules/game_creation/GameCreationStepManager.js @@ -36,14 +36,16 @@ export class GameCreationStepManager { 2: { title: 'Create your deck of cards:', forwardHandler: () => { - if (this.deckManager.getDeckSize() >= 3 && this.deckManager.getDeckSize() <= 50) { + if (this.deckManager.getDeckSize() > 50) { + toast('Your deck is too large. The max is 50 cards.', 'error', true); + } else if (this.deckManager.getDeckSize() < 1) { + toast('You must add at least one card', 'error', true); + } else { this.currentGame.deck = this.deckManager.deck.filter((card) => card.quantity > 0); cancelCurrentToast(); this.removeStepElementsFromDOM(this.step); this.incrementStep(); this.renderStep('creation-step-container', this.step); - } else { - toast('You must have a deck for between 3 and 50 players', 'error', true); } }, backHandler: this.defaultBackHandler diff --git a/server/model/Game.js b/server/model/Game.js index c6a5bcc..cd1be2f 100644 --- a/server/model/Game.js +++ b/server/model/Game.js @@ -25,7 +25,7 @@ class Game { this.originalModeratorId = originalModeratorId; this.createTime = createTime; this.timerParams = timerParams; - this.isFull = false; + this.isFull = this.gameSize === 1 && !this.hasDedicatedModerator; this.timeRemaining = null; this.spectators = []; }