Game database entry is created only once the game is started.

This commit is contained in:
lotodore
2009-10-03 20:19:51 +00:00
parent a2a27cbdb0
commit 51e393823a
4 changed files with 33 additions and 3 deletions
+9 -1
View File
@@ -122,6 +122,7 @@ public:
virtual void CreateGameSuccess(unsigned requestId, db_id gameId)
{
m_server.SetGameDBId((u_int32_t)requestId, gameId);
}
virtual void CreateGameFailed(unsigned requestId)
@@ -1135,7 +1136,6 @@ ServerLobbyThread::HandleNetPacketCreateGame(SessionWrapper session, const std::
m_playerConfig));
game->Init();
m_database->AsyncCreateGame(game->GetId(), game->GetName());
// Add game to list of games.
InternalAddGame(game);
@@ -1773,6 +1773,14 @@ ServerLobbyThread::GetCallback()
return m_gui;
}
void
ServerLobbyThread::SetGameDBId(u_int32_t gameId, db_id gameDBId)
{
boost::shared_ptr<ServerGame> game = InternalGetGameFromId(gameId);
if (game)
game->SetDBId(gameDBId);
}
ServerIrcBotCallback &
ServerLobbyThread::GetIrcBotCallback()
{