1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
# AO2 client (SoF)
Experimental fork of AO2 Client made for Serenade of Flames by Osmium Sorcerer.
Features boring cryptography, new audio engine, up-to-date components, various
small improvements, and opinions.
Adds SoF extensions compatible with the CSDWASASH server.
Upstream: <https://github.com/AttorneyOnline/AO2-Client>
This branch is frequently rebased against the upstream `master`.
My contributions are alternatively available under the MIT license; the project
as a whole remains under GPLv3.
## Why
I've started working on this primarily to implement secure connections and
authentication, which became essential as I was writing CSDWASASH, the server.
Authentication on AO typically involves exchanging plaintext passwords over
insecure connections (which are most certainly stored in clear in the server
configs). Instead, I proposed [public-key
authentication](https://git.sof.beauty/sof-auth-model/about). Users have secret
keys that they keep on the client (protected by a passphrase). They only share
their _public keys_ with the server, so authentication never requires sending
secrets or storing them on the server (unlike modpasses).
Next, Secure WebSocket (WSS). The upstream [now supports
WSS](https://github.com/AttorneyOnline/AO2-Client/pull/1114) (thank you, sD),
and it rightfully prioritizes WSS ports for servers that advertise it on
the public list. I rebased my WSS implementation on this idea, additionally
extending support to favorite servers and to the direct connect. The UI now
provides a clear distinction for WSS servers.
The audio engine has been rewritten, completely getting rid of BASS in favor of
[miniaudio](https://miniaud.io). BASS was the only proprietary component that
had to be separately bundled as a DLL and linked dynamically, so I replaced it
with the high-quality, simple, public-domain audio library.
Finally, protocol experiments. Thanks to WebSocket already providing different
frames for text and binary messages, I can integrate a custom subprotocol using
binary frames while leaving the AO packet distribution in its domain of text
frames. The subprotocol is used to implement the authentication with its own
wire format. This extended protocol can only be used with CSDWASASH and is
incompatible with the vanilla AO.
Other small additions:
- Passworded characters. Specifically, a way for the server to tell the client
which characters are passworded. Servers could already use passwords.
- Removed some obsolete features, like unused packets or listing of legacy
server entries (we haven't been able to connect to them for a few years now).
- Strictly use HTTPS to connect to the masterserver.
- Show area list by default instead of music, as it's more important.
- IC message input is cleared as soon as the message is sent instead of checking
the sender of incoming messages. Should prevent accidental spam.
Limitations: no APNG support, no music flags in the player, extensions only work
on CSDWASASH.
Further development:
- AVIF support.
- Proper static linking everywhere. Generally, a sensible build system.
- Removal of legacy cruft (such as the feature list).
- Protocol redesign.
## Building
Upstream build scripts are unused, and instead I use CMake directly with LLVM
toolchain. Note: this process is bad and barely works.
Three profiles are provided: Release (optimized), Dev (unoptimized, fast
build), Debug (added debugging information and AddressSanitizer, slow).
On Linux, with CMake and Ninja:
1. `cmake -DCMAKE_BUILD_TYPE="Release" -DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_LINKER_TYPE=LLD -GNinja -Bbuild`
2. `ninja -Cbuild`
For Windows, I [cross-compile via
Clang](https://clang.llvm.org/docs/CrossCompilation.html) with
`x86_64-pc-windows-gnu` target and a custom sysroot (not included in this
repository because it's all dependencies rebuilt from source).
Dependencies (CMake will look for them):
- Qt6: Base, WebSockets, ImageFormats, Tools
- [libvorbis](https://xiph.org/vorbis)
- [libopusfile](https://opus-codec.org/docs)
- [libsodium](https://libsodium.org)
Additional dependencies you might have to provide manually (in `lib`):
- [Discord RPC](https://github.com/discord/discord-rpc) if you build with
`-DAO_ENABLE_DISCORD_RPC=ON`.
- APNG image plugin (don't bother, it doesn't work unless you build a fully
static plugin).
## Credits
The original Attorney Online client was created by FanatSors.
This is an open-source remake of that client created by OmniTroid.
The logo (`logo.png` and `logo.ico`) was designed by Lucas Carbí. The characters
depicted in the logo are owned by Capcom.
## Copyright
The project is licensed under the GPLv3 license.
Copyright (c) 2016-2018 OmniTroid
Modifications copyright (c) 2017-2018 oldmud0
Case Café additions copyright (c) 2018 Cerapter
Killing Fever Online additions copyright (c) 2019 Crystalwarrior
Serenade of Flames additions © 2026 Osmium Sorcerer
|