This closes feature request 0000020. Attention, this breaks protocol compatibility.

This commit is contained in:
Max-Wilhelm Bruker
2010-06-03 02:29:48 +02:00
parent cfd715cce9
commit 41c4603fe9
12 changed files with 87 additions and 13 deletions

View File

@@ -365,6 +365,8 @@ ResponseCode Server_ProtocolHandler::cmdSetSideboardPlan(Command_SetSideboardPla
{
if (player->getSpectator())
return RespFunctionNotAllowed;
if (player->getReadyStart())
return RespContextError;
DeckList *deck = player->getDeck();
if (!deck)
@@ -385,7 +387,7 @@ ResponseCode Server_ProtocolHandler::cmdConcede(Command_Concede * /*cmd*/, Comma
return RespOk;
}
ResponseCode Server_ProtocolHandler::cmdReadyStart(Command_ReadyStart * /*cmd*/, CommandContainer *cont, Server_Game *game, Server_Player *player)
ResponseCode Server_ProtocolHandler::cmdReadyStart(Command_ReadyStart *cmd, CommandContainer *cont, Server_Game *game, Server_Player *player)
{
if (player->getSpectator())
return RespFunctionNotAllowed;
@@ -393,7 +395,10 @@ ResponseCode Server_ProtocolHandler::cmdReadyStart(Command_ReadyStart * /*cmd*/,
if (!player->getDeck())
return RespContextError;
player->setReadyStart(true);
if (player->getReadyStart() == cmd->getReady())
return RespContextError;
player->setReadyStart(cmd->getReady());
game->sendGameEvent(new Event_PlayerPropertiesChanged(player->getProperties()), new Context_ReadyStart);
game->startGameIfReady();
return RespOk;