Feature: console command to change authorized keys
This commit is contained in:
@@ -61,6 +61,7 @@ bool NetworkCompanyIsPassworded(CompanyID company_id);
|
||||
uint NetworkMaxCompaniesAllowed();
|
||||
bool NetworkMaxCompaniesReached();
|
||||
void NetworkPrintClients();
|
||||
std::string_view NetworkGetPublicKeyOfClient(ClientID client_id);
|
||||
void NetworkHandlePauseChange(PauseMode prev_mode, PauseMode changed_mode);
|
||||
|
||||
/*** Commands ran by the server ***/
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -121,6 +121,7 @@ public:
|
||||
}
|
||||
|
||||
const std::string &GetClientIP();
|
||||
std::string_view GetPeerPublicKey() const { return this->peer_public_key; }
|
||||
|
||||
static ServerNetworkGameSocketHandler *GetByClientID(ClientID client_id);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user