Files
LucyandGitHub cd966fcdd2 chatbox websocket client! (#96241)
## About The Pull Request

Ports https://github.com/Monkestation/Monkestation2.0/pull/5744,
alongside the metadata stuff from
https://github.com/Monkestation/Monkestation2.0/pull/11617 and
https://github.com/Monkestation/Monkestation2.0/pull/11644

> This PR adds a websocket client to the chatbox, that redirects all
incoming payloads from the server, to the specified server, which allows
for external integrations with the game. All of which is parsable JSON.
> 
> Some ideas include RGB feedback, triggering an event in VTubing
software, or automating a physical device based on what's sent to the
chat. (For example, a haptic suit, and have a regex for "in the right
leg" or any body part)

The websocket can also be used to request basic "metadata" about the
current round - server name, station name, round id, map name, round
duration, and game state (all this information can be obtained via the
`status` world topic without being logged in anyways, to be clear) - if
the server has webroot set up, it will also send the webroot base url
and the links to the chat assets (i added this just so i could embed the
chat styling and icons in my chat log html)

**To be clear, the websocket is entirely client-side, if it's not
obvious.**

<details>
<summary>Example of metadata JSON</summary>

```json
{
  "type": "metadata",
  "payload": {
    "game_version": "/tg/Station 13",
    "server_name": "kbity station 13 (tg)",
    "round_id": "152",
    "map_name": "Minimal Runtime Station",
    "round_duration": 6,
    "gamestate": 3
  }
}
```

</details>

<sub>if y'all make a freaky joke i will beat you with a rock, I do not
care about _that_ kind of thing in the slightest.</sub>

## Why It's Good For The Game

Lots of interesting things. I've made a doohickey that allows me to
automatically save my chat logs instead of having to manually click
"Save Chat Log" in settings repeatedly (which is also limited by the
chat scrollback limit)

"i have had a recurring thought of adding websocket support so I can
swap my spotify playlists whenever I get into combat on lavaland" -
smartkar

## Screenshots

<img width="676" height="158" alt="2026-05-27 (1779927348) ~
dreamseeker"
src="https://github.com/user-attachments/assets/28185ddd-b6b6-423e-9b46-cfaa519972ac"
/>

<img width="2298" height="608" alt="2026-05-27 (1779927386) ~
WindowsTerminal"
src="https://github.com/user-attachments/assets/1e41b783-6c43-4399-9ab5-a9c8bf67d117"
/>

<img width="1651" height="391" alt="2026-05-27 (1779927395) ~
dreamseeker"
src="https://github.com/user-attachments/assets/5e905670-edd6-4efc-8d0c-3d19e39799a6"
/>

## Changelog
🆑 Absolucy, Flleeppyy
add: Added a websocket client, you can now forward incoming chat
messages to an external program, i.e allowing you to change music
playlists based on events, or such.
/🆑
2026-06-11 22:31:20 -07:00
..