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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user