mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Support starting games with fewer than max players (#5338)
This commit is contained in:
parent
956c12eb32
commit
6dfd354973
6 changed files with 50 additions and 16 deletions
|
|
@ -944,7 +944,7 @@ Server_Player::cmdReadyStart(const Command_ReadyStart &cmd, ResponseContainer &
|
|||
return Response::RespContextError;
|
||||
}
|
||||
|
||||
if (readyStart == cmd.ready()) {
|
||||
if (readyStart == cmd.ready() && !cmd.force_start()) {
|
||||
return Response::RespContextError;
|
||||
}
|
||||
|
||||
|
|
@ -955,8 +955,13 @@ Server_Player::cmdReadyStart(const Command_ReadyStart &cmd, ResponseContainer &
|
|||
ges.enqueueGameEvent(event, playerId);
|
||||
ges.setGameEventContext(Context_ReadyStart());
|
||||
|
||||
if (cmd.ready()) {
|
||||
game->startGameIfReady();
|
||||
if (cmd.force_start()) {
|
||||
if (game->getHostId() != playerId) {
|
||||
return Response::RespFunctionNotAllowed;
|
||||
}
|
||||
game->startGameIfReady(true);
|
||||
} else if (cmd.ready()) {
|
||||
game->startGameIfReady(false);
|
||||
}
|
||||
|
||||
return Response::RespOk;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue