Only log ranking games in db.
This commit is contained in:
@@ -270,7 +270,8 @@ ServerGame::InternalStartGame()
|
||||
m_game.reset(new Game(&gui, factory, playerData, GetGameData(), GetStartData(), GetNextGameNum()));
|
||||
|
||||
GetLobbyThread().NotifyStartingGame(GetId());
|
||||
GetLobbyThread().GetDatabase().AsyncCreateGame(GetId(), GetName());
|
||||
if (GetGameData().gameType == GAME_TYPE_RANKING)
|
||||
GetLobbyThread().GetDatabase().AsyncCreateGame(GetId(), GetName());
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -928,7 +928,7 @@ ServerGameStateHand::EngineLoop(boost::shared_ptr<ServerGame> server)
|
||||
// Store winner in database.
|
||||
boost::shared_ptr<PlayerInterface> winnerPlayer = *(playersWithCash.begin());
|
||||
boost::shared_ptr<PlayerData> tmpPlayer = server->GetPlayerDataByUniqueId(winnerPlayer->getMyUniqueID());
|
||||
if (tmpPlayer)
|
||||
if (tmpPlayer && server->GetDBId())
|
||||
{
|
||||
cerr << "Setting winner for game " << server->GetDBId() << " player id " << tmpPlayer->GetDBId() << endl;
|
||||
server->GetLobbyThread().GetDatabase().SetGamePlayerPlace(server->GetDBId(), tmpPlayer->GetDBId(), 1);
|
||||
|
||||
Reference in New Issue
Block a user