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

Method SendClientInfo

src/network/network_server.cpp:325–339  ·  view source on GitHub ↗

* Send the client information about a client. * @param ci The client to send information about. */

Source from the content-addressed store, hash-verified

323 * @param ci The client to send information about.
324 */
325NetworkRecvStatus ServerNetworkGameSocketHandler::SendClientInfo(NetworkClientInfo *ci)
326{
327 Debug(net, 9, "client[{}] SendClientInfo(): client_id={}", this->client_id, ci->client_id);
328
329 if (ci->client_id != INVALID_CLIENT_ID) {
330 auto p = std::make_unique<Packet>(this, PACKET_SERVER_CLIENT_INFO);
331 p->Send_uint32(ci->client_id);
332 p->Send_uint8 (ci->client_playas);
333 p->Send_string(ci->client_name);
334 p->Send_string(ci->public_key);
335
336 this->SendPacket(std::move(p));
337 }
338 return NETWORK_RECV_STATUS_OKAY;
339}
340
341/** Send the client information about the server. */
342NetworkRecvStatus ServerNetworkGameSocketHandler::SendGameInfo()

Callers 3

SendWelcomeMethod · 0.95
Receive_CLIENT_MAP_OKMethod · 0.45
NetworkUpdateClientInfoFunction · 0.45

Calls 4

Send_uint32Method · 0.80
Send_stringMethod · 0.80
Send_uint8Method · 0.45
SendPacketMethod · 0.45

Tested by

no test coverage detected