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

Function NetworkPrintClients

src/network/network_server.cpp:2115–2131  ·  view source on GitHub ↗

* Print all the clients to the console */

Source from the content-addressed store, hash-verified

2113 * Print all the clients to the console
2114 */
2115void NetworkPrintClients()
2116{
2117 for (NetworkClientInfo *ci : NetworkClientInfo::Iterate()) {
2118 if (_network_server) {
2119 IConsolePrint(CC_INFO, "Client #{} name: '{}' company: {} IP: {}",
2120 ci->client_id,
2121 ci->client_name,
2122 ci->client_playas + (Company::IsValidID(ci->client_playas) ? 1 : 0),
2123 ci->client_id == CLIENT_ID_SERVER ? "server" : NetworkClientSocket::GetByClientID(ci->client_id)->GetClientIP());
2124 } else {
2125 IConsolePrint(CC_INFO, "Client #{} name: '{}' company: {}",
2126 ci->client_id,
2127 ci->client_name,
2128 ci->client_playas + (Company::IsValidID(ci->client_playas) ? 1 : 0));
2129 }
2130 }
2131}
2132
2133/**
2134 * Get the public key of the client with the given id.

Callers 1

ConNetworkClientsFunction · 0.85

Calls 2

GetClientIPMethod · 0.80
IConsolePrintFunction · 0.50

Tested by

no test coverage detected