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

Function NetworkAdminCompanyNew

src/network/network_admin.cpp:936–949  ·  view source on GitHub ↗

* Notify the admin network of a new company. * @param company the company of which details will be sent into the admin network. */

Source from the content-addressed store, hash-verified

934 * @param company the company of which details will be sent into the admin network.
935 */
936void NetworkAdminCompanyNew(const Company *company)
937{
938 if (company == nullptr) {
939 Debug(net, 1, "[admin] Empty company given for update");
940 return;
941 }
942
943 for (ServerNetworkAdminSocketHandler *as : ServerNetworkAdminSocketHandler::IterateActive()) {
944 if (as->update_frequency[ADMIN_UPDATE_COMPANY_INFO] != AdminUpdateFrequency::Automatic) continue;
945
946 as->SendCompanyNew(company->index);
947 as->SendCompanyInfo(company);
948 }
949}
950
951/**
952 * Notify the admin network of company updates.

Callers 1

CmdCompanyCtrlFunction · 0.85

Calls 2

SendCompanyNewMethod · 0.80
SendCompanyInfoMethod · 0.80

Tested by

no test coverage detected