Skip to content
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

[Request] Websocket integration #14

Open
megalon opened this issue May 6, 2019 · 3 comments
Open

[Request] Websocket integration #14

megalon opened this issue May 6, 2019 · 3 comments

Comments

@megalon
Copy link

megalon commented May 6, 2019

Sending the request queue information over a websocket would allow users to display the queue in their Twitch overlay, similar to the HTTP Status mod.

I was able to display the request queue in my own stream by setting up a simple Node.js server on my gaming desktop, reading the SongRequestQueue.json file, and sending that through a GET response to a small local webpage. I then displayed the webpage in OBS with the bowser source, similar to the HTTP Status mod, and was able to show the request queue on stream.

Here it is in the bottom left
cardboard-requests
The information stored in the SongRequestQueue.json was perfect for displaying in overlay, but it would be much more convenient to connect to a websocket instead of running a local server. I had to watch the file for changes then update the queue accordingly.

Some possible events that could be sent over the websocket:

Event Description
menu Send the current request queue to the websocket. This would be useful for initial connection. As far as I'm aware, there is no way to send data upon connection to a websocket, so simply sending out the queue when the player loads to the menu would be an easy solution.
requestPlayed Send the song info for whatever song is selected when the "play" button is clicked in the request queue.
requestAdded Send the song info for the new song that is requested.
requestSkipped Send the song info for the song that was just skipped.
requestBanned Send the song info for the song that was just banned.
@angturil
Copy link
Owner

angturil commented May 6, 2019 via email

@angturil
Copy link
Owner

angturil commented May 6, 2019

Nice hack on the songrequestqueue.json. It remains to be seen if that file remains as .json in future releases, but if it proves useful, I can consider keeping it that way.

@Interpause
Copy link

Interpause commented Apr 24, 2020

would it auto-update the in-game queue if I wrote directly to the songrequestqueue json?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants