redesign how players are added and how cards are dealt

This commit is contained in:
AlecM33
2023-08-03 18:08:33 -04:00
parent 24ae53209f
commit bcfb0afdd1
6 changed files with 118 additions and 143 deletions

View File

@@ -82,7 +82,8 @@ router.patch('/:code/players', async function (req, res) {
gameManager.joinGame(game, req.body.playerName, inUseCookie, req.body.joinAsSpectator).then((data) => {
res.status(200).send({ cookie: data, environment: gameManager.environment });
}).catch((data) => {
res.status(data.status).send(data.reason);
console.error(data);
res.status(data.status || 500).send(data.reason);
});
} else {
res.status(404).send();