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

Function NetworkUpdateClientInfo

src/network/network_server.cpp:1529–1544  ·  view source on GitHub ↗

* Send updated client info of a particular client. * @param client_id The client to send it for. */

Source from the content-addressed store, hash-verified

1527 * @param client_id The client to send it for.
1528 */
1529void NetworkUpdateClientInfo(ClientID client_id)
1530{
1531 NetworkClientInfo *ci = NetworkClientInfo::GetByClientID(client_id);
1532
1533 if (ci == nullptr) return;
1534
1535 Debug(desync, 1, "client: {:08x}; {:02x}; {:02x}; {:04x}", TimerGameEconomy::date, TimerGameEconomy::date_fract, ci->client_playas, client_id);
1536
1537 for (NetworkClientSocket *cs : NetworkClientSocket::Iterate()) {
1538 if (cs->status >= ServerNetworkGameSocketHandler::STATUS_AUTHORIZED) {
1539 cs->SendClientInfo(ci);
1540 }
1541 }
1542
1543 NetworkAdminClientUpdate(ci);
1544}
1545
1546/**
1547 * Remove companies that have not been used depending on the \c autoclean_companies setting

Callers 6

CmdCompanyCtrlFunction · 0.85
NetworkServerDoMoveFunction · 0.85
NetworkServerNewCompanyFunction · 0.85
NetworkUpdateClientNameFunction · 0.85

Calls 2

NetworkAdminClientUpdateFunction · 0.85
SendClientInfoMethod · 0.45

Tested by

no test coverage detected