Currently I’m trying to implement a lobby mechanism for our game on top of streams. What I’m trying to achieve is:
- Create Lobbys that users can join or leave
- Anyone in a Lobby can create/start a match, but only one match can be active within a Lobby
- Users joining a Lobby, that has an ongoing match should get some information about the ongoing game (e.g. state & matchID)
My current implementation for the lobby is based upon streams. Each lobby is a stream that users can join or leave. A user starting a game broadcasts the created matchID and current state to all Lobby users.
But my question is: What would be the best approach to let new users know about the current state of the lobby. Am I somehow able to store a state of a stream on the server side? Or should a client from within the stream rebroadcast the current state, once a new user joins the stream?
Thanks in advance for your help!