Add code for alayan

This commit is contained in:
Benau 2018-05-15 16:08:07 +08:00
parent b8982200b6
commit d4b3f75b22

View File

@ -80,7 +80,7 @@ public:
/** \brief Get the players that are in the game
* \return A vector containing pointers on the players profiles. */
std::vector<std::shared_ptr<NetworkPlayerProfile> >
getConnectedPlayers() const
getConnectedPlayers(bool same_index_for_disconnected = false) const
{
std::lock_guard<std::mutex> lock(m_players_mutex);
std::vector<std::shared_ptr<NetworkPlayerProfile> > players;
@ -88,6 +88,8 @@ public:
{
if (auto player_connected = player_weak.lock())
players.push_back(player_connected);
else if (same_index_for_disconnected)
players.push_back(nullptr);
}
return players;
} // getConnectedPlayers