Merge pull request #508 from AttorneyOnline/fix/evidence-in-demos
Fix LE packets being nonfunctional in demos
This commit is contained in:
		
						commit
						db36bbd427
					
				@ -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();
 | 
				
			||||||
 | 
				
			|||||||
@ -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;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user