Remove log object from server, server-side logging is deactivated. Pass NULL as log object to game.

This commit is contained in:
lotodore
2012-01-02 21:04:49 +00:00
parent aa6fdf1de1
commit df35ea550f
4 changed files with 5 additions and 15 deletions
+3 -4
View File
@@ -30,7 +30,6 @@
#include <db/serverdbinterface.h>
#include <db/serverdbnoaction.h>
#include <game.h>
#include <log.h>
#include <localenginefactory.h>
#include <tools.h>
#include <configfile.h>
@@ -47,10 +46,10 @@ static bool LessThanPlayerHandStartMoney(const boost::shared_ptr<PlayerInterface
}
ServerGame::ServerGame(boost::shared_ptr<ServerLobbyThread> lobbyThread, u_int32_t id, const string &name, const string &pwd, const GameData &gameData, unsigned adminPlayerId, GuiInterface &gui, ConfigFile &playerConfig, Log &serverLog)
ServerGame::ServerGame(boost::shared_ptr<ServerLobbyThread> lobbyThread, u_int32_t id, const string &name, const string &pwd, const GameData &gameData, unsigned adminPlayerId, GuiInterface &gui, ConfigFile &playerConfig)
: m_adminPlayerId(adminPlayerId), m_lobbyThread(lobbyThread), m_gui(gui),
m_gameData(gameData), m_curState(NULL), m_id(id), m_name(name),
m_password(pwd), m_playerConfig(playerConfig), m_serverLog(serverLog), m_gameNum(1),
m_password(pwd), m_playerConfig(playerConfig), m_gameNum(1),
m_curPetitionId(1), m_voteKickTimer(lobbyThread->GetIOService()),
m_stateTimer1(lobbyThread->GetIOService()), m_stateTimer2(lobbyThread->GetIOService())
{
@@ -285,7 +284,7 @@ ServerGame::InternalStartGame()
SetStartData(startData);
GuiInterface &gui = GetGui();
m_game.reset(new Game(&gui, factory, playerData, GetGameData(), GetStartData(), GetNextGameNum(), &m_serverLog));
m_game.reset(new Game(&gui, factory, playerData, GetGameData(), GetStartData(), GetNextGameNum(), NULL));
GetDatabase().AsyncCreateGame(GetId(), GetName());
InitRankingMap(playerData);
+1 -4
View File
@@ -37,7 +37,6 @@
#include <core/openssl_wrapper.h>
#include <configfile.h>
#include <playerinterface.h>
#include <log.h>
#include <fstream>
#include <sstream>
@@ -220,7 +219,6 @@ ServerLobbyThread::Init(const string &logDir)
m_serverConfig.readConfigString("DBServerEncryptionKey"));
GetBanManager().InitGameNameBadWordList(m_serverConfig.readConfigStringList("GameNameBadWordList"));
m_serverLog.reset(new Log(&m_serverConfig));
}
void
@@ -1258,8 +1256,7 @@ ServerLobbyThread::HandleNetPacketCreateGame(boost::shared_ptr<SessionData> sess
tmpData,
session->GetPlayerData()->GetUniqueId(),
GetGui(),
m_serverConfig,
*m_serverLog));
m_serverConfig));
game->Init();
// Add game to list of games.
+1 -3
View File
@@ -37,13 +37,12 @@ class PlayerInterface;
class ConfigFile;
struct GameData;
class Game;
class Log;
class ServerGame : public boost::enable_shared_from_this<ServerGame>
{
public:
ServerGame(
boost::shared_ptr<ServerLobbyThread> lobbyThread, u_int32_t id, const std::string &name, const std::string &pwd, const GameData &gameData, unsigned adminPlayerId, GuiInterface &gui, ConfigFile &playerConfig, Log &serverLog);
boost::shared_ptr<ServerLobbyThread> lobbyThread, u_int32_t id, const std::string &name, const std::string &pwd, const GameData &gameData, unsigned adminPlayerId, GuiInterface &gui, ConfigFile &playerConfig);
virtual ~ServerGame();
void Init();
@@ -207,7 +206,6 @@ private:
const std::string m_name;
const std::string m_password;
ConfigFile &m_playerConfig;
Log &m_serverLog;
unsigned m_gameNum;
unsigned m_curPetitionId;
boost::asio::deadline_timer m_voteKickTimer;
-4
View File
@@ -30,8 +30,6 @@
#include <gui/guiinterface.h>
#include <gamedata.h>
class Log;
#define NET_LOBBY_THREAD_TERMINATE_TIMEOUT_MSEC 20000
#define NET_ADMIN_IRC_TERMINATE_TIMEOUT_MSEC 4000
@@ -233,8 +231,6 @@ private:
u_int32_t m_curSessionId;
mutable boost::mutex m_curUniquePlayerIdMutex;
boost::shared_ptr<Log> m_serverLog;
ServerStats m_statData;
bool m_statDataChanged;
mutable boost::mutex m_statMutex;