| 1385 | } |
| 1386 | |
| 1387 | void NetworkBase::ServerSendScripts(Connection& connection) |
| 1388 | { |
| 1389 | Packet packet(Command::scriptsData); |
| 1390 | |
| 1391 | #ifdef ENABLE_SCRIPTING |
| 1392 | using namespace OpenRCT2::Scripting; |
| 1393 | |
| 1394 | auto& scriptEngine = GetContext().GetScriptEngine(); |
| 1395 | |
| 1396 | // Get remote plugin list. |
| 1397 | const auto remotePlugins = scriptEngine.GetRemotePlugins(); |
| 1398 | LOG_VERBOSE("Server sends %zu scripts", remotePlugins.size()); |
| 1399 | |
| 1400 | packet << static_cast<uint32_t>(remotePlugins.size()); |
| 1401 | |
| 1402 | for (auto& plugin : remotePlugins) |
| 1403 | { |
| 1404 | const auto& code = plugin->GetCode(); |
| 1405 | const auto codeSize = static_cast<uint32_t>(code.size()); |
| 1406 | |
| 1407 | packet << codeSize; |
| 1408 | packet.write(code.c_str(), code.size()); |
| 1409 | } |
| 1410 | #else |
| 1411 | packet << static_cast<uint32_t>(0); |
| 1412 | #endif |
| 1413 | |
| 1414 | connection.queuePacket(std::move(packet)); |
| 1415 | } |
| 1416 | |
| 1417 | void NetworkBase::Client_Send_HEARTBEAT(Connection& connection) const |
| 1418 | { |
nothing calls this directly
no test coverage detected