mirror of
https://github.com/AlecM33/Werewolf.git
synced 2025-12-26 07:47:50 +01:00
send existing cookie on join call
This commit is contained in:
@@ -254,7 +254,11 @@ class GameManager {
|
||||
}
|
||||
};
|
||||
|
||||
joinGame = (game, name) => {
|
||||
joinGame = (game, name, cookie) => {
|
||||
const matchingPerson = findPersonByField(game, 'cookie', cookie);
|
||||
if (matchingPerson) {
|
||||
return Promise.resolve(matchingPerson.cookie);
|
||||
}
|
||||
if (isNameTaken(game, name)) {
|
||||
return Promise.reject(400);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user