MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / NetworkGetPublicKeyOfClient

Function NetworkGetPublicKeyOfClient

src/network/network_server.cpp:2138–2142  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

2136 * @return View of the public key, which is empty when the client does not exist.
2137 */
2138std::string_view NetworkGetPublicKeyOfClient(ClientID client_id)
2139{
2140 auto socket = NetworkClientSocket::GetByClientID(client_id);
2141 return socket == nullptr ? "" : socket->GetPeerPublicKey();
2142}
2143
2144
2145/**

Callers 1

ConNetworkAuthorizedKeyFunction · 0.85

Calls 1

GetPeerPublicKeyMethod · 0.45

Tested by

no test coverage detected