First try for small blind / big blind before start of hand. There seems to be a problem with player ids or numbers, however.

This commit is contained in:
lotodore
2007-05-21 22:16:32 +00:00
parent 8f8a851500
commit 5744980d36
8 changed files with 210 additions and 8 deletions
+26 -1
View File
@@ -505,11 +505,11 @@ ClientStateWaitHand::Process(ClientThread &client)
if (tmpPacket.get())
{
// TODO: Hack
if (tmpPacket->ToNetPacketHandStart())
{
NetPacketHandStart::Data tmpData;
tmpPacket->ToNetPacketHandStart()->GetData(tmpData);
// TODO: Hack
int myCards[2];
myCards[0] = (int)tmpData.yourCards[0];
myCards[1] = (int)tmpData.yourCards[1];
@@ -518,6 +518,31 @@ ClientStateWaitHand::Process(ClientThread &client)
client.GetGame()->startHand();
client.GetGui().dealHoleCards();
}
else if (tmpPacket->ToNetPacketPlayersActionDone())
{
NetPacketPlayersActionDone::Data tmpData;
tmpPacket->ToNetPacketPlayersActionDone()->GetData(tmpData);
PlayerInterface *tmpPlayer = client.GetGame()->getPlayerByUniqueId(tmpData.playerId);
if (tmpPlayer)
{
if (tmpData.gameState == GAME_STATE_PREFLOP_SMALL_BLIND)
{
tmpPlayer->setMyButton(BUTTON_SMALL_BLIND);
tmpPlayer->setMyAction(tmpData.playerAction);
tmpPlayer->setMySet(tmpData.cashValue);
client.GetGui().refreshSet();
client.GetGui().refreshPot();
}
else if (tmpData.gameState == GAME_STATE_PREFLOP_BIG_BLIND)
{
tmpPlayer->setMyButton(BUTTON_BIG_BLIND);
tmpPlayer->setMyAction(tmpData.playerAction);
tmpPlayer->setMySet(tmpData.cashValue);
client.GetGui().refreshSet();
client.GetGui().refreshPot();
}
}
}
}
return MSG_SOCK_INTERNAL_PENDING;