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

Function NetworkAdminUpdate

src/network/network_admin.cpp:1061–1085  ·  view source on GitHub ↗

* Send (push) updates to the admin network as they have registered for these updates. * @param freq the frequency to be processed. */

Source from the content-addressed store, hash-verified

1059 * @param freq the frequency to be processed.
1060 */
1061void NetworkAdminUpdate(AdminUpdateFrequency freq)
1062{
1063 for (ServerNetworkAdminSocketHandler *as : ServerNetworkAdminSocketHandler::IterateActive()) {
1064 for (int i = 0; i < ADMIN_UPDATE_END; i++) {
1065 if (as->update_frequency[i].Test(freq)) {
1066 /* Update the admin for the required details */
1067 switch (i) {
1068 case ADMIN_UPDATE_DATE:
1069 as->SendDate();
1070 break;
1071
1072 case ADMIN_UPDATE_COMPANY_ECONOMY:
1073 as->SendCompanyEconomy();
1074 break;
1075
1076 case ADMIN_UPDATE_COMPANY_STATS:
1077 as->SendCompanyStats();
1078 break;
1079
1080 default: NOT_REACHED();
1081 }
1082 }
1083 }
1084 }
1085}

Callers 1

network_server.cppFile · 0.85

Calls 5

NOT_REACHEDFunction · 0.85
TestMethod · 0.80
SendDateMethod · 0.80
SendCompanyEconomyMethod · 0.80
SendCompanyStatsMethod · 0.80

Tested by

no test coverage detected