mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
parent
62ad2c3bc1
commit
23d49fda29
3 changed files with 38 additions and 47 deletions
|
@ -1106,20 +1106,21 @@ PlayerSAO* Server::StageTwoClientInit(session_t peer_id)
|
|||
SendPlayerBreath(playersao);
|
||||
|
||||
/*
|
||||
Print out action
|
||||
Update player list and print action
|
||||
*/
|
||||
{
|
||||
Address addr = getPeerAddress(player->getPeerId());
|
||||
std::string ip_str = addr.serializeString();
|
||||
const std::vector<std::string> &names = m_clients.getPlayerNames();
|
||||
NetworkPacket notice_pkt(TOCLIENT_UPDATE_PLAYER_LIST, 0, PEER_ID_INEXISTENT);
|
||||
notice_pkt << (u8) PLAYER_LIST_ADD << (u16) 1 << std::string(player->getName());
|
||||
m_clients.sendToAll(¬ice_pkt);
|
||||
}
|
||||
{
|
||||
std::string ip_str = getPeerAddress(player->getPeerId()).serializeString();
|
||||
const auto &names = m_clients.getPlayerNames();
|
||||
|
||||
actionstream << player->getName() << " [" << ip_str << "] joins game. List of players: ";
|
||||
|
||||
for (const std::string &name : names) {
|
||||
for (const std::string &name : names)
|
||||
actionstream << name << " ";
|
||||
}
|
||||
|
||||
actionstream << player->getName() <<std::endl;
|
||||
actionstream << player->getName() << std::endl;
|
||||
}
|
||||
return playersao;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue