Skip to content

Commit

Permalink
Fix buffer size
Browse files Browse the repository at this point in the history
  • Loading branch information
ksuprynowicz committed Feb 17, 2024
1 parent c311d3c commit 5c5c529
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion assignment-client/src/scripts/EntityScriptServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,13 @@ void EntityScriptServer::pushLogs() {
QJsonDocument document;
document.setArray(buffer);
QString data(document.toJson());
std::string string = data.toStdString();
auto cstring = string.c_str();
for (auto uuid : _logListeners) {
auto node = nodeList->nodeWithUUID(uuid);
if (node && node->getActiveSocket()) {
auto packet = NLPacketList::create(PacketType::EntityServerScriptLog, QByteArray(), true, true);
packet->write(data.toStdString().c_str(), data.size());
packet->write(cstring, strlen(cstring));
nodeList->sendPacketList(std::move(packet), *node);
}
}
Expand Down

0 comments on commit 5c5c529

Please sign in to comment.