<feed xmlns='http://www.w3.org/2005/Atom'>
<title>webao/webAO/client/sender/index.ts, branch master</title>
<subtitle>WebAO fork</subtitle>
<link rel='alternate' type='text/html' href='https://git.sof.beauty/webao/'/>
<entry>
<title>Separate the MC packet into music and area change</title>
<updated>2026-04-18T16:52:22+00:00</updated>
<author>
<name>Osmium Sorcerer</name>
<email>os@sof.beauty</email>
</author>
<published>2026-03-16T16:33:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sof.beauty/webao/commit/?id=3f1140da7779f568137d62b3f35392edc9e02e1e'/>
<id>3f1140da7779f568137d62b3f35392edc9e02e1e</id>
<content type='text'>
Historically, MC packet ended up in a ridiculous spot. It had this
single structure:

MC#something#cid#%

It used to change music track to `something`, and the character ID `cid`
was used in clientside muting (blindly trusted, by the way). Then,
this packet was expanded to mean area change as well, so the same
generic structure carried two completely different meanings.

How does one differentiate the two? Whether the client tried to move to
an area `something`, or played a music track called `something`?

The solution was to assume that having ".extension" at the end magically
implied that it was a name of a music file, check the string `something`
within the MC packet, and pray that you guessed correctly. So,
understanding the protocol message required penetrating into one of its
data fields and ambiguously inferring what the whole message even meant.

Modern AO gives us a more logical solution. Not as good as having two
separate packets for two unrelated actions, but we can at least discern
the area and music change directly from the framing.

Area change uses the same two-field structure: MC#area#cid#%

Music change, however, has acquired two additional fields:
MC#music#cid#showname#flags#%

We consider four-field MC to be music change, and two-field MC to be
area change, resolving the ambiguity and eliminating odd constraints
on area and music names.

WebAO still uses the old logic and sends two-field MC packets for both
cases. CSDWASASH server, as a result, thinks that web users try to
change areas when they play music. This commit fixes this behavior and
adds special sendAreaChange instead of using sendMusicChange for both.
The flags are hardcoded to 0 because WebAO can't set fade-in, fade-out,
or position sync, and it ignores the server flags.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Historically, MC packet ended up in a ridiculous spot. It had this
single structure:

MC#something#cid#%

It used to change music track to `something`, and the character ID `cid`
was used in clientside muting (blindly trusted, by the way). Then,
this packet was expanded to mean area change as well, so the same
generic structure carried two completely different meanings.

How does one differentiate the two? Whether the client tried to move to
an area `something`, or played a music track called `something`?

The solution was to assume that having ".extension" at the end magically
implied that it was a name of a music file, check the string `something`
within the MC packet, and pray that you guessed correctly. So,
understanding the protocol message required penetrating into one of its
data fields and ambiguously inferring what the whole message even meant.

Modern AO gives us a more logical solution. Not as good as having two
separate packets for two unrelated actions, but we can at least discern
the area and music change directly from the framing.

Area change uses the same two-field structure: MC#area#cid#%

Music change, however, has acquired two additional fields:
MC#music#cid#showname#flags#%

We consider four-field MC to be music change, and two-field MC to be
area change, resolving the ambiguity and eliminating odd constraints
on area and music names.

WebAO still uses the old logic and sends two-field MC packets for both
cases. CSDWASASH server, as a result, thinks that web users try to
change areas when they play music. This commit fixes this behavior and
adds special sendAreaChange instead of using sendMusicChange for both.
The flags are hardcoded to 0 because WebAO can't set fade-in, fade-out,
or position sync, and it ignores the server flags.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove CH-sending timer</title>
<updated>2026-04-18T16:52:22+00:00</updated>
<author>
<name>Osmium Sorcerer</name>
<email>os@sof.beauty</email>
</author>
<published>2026-03-16T14:12:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sof.beauty/webao/commit/?id=2ef41402209b82279656ae4b1affe6484be1ed77'/>
<id>2ef41402209b82279656ae4b1affe6484be1ed77</id>
<content type='text'>
CH is an application-level keepalive packet that clients periodically
send for two reasons:

1. It tells the server they're still connected, preventing timeouts.

2. By measuring latency between sending CH and receiving CHECK, a client
   can display ping.

Keepalive is redundant because WebSocket can handle that via PING frames on a
transport layer. WebAO also completely ignores CHECK and sends CH every
five seconds, which is superfluous (AO2 Client sends it once every 45
seconds, in comparison).

Sending CH via `setInterval` was also problematic: browsers seem to
throttle it when the tab becomes inactive, preventing periodic pings and
leading to the server disconnecting inactive browser clients.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
CH is an application-level keepalive packet that clients periodically
send for two reasons:

1. It tells the server they're still connected, preventing timeouts.

2. By measuring latency between sending CH and receiving CHECK, a client
   can display ping.

Keepalive is redundant because WebSocket can handle that via PING frames on a
transport layer. WebAO also completely ignores CHECK and sends CH every
five seconds, which is superfluous (AO2 Client sends it once every 45
seconds, in comparison).

Sending CH via `setInterval` was also problematic: browsers seem to
throttle it when the tab becomes inactive, preventing periodic pings and
leading to the server disconnecting inactive browser clients.
</pre>
</div>
</content>
</entry>
<entry>
<title>akashi expects 2 args for modcalls</title>
<updated>2024-12-12T21:17:39+00:00</updated>
<author>
<name>stonedDiscord</name>
<email>Tukz@gmx.de</email>
</author>
<published>2024-12-12T21:17:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sof.beauty/webao/commit/?id=8b0b8cac98d650d175ebb26441d415b95fca0e4e'/>
<id>8b0b8cac98d650d175ebb26441d415b95fca0e4e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Prettified Code!</title>
<updated>2024-11-20T13:31:50+00:00</updated>
<author>
<name>stonedDiscord</name>
<email>stonedDiscord@users.noreply.github.com</email>
</author>
<published>2024-11-20T13:31:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sof.beauty/webao/commit/?id=6684f3fce6e90fd0574d7bab63b629554ab03ef6'/>
<id>6684f3fce6e90fd0574d7bab63b629554ab03ef6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>add ban button</title>
<updated>2024-08-07T18:49:33+00:00</updated>
<author>
<name>stonedDiscord</name>
<email>Tukz@gmx.de</email>
</author>
<published>2024-08-07T18:49:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sof.beauty/webao/commit/?id=73373ce08b060c97fcb6311e862b8261c3222d9f'/>
<id>73373ce08b060c97fcb6311e862b8261c3222d9f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>I'm so sorry</title>
<updated>2022-09-09T02:20:32+00:00</updated>
<author>
<name>Caleb</name>
<email>caleb.mabry.15@cnu.edu</email>
</author>
<published>2022-09-09T02:20:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sof.beauty/webao/commit/?id=776fe2f4241a67be354908df546f300f413a7d42'/>
<id>776fe2f4241a67be354908df546f300f413a7d42</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add Sender support</title>
<updated>2022-09-08T16:13:14+00:00</updated>
<author>
<name>Caleb</name>
<email>caleb.mabry.15@cnu.edu</email>
</author>
<published>2022-09-08T16:13:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sof.beauty/webao/commit/?id=9b8f8c3f5310b6af15edf8ff933e2d63e05707a7'/>
<id>9b8f8c3f5310b6af15edf8ff933e2d63e05707a7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
