diff options
| author | oldmud0 <oldmud0@users.noreply.github.com> | 2021-03-28 23:50:20 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-28 23:50:20 -0500 |
| commit | db36bbd4271ba218a602dac2e633f5cde54257f5 (patch) | |
| tree | 84f795dade99f8f1a0a7c1ce1632950f2594e888 | |
| parent | fcaa37e6f8f705066dd1475f9b1631a594971e63 (diff) | |
| parent | 05ff6b08a2d7a812ae128e23c97a516f2492cfe9 (diff) | |
Merge pull request #508 from AttorneyOnline/fix/evidence-in-demos
Fix LE packets being nonfunctional in demos
| -rw-r--r-- | src/demoserver.cpp | 3 | ||||
| -rw-r--r-- | src/packet_distribution.cpp | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/demoserver.cpp b/src/demoserver.cpp index 88dfdb4b..509a356a 100644 --- a/src/demoserver.cpp +++ b/src/demoserver.cpp @@ -233,8 +233,9 @@ void DemoServer::load_demo(QString filename) demo_stream.setCodec("UTF-8"); QString line = demo_stream.readLine(); while (!line.isNull()) { - if (!line.endsWith("%")) { + while (!line.endsWith("%")) { line += "\n"; + line += demo_stream.readLine(); } demo_data.enqueue(line); line = demo_stream.readLine(); diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp index f3810ca7..0a99b9db 100644 --- a/src/packet_distribution.cpp +++ b/src/packet_distribution.cpp @@ -542,7 +542,11 @@ void AOApplication::server_packet_received(AOPacket *p_packet) QVector<evi_type> f_evi_list; for (QString f_string : f_contents_encoded) { - QStringList sub_contents = f_string.split("&"); + QStringList sub_contents; + if (f_contents_encoded.contains("&")) + sub_contents = f_string.split("&"); + else + sub_contents = f_string.split("<and>"); // demos incorrectly encode the separator so we have to account for that if (sub_contents.size() < 3) continue; |
