From 3b8bc386d316b6e177c814920f21f5ab5d798ee6 Mon Sep 17 00:00:00 2001 From: Osmium Sorcerer Date: Sun, 22 Mar 2026 17:30:03 +0000 Subject: Support passworded characters in character list This obscure feature has been present for years, from sending passwords to the server to showing `char_passworded` image over character icons. Servers could already exploit clients sending `PW` with a password every time they select a character to implement passworded characters. The clients had no way of knowing which ones were passworded, however, and couldn't filter them despite "Passworded" checkbox being here all along. The approach used by this commit is a hack. During loading, server sends SC which is a list of characters, each one having name, description, and evidence. In practice, only names were used. Descriptions were stored in memory but unused, and evidence was ignored altogether. By adding a magic value "P" in this "character evidence" field, server can mark passworded characters without breaking Vanilla compatibility. --- src/aocharbutton.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/aocharbutton.h') diff --git a/src/aocharbutton.h b/src/aocharbutton.h index ba61897..64bea50 100644 --- a/src/aocharbutton.h +++ b/src/aocharbutton.h @@ -18,6 +18,8 @@ public: void setCharacter(QString character); + void setPassworded(bool enabled); + void setTaken(bool enabled); protected: @@ -30,7 +32,9 @@ protected: private: AOApplication *ao_app; + bool m_passworded = false; bool m_taken = false; + AOImage *ui_passworded; AOImage *ui_taken; AOImage *ui_selector; }; -- cgit