Working on storing places of all players in ranking games.

This commit is contained in:
lotodore
2010-08-07 23:06:59 +00:00
parent 96b4f864f6
commit 0646bc9d2e
8 changed files with 163 additions and 70 deletions
+14
View File
@@ -29,6 +29,7 @@
#include <net/socket_msg.h>
#include <core/loghelper.h>
#include <db/serverdbinterface.h>
#include <db/serverdbnoaction.h>
#include <game.h>
#include <localenginefactory.h>
#include <tools.h>
@@ -231,6 +232,12 @@ ServerGame::TimerVoteKick(const boost::system::error_code &ec)
void
ServerGame::InternalStartGame()
{
// Set DB Backend.
if (GetGameData().gameType == GAME_TYPE_RANKING)
m_database = GetLobbyThread().GetDatabase();
else
m_database.reset(new ServerDBNoAction);
// Set order of players.
AssignPlayerNumbers();
@@ -751,6 +758,13 @@ ServerGame::GetSessionManager() const
return m_sessionManager;
}
ServerDBInterface &
ServerGame::GetDatabase()
{
assert(m_database);
return *m_database;
}
ServerLobbyThread &
ServerGame::GetLobbyThread()
{