diff options
| author | in1tiate <32779090+in1tiate@users.noreply.github.com> | 2021-03-15 17:56:42 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-15 17:56:42 -0500 |
| commit | e4483719d495ec7fca50ce0e39480d01d565f9de (patch) | |
| tree | 21a767b104d4dc7eadbc2b945279f316820c5a15 /src/packet_distribution.cpp | |
| parent | 3cac87737809ce7beb48323be77405ef25622d70 (diff) | |
Deprecate hardcoded string-based authentication, add AUTH packet (#489)
Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
Diffstat (limited to 'src/packet_distribution.cpp')
| -rw-r--r-- | src/packet_distribution.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp index ea4c77aa..e8f98e17 100644 --- a/src/packet_distribution.cpp +++ b/src/packet_distribution.cpp @@ -199,6 +199,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet) additive_enabled = false; effects_enabled = false; expanded_desk_mods_enabled = false; + auth_packet_enabled = false; if (f_packet.contains("yellowtext", Qt::CaseInsensitive)) yellow_text_enabled = true; if (f_packet.contains("prezoom", Qt::CaseInsensitive)) @@ -229,6 +230,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet) y_offset_enabled = true; if (f_packet.contains("expanded_desk_mods", Qt::CaseInsensitive)) expanded_desk_mods_enabled = true; + if (f_packet.contains("auth_packet", Qt::CaseInsensitive)) + auth_packet_enabled = true; } else if (header == "PN") { if (f_contents.size() < 2) @@ -683,6 +686,14 @@ void AOApplication::server_packet_received(AOPacket *p_packet) if (f_contents.size() > 1 && f_contents.at(1) == "1") w_courtroom->on_reload_theme_clicked(); } + // Auth packet + else if (header == "AUTH") { + if (!courtroom_constructed || !auth_packet_enabled || f_contents.size() < 1) + goto end; + int authenticated = f_contents.at(0).toInt(); + + w_courtroom->on_authentication_state_received(authenticated); + } end: |
