Fixed macro redefinition. Set money won in server.
This commit is contained in:
@@ -738,7 +738,6 @@ PlayerResult Record
|
|||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
| Player Money |
|
| Player Money |
|
||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
(Money Won is currently set to 0.)
|
|
||||||
|
|
||||||
|
|
||||||
Server Notification: End Of Hand Hide Cards
|
Server Notification: End Of Hand Hide Cards
|
||||||
@@ -754,7 +753,6 @@ Server Notification: End Of Hand Hide Cards
|
|||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
| Player Money |
|
| Player Money |
|
||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
(Money Won is currently set to 0.)
|
|
||||||
|
|
||||||
|
|
||||||
Server Notification: End Of Game
|
Server Notification: End Of Game
|
||||||
|
|||||||
@@ -309,12 +309,14 @@ ClientPlayer::getMyRoundStartCash() const
|
|||||||
void
|
void
|
||||||
ClientPlayer::setLastMoneyWon ( int theValue )
|
ClientPlayer::setLastMoneyWon ( int theValue )
|
||||||
{
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
lastMoneyWon = theValue;
|
lastMoneyWon = theValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ClientPlayer::getLastMoneyWon() const
|
ClientPlayer::getLastMoneyWon() const
|
||||||
{
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
return lastMoneyWon;
|
return lastMoneyWon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#define SEND_TIMEOUT_MSEC 2000
|
#define SEND_ERROR_TIMEOUT_MSEC 2000
|
||||||
|
|
||||||
SenderThread::SenderThread(SenderCallback &cb)
|
SenderThread::SenderThread(SenderCallback &cb)
|
||||||
: m_tmpOutBufSize(0), m_callback(cb)
|
: m_tmpOutBufSize(0), m_callback(cb)
|
||||||
@@ -117,7 +117,7 @@ SenderThread::Main()
|
|||||||
|
|
||||||
while (!ShouldTerminate())
|
while (!ShouldTerminate())
|
||||||
{
|
{
|
||||||
if (sendTimer.is_running() && sendTimer.elapsed().total_milliseconds() > SEND_TIMEOUT_MSEC)
|
if (sendTimer.is_running() && sendTimer.elapsed().total_milliseconds() > SEND_ERROR_TIMEOUT_MSEC)
|
||||||
{
|
{
|
||||||
RemoveCurSendData();
|
RemoveCurSendData();
|
||||||
sendTimer.reset();
|
sendTimer.reset();
|
||||||
|
|||||||
@@ -734,7 +734,7 @@ ServerGameStateStartRound::Process(ServerGameThread &server)
|
|||||||
boost::shared_ptr<NetPacket> endHand(new NetPacketEndOfHandHideCards);
|
boost::shared_ptr<NetPacket> endHand(new NetPacketEndOfHandHideCards);
|
||||||
NetPacketEndOfHandHideCards::Data endHandData;
|
NetPacketEndOfHandHideCards::Data endHandData;
|
||||||
endHandData.playerId = player->getMyUniqueID();
|
endHandData.playerId = player->getMyUniqueID();
|
||||||
endHandData.moneyWon = 0; // TODO
|
endHandData.moneyWon = player->getLastMoneyWon();
|
||||||
endHandData.playerMoney = player->getMyCash();
|
endHandData.playerMoney = player->getMyCash();
|
||||||
static_cast<NetPacketEndOfHandHideCards *>(endHand.get())->SetData(endHandData);
|
static_cast<NetPacketEndOfHandHideCards *>(endHand.get())->SetData(endHandData);
|
||||||
|
|
||||||
@@ -765,7 +765,7 @@ ServerGameStateStartRound::Process(ServerGameThread &server)
|
|||||||
tmpPlayerResult.bestHandPos[num] = bestHandPos[num];
|
tmpPlayerResult.bestHandPos[num] = bestHandPos[num];
|
||||||
|
|
||||||
tmpPlayerResult.valueOfCards = (*i)->getMyCardsValueInt();
|
tmpPlayerResult.valueOfCards = (*i)->getMyCardsValueInt();
|
||||||
tmpPlayerResult.moneyWon = 0; // TODO
|
tmpPlayerResult.moneyWon = (*i)->getLastMoneyWon();
|
||||||
tmpPlayerResult.playerMoney = (*i)->getMyCash();
|
tmpPlayerResult.playerMoney = (*i)->getMyCash();
|
||||||
|
|
||||||
endHandData.playerResults.push_back(tmpPlayerResult);
|
endHandData.playerResults.push_back(tmpPlayerResult);
|
||||||
|
|||||||
Reference in New Issue
Block a user