* Send an update about a company. * @param c The company to send the update of. */
| 342 | * @param c The company to send the update of. |
| 343 | */ |
| 344 | NetworkRecvStatus ServerNetworkAdminSocketHandler::SendCompanyUpdate(const Company *c) |
| 345 | { |
| 346 | auto p = std::make_unique<Packet>(this, ADMIN_PACKET_SERVER_COMPANY_UPDATE); |
| 347 | |
| 348 | p->Send_uint8 (c->index); |
| 349 | p->Send_string(GetString(STR_COMPANY_NAME, c->index)); |
| 350 | p->Send_string(GetString(STR_PRESIDENT_NAME, c->index)); |
| 351 | p->Send_uint8 (c->colour); |
| 352 | p->Send_bool (true); |
| 353 | p->Send_uint8 (CeilDiv(c->months_of_bankruptcy, 3)); // send as quarters_of_bankruptcy |
| 354 | |
| 355 | this->SendPacket(std::move(p)); |
| 356 | |
| 357 | return NETWORK_RECV_STATUS_OKAY; |
| 358 | } |
| 359 | |
| 360 | /** |
| 361 | * Tell the admin that a company got removed. |
no test coverage detected