Skip to content

early port of chatbox websocket client!#261

Open
Absolucy wants to merge 2 commits into
Monkestation:masterfrom
Absolucy:early-websockets
Open

early port of chatbox websocket client!#261
Absolucy wants to merge 2 commits into
Monkestation:masterfrom
Absolucy:early-websockets

Conversation

@Absolucy
Copy link
Copy Markdown
Contributor

About The Pull Request

early port of tgstation/tgstation#96241

Screenshots

2026-05-27 (1779927348) ~ dreamseeker 2026-05-27 (1779927386) ~ WindowsTerminal 2026-05-27 (1779927395) ~ dreamseeker

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.
/:cl:

Copy link
Copy Markdown
Contributor

@craftxbox craftxbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

absolute peak pr. i have been thinking about something like this for forever.


try {
manuallyClosed = false;
websocket = new WebSocket(`ws://${websocketServer}`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to get an option for wss://

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i mean sure... this was made with the assumption that you'd just have the server on ur own pc (or at least your local network), but nothing preventing that i guess

});

websocket.addEventListener('message', (event) => {
if (event.data === 'requestMetadata') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WS likes to silently close sometimes so it would be nice to have a ping/pong as a check-alive


websocket.addEventListener('message', (event) => {
if (event.data === 'requestMetadata') {
Byond.sendMessage('requestMetadata');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i presume it would be a stretch too far to ask for an API to send verbs through? maybe limited to says? just thinking.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can do that anyways by sending requests to the localhost byond http server with http://127.0.0.1:[whatever]/?winset or something anyways

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants