| 2518 | } |
| 2519 | |
| 2520 | void NetworkBase::Client_Handle_SCRIPTS_DATA(Connection& connection, Packet& packet) |
| 2521 | { |
| 2522 | #ifdef ENABLE_SCRIPTING |
| 2523 | auto& scriptEngine = GetContext().GetScriptEngine(); |
| 2524 | |
| 2525 | uint32_t count{}; |
| 2526 | packet >> count; |
| 2527 | |
| 2528 | for (uint32_t i = 0; i < count; ++i) |
| 2529 | { |
| 2530 | uint32_t codeSize{}; |
| 2531 | packet >> codeSize; |
| 2532 | |
| 2533 | const uint8_t* scriptData = packet.read(codeSize); |
| 2534 | |
| 2535 | auto code = std::string_view(reinterpret_cast<const char*>(scriptData), codeSize); |
| 2536 | scriptEngine.AddNetworkPlugin(code); |
| 2537 | |
| 2538 | LOG_VERBOSE("Received and loaded network script plugin %u/%u", i + 1, count); |
| 2539 | } |
| 2540 | #else |
| 2541 | connection.setLastDisconnectReason("The client requires plugin support."); |
| 2542 | Close(); |
| 2543 | #endif |
| 2544 | } |
| 2545 | |
| 2546 | void NetworkBase::Client_Handle_GAMESTATE(Connection& connection, Packet& packet) |
| 2547 | { |
nothing calls this directly
no test coverage detected