Merge pull request #508 from AttorneyOnline/fix/evidence-in-demos

Fix LE packets being nonfunctional in demos
This commit is contained in:
oldmud0 2021-03-28 23:50:20 -05:00 committed by GitHub
commit db36bbd427
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -233,8 +233,9 @@ void DemoServer::load_demo(QString filename)
demo_stream.setCodec("UTF-8"); demo_stream.setCodec("UTF-8");
QString line = demo_stream.readLine(); QString line = demo_stream.readLine();
while (!line.isNull()) { while (!line.isNull()) {
if (!line.endsWith("%")) { while (!line.endsWith("%")) {
line += "\n"; line += "\n";
line += demo_stream.readLine();
} }
demo_data.enqueue(line); demo_data.enqueue(line);
line = demo_stream.readLine(); line = demo_stream.readLine();

View File

@ -542,7 +542,11 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
QVector<evi_type> f_evi_list; QVector<evi_type> f_evi_list;
for (QString f_string : f_contents_encoded) { 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) if (sub_contents.size() < 3)
continue; continue;