aboutsummaryrefslogtreecommitdiff
path: root/src/charselect.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/charselect.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/charselect.cpp')
-rw-r--r--src/charselect.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/charselect.cpp b/src/charselect.cpp
index d57d7518..bcf230d3 100644
--- a/src/charselect.cpp
+++ b/src/charselect.cpp
@@ -178,10 +178,9 @@ void Courtroom::char_clicked(int n_char)
if (n_char != m_cid || n_char == -1) {
ao_app->send_server_packet(
- new AOPacket("PW#" + ui_char_password->text() + "#%"));
+ new AOPacket("PW", {ui_char_password->text()}));
ao_app->send_server_packet(
- new AOPacket("CC#" + QString::number(ao_app->s_pv) + "#" +
- QString::number(n_char) + "#" + get_hdid() + "#%"));
+ new AOPacket("CC", {QString::number(ao_app->s_pv), QString::number(n_char), get_hdid()}));
}
if (n_char == m_cid || n_char == -1) {
update_character(n_char);