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

Function NetworkAdminGameScript

src/network/network_admin.cpp:1022–1029  ·  view source on GitHub ↗

* Send GameScript JSON to the admin network (if they did opt in for the respective update). * @param json The JSON data as received from the GameScript. */

Source from the content-addressed store, hash-verified

1020 * @param json The JSON data as received from the GameScript.
1021 */
1022void NetworkAdminGameScript(std::string_view json)
1023{
1024 for (ServerNetworkAdminSocketHandler *as : ServerNetworkAdminSocketHandler::IterateActive()) {
1025 if (as->update_frequency[ADMIN_UPDATE_GAMESCRIPT].Test(AdminUpdateFrequency::Automatic)) {
1026 as->SendGameScript(json);
1027 }
1028 }
1029}
1030
1031/**
1032 * Distribute CommandPacket details over the admin network for logging purposes.

Callers 1

SendMethod · 0.85

Calls 2

TestMethod · 0.80
SendGameScriptMethod · 0.80

Tested by

no test coverage detected