Show and update admin player of a game even when in lobby and not in the game.

This commit is contained in:
lotodore
2007-10-12 14:32:25 +00:00
parent 96d1f34f5c
commit 4f00333599
21 changed files with 227 additions and 22 deletions
+8 -1
View File
@@ -42,7 +42,8 @@ class Game;
class ServerGameThread : public Thread
{
public:
ServerGameThread(ServerLobbyThread &lobbyThread, u_int32_t id, const std::string &name, const std::string &pwd, GuiInterface &gui, ConfigFile *playerConfig);
ServerGameThread(
ServerLobbyThread &lobbyThread, u_int32_t id, const std::string &name, const std::string &pwd, unsigned adminPlayerId, GuiInterface &gui, ConfigFile *playerConfig);
virtual ~ServerGameThread();
void Init(const GameData &gameData);
@@ -68,6 +69,9 @@ public:
bool IsRunning() const;
unsigned GetAdminPlayerId() const;
void SetAdminPlayerId(unsigned playerId);
// should be protected, but is needed in function.
const Game &GetGame() const;
Game &GetGame();
@@ -127,6 +131,9 @@ private:
PlayerDataList m_computerPlayerList;
mutable boost::mutex m_computerPlayerListMutex;
unsigned m_adminPlayerId;
mutable boost::mutex m_adminPlayerIdMutex;
ServerLobbyThread &m_lobbyThread;
std::auto_ptr<ReceiverHelper> m_receiver;
std::auto_ptr<SenderThread> m_sender;