Playerlist fix (#1018)
* Commit * Boyfailure code commit * Cooking code spaghetti * Accidental overwrite recursive function call hell * Implemented player list * Add partial moderator widget Sleepy time! Hee-Hoo! * Moderator Dialog - Step 1 - WIP * Appease the clang gods * Clang appeasement policy * *sacrifices goat to clang* * Added player report, reworked implementation, ... * Added player-specific report * Reworked implementation * No longer uses JSON. * Removed preset loader. * Remove unused code. * Safety measures against potential segfault. * Removes unused code --------- Co-authored-by: Salanto <62221668+Salanto@users.noreply.github.com>
This commit is contained in:
parent
23077d0291
commit
640b026534
@ -7,10 +7,6 @@
|
|||||||
#include "networkmanager.h"
|
#include "networkmanager.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
|
|
||||||
#include <QJsonArray>
|
|
||||||
#include <QJsonDocument>
|
|
||||||
#include <QJsonObject>
|
|
||||||
|
|
||||||
void AOApplication::append_to_demofile(QString packet_string)
|
void AOApplication::append_to_demofile(QString packet_string)
|
||||||
{
|
{
|
||||||
if (Options::getInstance().logToDemoFileEnabled() && !log_filename.isEmpty())
|
if (Options::getInstance().logToDemoFileEnabled() && !log_filename.isEmpty())
|
||||||
@ -42,16 +38,6 @@ void AOApplication::server_packet_received(AOPacket packet)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
auto convert_to_json = [](QString data) -> QJsonDocument {
|
|
||||||
QJsonParseError error;
|
|
||||||
QJsonDocument document = QJsonDocument::fromJson(data.toUtf8(), &error);
|
|
||||||
if (error.error != QJsonParseError::NoError)
|
|
||||||
{
|
|
||||||
qWarning().noquote() << "Invalid or malformed JSON data:" << error.errorString();
|
|
||||||
}
|
|
||||||
return document;
|
|
||||||
};
|
|
||||||
|
|
||||||
if (header == "decryptor")
|
if (header == "decryptor")
|
||||||
{
|
{
|
||||||
if (content.size() == 0)
|
if (content.size() == 0)
|
||||||
@ -692,7 +678,7 @@ void AOApplication::server_packet_received(AOPacket packet)
|
|||||||
}
|
}
|
||||||
else if (header == "PR")
|
else if (header == "PR")
|
||||||
{
|
{
|
||||||
if (content.size() < 2)
|
if (content.size() < 2 || !is_courtroom_constructed())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -702,7 +688,7 @@ void AOApplication::server_packet_received(AOPacket packet)
|
|||||||
}
|
}
|
||||||
else if (header == "PU")
|
else if (header == "PU")
|
||||||
{
|
{
|
||||||
if (content.size() < 3)
|
if (content.size() < 3 || !is_courtroom_constructed())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user