diff --git a/src/net/common/clientstate.cpp b/src/net/common/clientstate.cpp index 768919a0..2b76ef3e 100644 --- a/src/net/common/clientstate.cpp +++ b/src/net/common/clientstate.cpp @@ -1671,7 +1671,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr client, isBigBlind = true; } else { // no blind -> log if (netActionDone.playeraction()) { - assert(netActionDone.totalplayerbet() >= tmpPlayer->getMySet()); + assert((int)netActionDone.totalplayerbet() >= tmpPlayer->getMySet()); client->GetGui().logPlayerActionMsg( tmpPlayer->getMyName(), netActionDone.playeraction(), @@ -1736,7 +1736,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr client, throw ClientException(__FILE__, __LINE__, ERR_NET_UNKNOWN_PLAYER_ID, 0); // Set round. - if (curGame->getCurrentHand()->getCurrentRound() != netPlayersTurn.gamestate()) { + if (curGame->getCurrentHand()->getCurrentRound() != static_cast(netPlayersTurn.gamestate())) { ResetPlayerActions(*curGame); curGame->getCurrentHand()->setCurrentRound(static_cast(netPlayersTurn.gamestate())); client->GetClientLog()->setCurrentRound(static_cast(netPlayersTurn.gamestate())); diff --git a/src/net/common/receivebuffer.cpp b/src/net/common/receivebuffer.cpp index c4285c93..3673f1f3 100644 --- a/src/net/common/receivebuffer.cpp +++ b/src/net/common/receivebuffer.cpp @@ -82,7 +82,7 @@ ReceiveBuffer::ScanPackets() // several packets may be received at once. if (recvBufUsed >= NET_HEADER_SIZE) { // 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) { try { diff --git a/src/net/common/servergamestate.cpp b/src/net/common/servergamestate.cpp index 9036d892..85b7b3d9 100644 --- a/src/net/common/servergamestate.cpp +++ b/src/net/common/servergamestate.cpp @@ -1420,7 +1420,7 @@ ServerGameStateWaitPlayerAction::InternalProcessPacket(boost::shared_ptrgetCurrentRound() != netMyAction->gamestate()) + if (curGame.getCurrentHand()->getCurrentRound() != static_cast(netMyAction->gamestate())) code = ACTION_CODE_INVALID_STATE; // Check whether this is the correct player. @@ -1431,13 +1431,13 @@ ServerGameStateWaitPlayerAction::InternalProcessPacket(boost::shared_ptrmyaction() == PLAYER_ACTION_CALL && netMyAction->myrelativebet() == 0) { + if (netMyAction->myaction() == actionCall && netMyAction->myrelativebet() == 0) { if (curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet() >= tmpPlayer->getMySet() + tmpPlayer->getMyCash()) netMyAction->set_myaction(actionAllIn); else 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()); // Check whether the action is valid.