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

Function NetworkServerKickClient

src/network/network_server.cpp:2029–2033  ·  view source on GitHub ↗

* Kick a single client. * @param client_id The client to kick. * @param reason In case of kicking a client, specifies the reason for kicking the client. */

Source from the content-addressed store, hash-verified

2027 * @param reason In case of kicking a client, specifies the reason for kicking the client.
2028 */
2029void NetworkServerKickClient(ClientID client_id, std::string_view reason)
2030{
2031 if (client_id == CLIENT_ID_SERVER) return;
2032 NetworkClientSocket::GetByClientID(client_id)->SendError(NETWORK_ERROR_KICKED, reason);
2033}
2034
2035/**
2036 * Ban, or kick, everyone joined from the given client's IP.

Callers 3

ConKickOrBanFunction · 0.85
AdminClientKickCallbackFunction · 0.85
NetworkServerKickOrBanIPFunction · 0.85

Calls 1

SendErrorMethod · 0.45

Tested by

no test coverage detected