Store date/time when the game ends.
This commit is contained in:
@@ -47,20 +47,17 @@ HEADERS += cleanerserver.h \
|
|||||||
LIBPATH += lib
|
LIBPATH += lib
|
||||||
LIBS += -lpokerth_lib \
|
LIBS += -lpokerth_lib \
|
||||||
-lpokerth_protocol
|
-lpokerth_protocol
|
||||||
|
|
||||||
win32 {
|
win32 {
|
||||||
LIBPATH += ../boost/stage/lib
|
LIBPATH += ../boost/stage/lib
|
||||||
INCLUDEPATH += ../boost/
|
INCLUDEPATH += ../boost/
|
||||||
debug:LIBPATH += Debug/lib
|
debug:LIBPATH += Debug/lib
|
||||||
release:LIBPATH += Release/lib
|
release:LIBPATH += Release/lib
|
||||||
}
|
}
|
||||||
|
|
||||||
mac {
|
mac {
|
||||||
# make it universal
|
# make it universal
|
||||||
CONFIG += x86
|
CONFIG += x86
|
||||||
CONFIG -= ppc
|
CONFIG -= ppc
|
||||||
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4
|
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4
|
||||||
|
|
||||||
LIBPATH += /Developer/SDKs/MacOSX10.5.sdk/usr/lib
|
LIBPATH += /Developer/SDKs/MacOSX10.5.sdk/usr/lib
|
||||||
INCLUDEPATH += /Developer/SDKs/MacOSX10.5.sdk/usr/include/
|
INCLUDEPATH += /Developer/SDKs/MacOSX10.5.sdk/usr/include/
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -270,8 +270,6 @@ ServerGame::InternalStartGame()
|
|||||||
m_game.reset(new Game(&gui, factory, playerData, GetGameData(), GetStartData(), GetNextGameNum()));
|
m_game.reset(new Game(&gui, factory, playerData, GetGameData(), GetStartData(), GetNextGameNum()));
|
||||||
|
|
||||||
GetLobbyThread().NotifyStartingGame(GetId());
|
GetLobbyThread().NotifyStartingGame(GetId());
|
||||||
if (GetGameData().gameType == GAME_TYPE_RANKING)
|
|
||||||
GetLobbyThread().GetDatabase().AsyncCreateGame(GetId(), GetName());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -650,6 +650,8 @@ ServerGameStateStartGame::DoStart(boost::shared_ptr<ServerGame> server)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
server->InternalStartGame();
|
server->InternalStartGame();
|
||||||
|
if (server->GetGameData().gameType == GAME_TYPE_RANKING)
|
||||||
|
server->GetLobbyThread().GetDatabase().AsyncCreateGame(server->GetId(), server->GetName());
|
||||||
|
|
||||||
boost::shared_ptr<NetPacket> packet(new NetPacket(NetPacket::Alloc));
|
boost::shared_ptr<NetPacket> packet(new NetPacket(NetPacket::Alloc));
|
||||||
packet->GetMsg()->present = PokerTHMessage_PR_gameStartMessage;
|
packet->GetMsg()->present = PokerTHMessage_PR_gameStartMessage;
|
||||||
@@ -928,10 +930,11 @@ ServerGameStateHand::EngineLoop(boost::shared_ptr<ServerGame> server)
|
|||||||
// Store winner in database.
|
// Store winner in database.
|
||||||
boost::shared_ptr<PlayerInterface> winnerPlayer = *(playersWithCash.begin());
|
boost::shared_ptr<PlayerInterface> winnerPlayer = *(playersWithCash.begin());
|
||||||
boost::shared_ptr<PlayerData> tmpPlayer = server->GetPlayerDataByUniqueId(winnerPlayer->getMyUniqueID());
|
boost::shared_ptr<PlayerData> tmpPlayer = server->GetPlayerDataByUniqueId(winnerPlayer->getMyUniqueID());
|
||||||
if (tmpPlayer && server->GetDBId())
|
if (server->GetGameData().gameType == GAME_TYPE_RANKING && tmpPlayer && server->GetDBId())
|
||||||
{
|
{
|
||||||
cerr << "Setting winner for game " << server->GetDBId() << " player id " << tmpPlayer->GetDBId() << endl;
|
cerr << "Setting winner for game " << server->GetDBId() << " player id " << tmpPlayer->GetDBId() << endl;
|
||||||
server->GetLobbyThread().GetDatabase().SetGamePlayerPlace(server->GetDBId(), tmpPlayer->GetDBId(), 1);
|
server->GetLobbyThread().GetDatabase().SetGamePlayerPlace(server->GetDBId(), tmpPlayer->GetDBId(), 1);
|
||||||
|
server->GetLobbyThread().GetDatabase().EndGame(server->GetDBId());
|
||||||
}
|
}
|
||||||
|
|
||||||
// View a dialog for a new game - delayed.
|
// View a dialog for a new game - delayed.
|
||||||
|
|||||||
Reference in New Issue
Block a user