room

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Room

type Room struct {
	ID string

	// 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, gamepath, gameName string, onlineStorage *storage.Client) *Room

NewRoom creates a new room

func (*Room) AddConnectionToRoom

func (r *Room) AddConnectionToRoom(peerconnection *webrtc.WebRTC, playerIndex int)

func (*Room) CleanSession

func (r *Room) CleanSession(peerconnection *webrtc.WebRTC)

func (*Room) Close

func (r *Room) Close()

func (*Room) IsPCInRoom

func (r *Room) IsPCInRoom(w *webrtc.WebRTC) bool

TODO: Reuse for remove Session

func (*Room) IsRunningSessions

func (r *Room) IsRunningSessions() bool

func (*Room) LoadGame

func (r *Room) LoadGame() error

func (*Room) SaveGame

func (r *Room) SaveGame() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL