p2r3 / epochtal

Portal 2 tournament framework
https://epochtal.p2r3.com/
GNU General Public License v3.0
8 stars 4 forks source link

Implement a portable livestream interface #76

Closed p2r3 closed 4 months ago

p2r3 commented 4 months ago

This pull request ports and refactors the old weekly livestream UI from the previous version of Epochtal, while (hopefully) making it much more portable by requiring nothing more than a browser source and the Spplice package. This also aims to pave the way for general communication between the server and the game client, as I feel like the stream UI is a good, simple, and practical starting point for that. Some of the frontend stuff isn't final either, so that said:

There's still some stuff to do

Closes #3 Closes #6

p2r3 commented 4 months ago

I've done some basic (production) testing myself, yeah. I'm still afraid that there's some condition for a crash left unaccounted for in all the websocket logic, but this pull request probably isn't what introduced that in the first place, then.

soni801 commented 4 months ago

I mean if there's an easy way to test this i might do some tomorrow

p2r3 commented 4 months ago

If you wish, super quick summary of how to:

  1. Open /stream in a browser (this is the overlay for OBS or whatever)
  2. Open /stream/controller in another browser tab/window
  3. Optionally, if you don't want to wait for the intro to play out, press the space key on the /stream tab
  4. Launch the Spplice package
  5. In the console, enter connect
  6. This isn't a step - while typing I just realized that the Spplice package hardcodes epochtal.p2r3.com unnecessarily, so there's that, thank you duck
  7. Go to the homepage, you should be prompted to enter the 4 digit code that the game gave you
  8. Should be good to go. Category selection, run selection, all that. Playing demos won't work unless you have the files in your portal2 directory, but seeing if it tries to run the command is a good enough test.
p2r3 commented 4 months ago
  1. Yeah, the buttons should probably keep track of some kind of state. You'll notice that the way this currently works avoids keeping track of state variables (they tend to get messy) - all the functions expect parameters specified by what's pushed to the DOM instead. Though realistically that's not really stopping me from setting the activation of that button.
  2. The connect part of this is a stepping stone for what'll eventually become Epochtal Live. Connecting to the players' game clients is essential for that project, and this will of course be presented in a user-friendly way. I'm aiming for this whole "gameauth" thing to become the go-to method of server-game interfacing. The stream UI is just a comfortable and practical first application.
  3. Fair enough.