* Notify the admin network of a new company. * @param company the company of which details will be sent into the admin network. */
| 934 | * @param company the company of which details will be sent into the admin network. |
| 935 | */ |
| 936 | void 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. |
no test coverage detected