Fixed id bug in networking code. Dealer id is now set correctly. Phew.

This commit is contained in:
lotodore
2007-05-22 23:27:21 +00:00
parent b83c86d887
commit 2e12f1bc25
7 changed files with 106 additions and 84 deletions
+24 -24
View File
@@ -291,33 +291,33 @@ ServerRecvStateStartHand::Process(ServerRecvThread &server)
// Auto small blind / big blind at the beginning of preflop.
for (int i = 0; i < curGame.getActualQuantityPlayers(); i++)
{
if(playerArray[i]->getMyButton() == BUTTON_SMALL_BLIND)
{
boost::shared_ptr<NetPacket> notifySmallBlind(new NetPacketPlayersActionDone);
NetPacketPlayersActionDone::Data actionDoneData;
actionDoneData.gameState = GAME_STATE_PREFLOP_SMALL_BLIND;
actionDoneData.playerId = playerArray[i]->getMyUniqueID();
actionDoneData.playerAction = (PlayerAction)playerArray[i]->getMyAction();
actionDoneData.cashValue = playerArray[i]->getMySet();
static_cast<NetPacketPlayersActionDone *>(notifySmallBlind.get())->SetData(actionDoneData);
server.SendToAllPlayers(notifySmallBlind);
break;
}
if(playerArray[i]->getMyButton() == BUTTON_SMALL_BLIND)
{
boost::shared_ptr<NetPacket> notifySmallBlind(new NetPacketPlayersActionDone);
NetPacketPlayersActionDone::Data actionDoneData;
actionDoneData.gameState = GAME_STATE_PREFLOP_SMALL_BLIND;
actionDoneData.playerId = playerArray[i]->getMyUniqueID();
actionDoneData.playerAction = (PlayerAction)playerArray[i]->getMyAction();
actionDoneData.cashValue = playerArray[i]->getMySet();
static_cast<NetPacketPlayersActionDone *>(notifySmallBlind.get())->SetData(actionDoneData);
server.SendToAllPlayers(notifySmallBlind);
break;
}
}
for (int i = 0; i < curGame.getActualQuantityPlayers(); i++)
{
if(playerArray[i]->getMyButton() == BUTTON_BIG_BLIND)
{
boost::shared_ptr<NetPacket> notifyBigBlind(new NetPacketPlayersActionDone);
NetPacketPlayersActionDone::Data actionDoneData;
actionDoneData.gameState = GAME_STATE_PREFLOP_BIG_BLIND;
actionDoneData.playerId = playerArray[i]->getMyUniqueID();
actionDoneData.playerAction = (PlayerAction)playerArray[i]->getMyAction();
actionDoneData.cashValue = playerArray[i]->getMySet();
static_cast<NetPacketPlayersActionDone *>(notifyBigBlind.get())->SetData(actionDoneData);
server.SendToAllPlayers(notifyBigBlind);
break;
}
if(playerArray[i]->getMyButton() == BUTTON_BIG_BLIND)
{
boost::shared_ptr<NetPacket> notifyBigBlind(new NetPacketPlayersActionDone);
NetPacketPlayersActionDone::Data actionDoneData;
actionDoneData.gameState = GAME_STATE_PREFLOP_BIG_BLIND;
actionDoneData.playerId = playerArray[i]->getMyUniqueID();
actionDoneData.playerAction = (PlayerAction)playerArray[i]->getMyAction();
actionDoneData.cashValue = playerArray[i]->getMySet();
static_cast<NetPacketPlayersActionDone *>(notifyBigBlind.get())->SetData(actionDoneData);
server.SendToAllPlayers(notifyBigBlind);
break;
}
}
server.SetState(ServerRecvStateStartRound::Instance());