Add username/password to Hello message

This commit is contained in:
badaix 2025-02-06 21:11:38 +01:00 committed by Johannes Pohl
parent b566b42ee0
commit 080b7a809b
6 changed files with 40 additions and 4 deletions

View file

@ -310,8 +310,10 @@ void Server::onMessageReceived(StreamSession* streamSession, const msg::BaseMess
streamSession->clientId = helloMsg.getUniqueId();
LOG(INFO, LOG_TAG) << "Hello from " << streamSession->clientId << ", host: " << helloMsg.getHostName() << ", v" << helloMsg.getVersion()
<< ", ClientName: " << helloMsg.getClientName() << ", OS: " << helloMsg.getOS() << ", Arch: " << helloMsg.getArch()
<< ", Protocol version: " << helloMsg.getProtocolVersion() << "\n";
<< ", Protocol version: " << helloMsg.getProtocolVersion() << ", Userrname: " << helloMsg.getUsername().value_or("<not set>")
<< ", Password: " << (helloMsg.getPassword().has_value() ? "<password is set>" : "<not set>") << "\n";
streamSession->stop();
return;
bool newGroup(false);
GroupPtr group = Config::instance().getGroupFromClient(streamSession->clientId);
if (group == nullptr)