Working on storing places of all players in ranking games.
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user