Clarified initialization order to prevent possible race condition when initializing a new game.

This commit is contained in:
lotodore
2007-10-25 21:59:06 +00:00
parent d0c34c572b
commit e0f1193963
3 changed files with 6 additions and 13 deletions
+3 -8
View File
@@ -52,9 +52,10 @@ private:
};
ServerGameThread::ServerGameThread(ServerLobbyThread &lobbyThread, u_int32_t id, const string &name, const string &pwd, unsigned adminPlayerId, GuiInterface &gui, ConfigFile *playerConfig)
ServerGameThread::ServerGameThread(ServerLobbyThread &lobbyThread, u_int32_t id, const string &name, const string &pwd, const GameData &gameData, unsigned adminPlayerId, GuiInterface &gui, ConfigFile *playerConfig)
: m_lobbyThread(lobbyThread), m_adminPlayerId(adminPlayerId), m_gui(gui), m_id(id),
m_name(name), m_password(pwd), m_playerConfig(playerConfig), m_curState(NULL), m_gameNum(1)
m_name(name), m_password(pwd), m_gameData(gameData), m_playerConfig(playerConfig),
m_curState(NULL), m_gameNum(1)
{
m_senderCallback.reset(new ServerSenderCallback(*this));
m_sender.reset(new SenderThread(GetSenderCallback()));
@@ -65,12 +66,6 @@ ServerGameThread::~ServerGameThread()
{
}
void
ServerGameThread::Init(const GameData &gameData)
{
m_gameData = gameData;
}
u_int32_t
ServerGameThread::GetId() const
{