Fixing gcc compiler warnings.
This commit is contained in:
@@ -1671,7 +1671,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
|
|||||||
isBigBlind = true;
|
isBigBlind = true;
|
||||||
} else { // no blind -> log
|
} else { // no blind -> log
|
||||||
if (netActionDone.playeraction()) {
|
if (netActionDone.playeraction()) {
|
||||||
assert(netActionDone.totalplayerbet() >= tmpPlayer->getMySet());
|
assert((int)netActionDone.totalplayerbet() >= tmpPlayer->getMySet());
|
||||||
client->GetGui().logPlayerActionMsg(
|
client->GetGui().logPlayerActionMsg(
|
||||||
tmpPlayer->getMyName(),
|
tmpPlayer->getMyName(),
|
||||||
netActionDone.playeraction(),
|
netActionDone.playeraction(),
|
||||||
@@ -1736,7 +1736,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
|
|||||||
throw ClientException(__FILE__, __LINE__, ERR_NET_UNKNOWN_PLAYER_ID, 0);
|
throw ClientException(__FILE__, __LINE__, ERR_NET_UNKNOWN_PLAYER_ID, 0);
|
||||||
|
|
||||||
// Set round.
|
// Set round.
|
||||||
if (curGame->getCurrentHand()->getCurrentRound() != netPlayersTurn.gamestate()) {
|
if (curGame->getCurrentHand()->getCurrentRound() != static_cast<GameState>(netPlayersTurn.gamestate())) {
|
||||||
ResetPlayerActions(*curGame);
|
ResetPlayerActions(*curGame);
|
||||||
curGame->getCurrentHand()->setCurrentRound(static_cast<GameState>(netPlayersTurn.gamestate()));
|
curGame->getCurrentHand()->setCurrentRound(static_cast<GameState>(netPlayersTurn.gamestate()));
|
||||||
client->GetClientLog()->setCurrentRound(static_cast<GameState>(netPlayersTurn.gamestate()));
|
client->GetClientLog()->setCurrentRound(static_cast<GameState>(netPlayersTurn.gamestate()));
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ ReceiveBuffer::ScanPackets()
|
|||||||
// several packets may be received at once.
|
// several packets may be received at once.
|
||||||
if (recvBufUsed >= NET_HEADER_SIZE) {
|
if (recvBufUsed >= NET_HEADER_SIZE) {
|
||||||
// Read the size of the packet (first 4 bytes in network byte order).
|
// Read the size of the packet (first 4 bytes in network byte order).
|
||||||
size_t packetSize = ntohl(*((uint32_t *)recvBuf));
|
size_t packetSize = ntohl(*((uint32_t *)&recvBuf[0]));
|
||||||
if (recvBufUsed >= packetSize + NET_HEADER_SIZE)
|
if (recvBufUsed >= packetSize + NET_HEADER_SIZE)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1420,7 +1420,7 @@ ServerGameStateWaitPlayerAction::InternalProcessPacket(boost::shared_ptr<ServerG
|
|||||||
|
|
||||||
// Check whether this is the correct round.
|
// Check whether this is the correct round.
|
||||||
PlayerActionCode code = ACTION_CODE_VALID;
|
PlayerActionCode code = ACTION_CODE_VALID;
|
||||||
if (curGame.getCurrentHand()->getCurrentRound() != netMyAction->gamestate())
|
if (curGame.getCurrentHand()->getCurrentRound() != static_cast<GameState>(netMyAction->gamestate()))
|
||||||
code = ACTION_CODE_INVALID_STATE;
|
code = ACTION_CODE_INVALID_STATE;
|
||||||
|
|
||||||
// Check whether this is the correct player.
|
// Check whether this is the correct player.
|
||||||
@@ -1431,13 +1431,13 @@ ServerGameStateWaitPlayerAction::InternalProcessPacket(boost::shared_ptr<ServerG
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If the client omitted some values, fill them in.
|
// If the client omitted some values, fill them in.
|
||||||
if (netMyAction->myaction() == PLAYER_ACTION_CALL && netMyAction->myrelativebet() == 0) {
|
if (netMyAction->myaction() == actionCall && netMyAction->myrelativebet() == 0) {
|
||||||
if (curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet() >= tmpPlayer->getMySet() + tmpPlayer->getMyCash())
|
if (curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet() >= tmpPlayer->getMySet() + tmpPlayer->getMyCash())
|
||||||
netMyAction->set_myaction(actionAllIn);
|
netMyAction->set_myaction(actionAllIn);
|
||||||
else
|
else
|
||||||
netMyAction->set_myrelativebet(curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet() - tmpPlayer->getMySet());
|
netMyAction->set_myrelativebet(curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet() - tmpPlayer->getMySet());
|
||||||
}
|
}
|
||||||
if (netMyAction->myaction() == PLAYER_ACTION_ALLIN && netMyAction->myrelativebet() == 0)
|
if (netMyAction->myaction() == actionAllIn && netMyAction->myrelativebet() == 0)
|
||||||
netMyAction->set_myrelativebet(tmpPlayer->getMyCash());
|
netMyAction->set_myrelativebet(tmpPlayer->getMyCash());
|
||||||
|
|
||||||
// Check whether the action is valid.
|
// Check whether the action is valid.
|
||||||
|
|||||||
Reference in New Issue
Block a user