stop filling the log with raw net traffic

This commit is contained in:
in1tiate 2024-05-20 12:03:36 -05:00
parent 5d90088b5c
commit e2b47afd91
2 changed files with 17 additions and 7 deletions

View File

@ -1415,15 +1415,22 @@ void Courtroom::set_background(QString p_background, bool display)
pos_list.append(default_pos[key]);
}
}
if (file_exists(ao_app->get_image_suffix(ao_app->get_background_path("court"))))
{
const QStringList overrides = {"def", "wit", "pro"};
for (const QString &override_pos : overrides)
{
if (!ao_app->read_design_ini("court:" + override_pos + "/pos_center", ao_app->get_background_path("design.ini")).isEmpty())
{
pos_list.append(override_pos);
}
}
}
for (const QString &pos : ao_app->read_design_ini("positions", ao_app->get_background_path("design.ini")).split(","))
{
QString real_pos = pos.split(":")[0];
QStringList overrides = {"def", "wit", "pro"};
if ((file_exists(ao_app->get_image_suffix(ao_app->get_background_path(real_pos)))) || // Normal check, OR
(overrides.contains(pos) && // It's one of our subpos overrides, AND
file_exists(ao_app->get_image_suffix(ao_app->get_background_path("court"))) && // the "court" default image exists, AND
!ao_app->read_design_ini("court:" + pos + "/pos_center", ao_app->get_background_path("design.ini")).isEmpty()))
{ // config exists for this pos
if ((file_exists(ao_app->get_image_suffix(ao_app->get_background_path(real_pos)))))
{
pos_list.append(pos);
}
}

View File

@ -197,8 +197,9 @@ void NetworkManager::ship_server_packet(AOPacket packet)
qCritical() << "Failed to ship packet; not connected.";
return;
}
#ifdef NETWORK_DEBUG
qInfo().noquote() << "Sending packet:" << packet.toString();
#endif
m_connection->sendPacket(packet);
}
@ -209,6 +210,8 @@ void NetworkManager::join_to_server()
void NetworkManager::handle_server_packet(AOPacket packet)
{
#ifdef NETWORK_DEBUG
qInfo().noquote() << "Received packet:" << packet.toString();
#endif
ao_app->server_packet_received(packet);
}