lobby

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Rendered for js/wasm

Overview

Package lobby contains code to view available games and to close the websocket.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lobby

type Lobby struct {
	Socket Socket
	// contains filtered or unexported fields
}

Lobby handles viewing, joining, and creating games on the server.

func New

func New(log *log.Log, game *gameController.Game) *Lobby

New creates a lobby for games.

func (*Lobby) InitDom

func (l *Lobby) InitDom(ctx context.Context, wg *sync.WaitGroup)

InitDom registers lobby dom functions.

func (*Lobby) SetGameInfos

func (l *Lobby) SetGameInfos(gameInfos []game.Info, username string)

SetGameInfos updates the game-infos table with the game infos for the username.

type Socket

type Socket interface {
	Connect(event js.Value) error
	Close()
}

Socket is a structure that connects the server to the lobby.

Jump to

Keyboard shortcuts

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