-
Notifications
You must be signed in to change notification settings - Fork 345
Chatbox Websocket client #5744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chatbox Websocket client #5744
Conversation
…station2.0 into websocket-server
changing music volume apparently triggers a "websocket disabled" message. how. |
fixed
|
This seems to be causing a problem for one user - #5791 |
…#5881) ## About The Pull Request Handful of things. - Mostly ports tgstation/tgstation#89811 - - Code was changed so it's compatible with 515 and 516 via `Byond.saveBlob` - Replaces some `if (type === action.type)` with switch cases - Renames a few files from `js` to `ts` - Fixes resizable textareas not dynamically will likely conflict with #5744 ## Why It's Good For The Game Ability to export/import chat settings would be very helpful for the 515->516 migration. ## Changelog :cl:Kashargul add: You can now import and export chat settings /:cl:
OOC > addust johnson hits you in the right leg with the mechanical toolbox > hurt the right legs of everyone who dares hook up a haptic suit to ss13 (add a note to make regex ignore OOC or face the consequences) |
LOL hahehaheheh socket.on("message", async (data) => {
try {
const messageData = JSON.parse(data.toString("utf-8"));
if (messageData.type !== "chat/message") return;
const parsedPayload = JSON.parse(messageData.payload);
if (!parsedPayload?.content?.html) return;
const message = parsedPayload.content.html.toLowerCase();
if (message.includes('<span class="prefix">OOC:</span>') || message.includes('<span class="ooc"')) return |
About The Pull Request
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)
Works on 515 and 516. (I didn't realize IE11 had websockets until I went to go and make sure my code to disable it worked, then had to double check myself because it was connecting to my websocket server, and working. so. LOL)
Here's a barebones snippet, not feature complete but it has enough where you can start with phrase
Why It's Good For The Game
QoL for people who want things outside of the game to respond to in-game actions. See above examples.
Changelog
🆑
add: Chatbox websocket feature
/:cl: