mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 09:05:19 +02:00
Restrict minimum state for ClientInterface::sendToAll
This commit is contained in:
@@ -1572,7 +1572,8 @@ void Server::SendChatMessage(session_t peer_id, const ChatMessage &message)
|
||||
if (peer_id != PEER_ID_INEXISTENT) {
|
||||
Send(&pkt);
|
||||
} else {
|
||||
m_clients.sendToAll(&pkt);
|
||||
// If a client has completed auth but is still joining, still send chat
|
||||
m_clients.sendToAll(&pkt, CS_InitDone);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3183,9 +3184,7 @@ std::wstring Server::handleChat(const std::string &name,
|
||||
|
||||
ChatMessage chatmsg(line);
|
||||
|
||||
std::vector<session_t> clients = m_clients.getClientIDs();
|
||||
for (u16 cid : clients)
|
||||
SendChatMessage(cid, chatmsg);
|
||||
SendChatMessage(PEER_ID_INEXISTENT, chatmsg);
|
||||
|
||||
return L"";
|
||||
}
|
||||
|
Reference in New Issue
Block a user