aboutsummaryrefslogtreecommitdiff
path: root/src/evidence.cpp
diff options
context:
space:
mode:
authorCrystalwarrior <Varsash@Gmail.com>2022-07-30 19:42:22 +0300
committerGitHub <noreply@github.com>2022-07-30 18:42:22 +0200
commit7b88d4be954b415e069ee0d612e4df3793c61756 (patch)
treeeb8b93c10d369c0d0c5d6629e61dc661a0863481 /src/evidence.cpp
parentcf91cc03f849bba498cd8d91505bf8db04f8b1f9 (diff)
Never send an unencoded packet to the server (#719)
* never send an unencoded packet to the server * oops * Improve packet validation to remove segfaults * WARNING: commit breaks connecting to servers, need help start fixing omniwhy caused by single fuckin string packets (AAAAAAAAAAAAAAAAA) * Fix failed connections to servers (Thanks to @Iuvee for helping me figure this out!) * Fix demoserver * who the fuck still uses goto Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * ANOTHER GOTO???? Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * braces Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * good bot Update src/packet_distribution.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix demoserver harder * Improve demo logging * Fix memory leakage by deleting the packet Fix useless demoserver wait packet creation when none of that packet is used Co-authored-by: stonedDiscord <Tukz@gmx.de> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Salanto <62221668+Salanto@users.noreply.github.com>
Diffstat (limited to 'src/evidence.cpp')
-rw-r--r--src/evidence.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/evidence.cpp b/src/evidence.cpp
index 7fcad61b..289ef758 100644
--- a/src/evidence.cpp
+++ b/src/evidence.cpp
@@ -436,7 +436,7 @@ void Courtroom::on_evidence_clicked(int p_id)
if (f_real_id == local_evidence_list.size()) {
if (current_evidence_global)
ao_app->send_server_packet(
- new AOPacket("PE#<name>#<description>#empty.png#%"));
+ new AOPacket("PE", {"<name>", "<description>", "empty.png"}));
else {
evi_type f_evi;
f_evi.name = "<name>";
@@ -567,7 +567,7 @@ void Courtroom::on_evidence_delete_clicked()
evidence_close();
if (current_evidence_global)
ao_app->send_server_packet(
- new AOPacket("DE#" + QString::number(current_evidence) + "#%"));
+ new AOPacket("DE", {QString::number(current_evidence)}));
else {
local_evidence_list.remove(current_evidence);
private_evidence_list = local_evidence_list;