Add online id with player name for easier banning
This commit is contained in:
parent
5eb436384f
commit
ce8a15d90c
@ -35,14 +35,6 @@ GameSetup::GameSetup()
|
||||
m_reverse = false;
|
||||
} // GameSetup
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void GameSetup::addPlayer(std::shared_ptr<NetworkPlayerProfile> profile)
|
||||
{
|
||||
m_players.push_back(profile);
|
||||
Log::info("GameSetup", "New player in the game setup. Player name : %s.",
|
||||
StringUtils::wideToUtf8(profile->getName()).c_str());
|
||||
} // addPlayer
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** Update and see if any player disconnects.
|
||||
* \param remove_disconnected_players remove the disconnected players,
|
||||
|
@ -63,7 +63,8 @@ public:
|
||||
// ------------------------------------------------------------------------
|
||||
~GameSetup() {}
|
||||
// ------------------------------------------------------------------------
|
||||
void addPlayer(std::shared_ptr<NetworkPlayerProfile> profile);
|
||||
void addPlayer(std::shared_ptr<NetworkPlayerProfile> profile)
|
||||
{ m_players.push_back(profile); }
|
||||
// ------------------------------------------------------------------------
|
||||
void update(bool remove_disconnected_players);
|
||||
// ------------------------------------------------------------------------
|
||||
|
@ -935,10 +935,13 @@ void ServerLobby::connectionRequested(Event* event)
|
||||
|
||||
m_peers_ready[peer] = false;
|
||||
for (std::shared_ptr<NetworkPlayerProfile> npp : peer->getPlayerProfiles())
|
||||
{
|
||||
m_game_setup->addPlayer(npp);
|
||||
Log::info("ServerLobby", "New player %s with online id %u from %s.",
|
||||
StringUtils::wideToUtf8(npp->getName()).c_str(),
|
||||
npp->getOnlineId(), peer->getAddress().toString().c_str());
|
||||
}
|
||||
updatePlayerList();
|
||||
Log::verbose("ServerLobby", "New player.");
|
||||
|
||||
} // connectionRequested
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user