Tools - random number function is now static. Fixed player number issue with network games (GUI player number needs to be 0), this still requires some work.

This commit is contained in:
lotodore
2007-05-21 19:00:06 +00:00
parent 3ede810baa
commit 2ce67297ee
17 changed files with 129 additions and 100 deletions
+5 -2
View File
@@ -391,10 +391,11 @@ ClientStateWaitSession::Process(ClientThread &client)
NetPacketJoinGameAck::Data joinGameAckData;
tmpPacket->ToNetPacketJoinGameAck()->GetData(joinGameAckData);
client.SetGameData(joinGameAckData.gameData);
client.SetGuiPlayerNum(joinGameAckData.yourPlayerNum);
// TODO: Type Human is fixed here.
boost::shared_ptr<PlayerData> playerData(
new PlayerData(joinGameAckData.gameData.guiPlayerUniqueId, joinGameAckData.gameData.guiPlayerNum, PLAYER_TYPE_HUMAN));
new PlayerData(joinGameAckData.yourPlayerUniqueId, joinGameAckData.yourPlayerNum, PLAYER_TYPE_HUMAN));
playerData->SetName(context.GetPlayerName());
client.AddPlayerData(playerData);
@@ -512,7 +513,9 @@ ClientStateWaitHand::Process(ClientThread &client)
int myCards[2];
myCards[0] = (int)tmpData.yourCards[0];
myCards[1] = (int)tmpData.yourCards[1];
client.GetGame()->getPlayerArray()[client.GetGame()->getGuiPlayerNum()]->setMyCards(myCards);
client.GetGame()->getPlayerArray()[0]->setMyCards(myCards);
client.GetGame()->initHand();
client.GetGame()->startHand();
client.GetGui().dealHoleCards();
}
}