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

Method SendCompanyInfo

src/network/network_admin.cpp:321–337  ·  view source on GitHub ↗

* Send the admin some information about a company. * @param c The company to send the information about. */

Source from the content-addressed store, hash-verified

319 * @param c The company to send the information about.
320 */
321NetworkRecvStatus ServerNetworkAdminSocketHandler::SendCompanyInfo(const Company *c)
322{
323 auto p = std::make_unique<Packet>(this, ADMIN_PACKET_SERVER_COMPANY_INFO);
324
325 p->Send_uint8 (c->index);
326 p->Send_string(GetString(STR_COMPANY_NAME, c->index));
327 p->Send_string(GetString(STR_PRESIDENT_NAME, c->index));
328 p->Send_uint8 (c->colour);
329 p->Send_bool (true);
330 p->Send_uint32(c->inaugurated_year.base());
331 p->Send_bool (c->is_ai);
332 p->Send_uint8 (CeilDiv(c->months_of_bankruptcy, 3)); // send as quarters_of_bankruptcy
333
334 this->SendPacket(std::move(p));
335
336 return NETWORK_RECV_STATUS_OKAY;
337}
338
339
340/**

Callers 2

Receive_ADMIN_POLLMethod · 0.95
NetworkAdminCompanyNewFunction · 0.80

Calls 8

CeilDivFunction · 0.85
Send_stringMethod · 0.80
Send_boolMethod · 0.80
Send_uint32Method · 0.80
GetStringFunction · 0.50
Send_uint8Method · 0.45
baseMethod · 0.45
SendPacketMethod · 0.45

Tested by

no test coverage detected