Automatic action when for player timeout. First try, not finished yet.
This commit is contained in:
@@ -638,6 +638,8 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
||||
client.GetGui().refreshGroupbox(tmpPlayer->getMyID(), 3);
|
||||
|
||||
// Refresh GUI
|
||||
if (tmpPlayer->getMyID() == 0)
|
||||
client.GetGui().disableMyButtons();
|
||||
client.GetGui().refreshPot();
|
||||
client.GetGui().refreshSet();
|
||||
client.GetGui().refreshAction();
|
||||
|
||||
@@ -39,6 +39,7 @@ using namespace std;
|
||||
#define SERVER_DEAL_RIVER_CARD_DELAY_SEC 2
|
||||
#define SERVER_DEAL_ADD_ALL_IN_DELAY_SEC 1
|
||||
#define SERVER_SHOW_CARDS_DELAY_SEC 2
|
||||
#define SERVER_PLAYER_TIMEOUT_ADD_DELAY_SEC 2
|
||||
|
||||
// Helper functions
|
||||
// TODO: these are hacks.
|
||||
@@ -728,6 +729,14 @@ ServerRecvStateWaitPlayerAction::Process(ServerRecvThread &server)
|
||||
server.SetState(ServerRecvStateStartRound::Instance());
|
||||
retVal = MSG_NET_GAME_SERVER_ACTION;
|
||||
}
|
||||
else if (GetTimer().elapsed().seconds() >= server.GetGameData().playerActionTimeoutSec + SERVER_PLAYER_TIMEOUT_ADD_DELAY_SEC)
|
||||
{
|
||||
// Player did not act fast enough. Act for him.
|
||||
PerformPlayerAction(server, tmpPlayer, PLAYER_ACTION_FOLD, 0);
|
||||
|
||||
server.SetState(ServerRecvStateStartRound::Instance());
|
||||
retVal = MSG_NET_GAME_SERVER_ACTION;
|
||||
}
|
||||
else
|
||||
retVal = ServerRecvStateReceiving::Process(server);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user