From 3f7e0a684a513ce4d6ba4f6f1533794c6d6cdc0d Mon Sep 17 00:00:00 2001 From: Osmium Sorcerer Date: Sun, 22 Mar 2026 17:35:58 +0000 Subject: Remove sending client ID and HDID in CC packet The "select character" packet, CC, only needs one field: the character ID you're selecting. It uses two more: a client ID and an HDID. To select a character, you have to send your HDID every single time. This is ridiculous, you alredy send it to the server when you join. Remove it. I hoped to use empty strings in both unused fields to fully erase them without breaking the packet structure, but some servers *require* both to be present, so hardcode "0" instead. CC doesn't need anything beyond CID. Client ID _might_ be used for some spoofing protection, but even then it sounds far-fetched. --- src/charselect.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/charselect.cpp b/src/charselect.cpp index 2443393..5097814 100644 --- a/src/charselect.cpp +++ b/src/charselect.cpp @@ -201,7 +201,13 @@ void Courtroom::char_clicked(int n_char) if (n_char != m_cid || n_char == -1) { ao_app->send_server_packet(AOPacket("PW", {ui_char_password->text()})); - ao_app->send_server_packet(AOPacket("CC", {QString::number(ao_app->client_id), QString::number(n_char), get_hdid()})); + // The first field is unused; upstream sends the client ID for some reason. + // The second field is the actual character ID. + // The third field is HDID, which is absolutely ridiculous to send here. + // Because of ossification of AO protocol, three fields are required. + // Tsuserver annoyingly enforces that the first field is an integer, and the + // last field is a string. Hardcode dumb "0" in both places and move on. + ao_app->send_server_packet(AOPacket("CC", {"0", QString::number(n_char), "0"})); } if (n_char == m_cid || n_char == -1) { -- cgit