1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-21 11:22:45 +01:00

Feature: console command to change authorized keys

This commit is contained in:
Rubidium
2024-03-17 19:11:55 +01:00
committed by rubidium42
parent b7dfa3eb90
commit 4af089b9be
4 changed files with 112 additions and 0 deletions

View File

@@ -2243,6 +2243,18 @@ void NetworkPrintClients()
}
}
/**
* Get the public key of the client with the given id.
* @param client_id The id of the client.
* @return View of the public key, which is empty when the client does not exist.
*/
std::string_view NetworkGetPublicKeyOfClient(ClientID client_id)
{
auto socket = NetworkClientSocket::GetByClientID(client_id);
return socket == nullptr ? "" : socket->GetPeerPublicKey();
}
/**
* Perform all the server specific administration of a new company.
* @param c The newly created company; can't be nullptr.