Work on spectator mode - joining as spectator now possible (on server side).

This commit is contained in:
lotodore
2013-06-29 16:23:10 +02:00
parent cbd6b40f85
commit ef489dae8a
12 changed files with 732 additions and 118 deletions
+9 -2
View File
@@ -77,8 +77,8 @@ public:
ServerCallback &GetCallback();
GameState GetCurRound() const;
void SendToAllPlayers(boost::shared_ptr<NetPacket> packet, SessionData::State state);
void SendToAllButOnePlayers(boost::shared_ptr<NetPacket> packet, SessionId except, SessionData::State state);
void SendToAllPlayers(boost::shared_ptr<NetPacket> packet, int state);
void SendToAllButOnePlayers(boost::shared_ptr<NetPacket> packet, SessionId except, int state);
void RemoveAllSessions();
bool IsPasswordProtected() const;
@@ -88,6 +88,7 @@ public:
boost::shared_ptr<PlayerData> GetPlayerDataByUniqueId(unsigned playerId) const;
PlayerIdList GetPlayerIdList() const;
PlayerIdList GetSpectatorIdList() const;
bool IsPlayerConnected(const std::string &name) const;
bool IsPlayerConnected(unsigned playerId) const;
bool IsClientAddressConnected(const std::string &clientAddress) const;
@@ -111,6 +112,9 @@ public:
void AddReactivatePlayer(unsigned playerId);
PlayerIdList GetAndResetReactivatePlayers();
void AddNewSpectator(unsigned playerId);
PlayerIdList GetAndResetNewSpectators();
void SetNameReported();
bool IsNameReported() const;
@@ -205,6 +209,9 @@ private:
PlayerIdList m_reactivatePlayerList;
mutable boost::mutex m_reactivatePlayerListMutex;
PlayerIdList m_newSpectatorList;
mutable boost::mutex m_newSpectatorListMutex;
PlayerIdList m_reportedAvatarList;
RankingMap m_rankingMap;