early port of chatbox websocket client!#261
Conversation
craftxbox
left a comment
There was a problem hiding this comment.
absolute peak pr. i have been thinking about something like this for forever.
|
|
||
| try { | ||
| manuallyClosed = false; | ||
| websocket = new WebSocket(`ws://${websocketServer}`); |
There was a problem hiding this comment.
is it possible to get an option for wss://
There was a problem hiding this comment.
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') { |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
i presume it would be a stretch too far to ask for an API to send verbs through? maybe limited to says? just thinking.
There was a problem hiding this comment.
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
About The Pull Request
early port of tgstation/tgstation#96241
Screenshots
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: