Documentation ¶
Index ¶
- Constants
- func NewVideoImporter(roomID string) chan nanoarch.GameFrame
- type Room
- func (r *Room) AddConnectionToRoom(peerconnection *webrtc.WebRTC)
- func (r *Room) Close()
- func (r *Room) IsEmpty() bool
- func (r *Room) IsPCInRoom(w *webrtc.WebRTC) bool
- func (r *Room) IsRunningSessions() bool
- func (r *Room) LoadGame() error
- func (r *Room) RemoveSession(w *webrtc.WebRTC)
- func (r *Room) SaveGame() error
- func (r *Room) ToggleMultitap() error
- func (r *Room) UpdatePlayerIndex(peerconnection *webrtc.WebRTC, playerIndex int)
Constants ¶
View Source
const (
SocketAddrTmpl = "/tmp/cloudretro-retro-%s.sock"
)
Variables ¶
This section is empty.
Functions ¶
func NewVideoImporter ¶
NewVideoImporter return image Channel from stream
Types ¶
type Room ¶
type Room struct { ID string // voiceInChannel is voice stream received from users //voiceInChannel chan []byte // voiceOutChannel is voice stream routed to all users //voiceOutChannel chan []byte //voiceSample [][]byte // State of room IsRunning bool // Done channel is to fire exit event when room is closed Done chan struct{} // contains filtered or unexported fields }
Room is a game session. multi webRTC sessions can connect to a same game. A room stores all the channel for interaction between all webRTCs session and emulator
func NewRoom ¶
func NewRoom(roomID string, game games.GameMetadata, onlineStorage *storage.Client, cfg worker.Config) *Room
NewRoom creates a new room
func (*Room) AddConnectionToRoom ¶
func (*Room) IsPCInRoom ¶
TODO: Reuse for remove Session
func (*Room) IsRunningSessions ¶
func (*Room) RemoveSession ¶
RemoveSession removes a peerconnection from room and return true if there is no more room
func (*Room) SaveGame ¶
SaveGame will save game to local and trigger a callback to store game on onlineStorage, so the game can be accessed later
func (*Room) ToggleMultitap ¶
Click to show internal directories.
Click to hide internal directories.