1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Restrict minimum state for ClientInterface::sendToAll

This commit is contained in:
sfan5 2025-05-27 11:55:18 +02:00
parent 9ce9d7f433
commit b580c66b61
3 changed files with 15 additions and 26 deletions

View file

@ -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"";
}