web

package
v0.0.0-...-77df42f Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Send     chan []byte
	ID       uint8
	Metadata struct {
		RemoteAddr string
		UserAgent  string
		Username   string
	}
	// contains filtered or unexported fields
}

func (*Client) ReadPump

func (c *Client) ReadPump()

func (*Client) WritePump

func (c *Client) WritePump()

type Event

type Event = uint8
const (
	Compression Event
	CompressionLevel
	FramePatching
	FrameSkipping
	ClientStatus
	BackgroundDisabled
	WindowDisabled
	SpritesDisabled
	FramePatchingRatio
	FrameCaching
	RegisterUsername
	Player2Confirmation
	KeepAlive = 254
	Closing   = 255
)

type Player

type Player struct {
	// contains filtered or unexported fields
}

func (*Player) Attach

func (p *Player) Attach(gb *gameboy.GameBoy)

func (*Player) Initialize

func (p *Player) Initialize(emu display.Emulator)

func (*Player) ReadPump

func (p *Player) ReadPump(from <-chan []byte)

func (*Player) Start

func (p *Player) Start(fb <-chan []byte, events <-chan event.Event, pressed, released chan<- io.Button) error

func (*Player) Stop

func (p *Player) Stop() error

func (*Player) Sync

func (p *Player) Sync(c *Client)

Sync sends the current state of the Game Boy and various Player information to the provided client.

type PlayerEvent

type PlayerEvent = uint8
const (
	PausePlay PlayerEvent = iota
	Status
	BackgroundEnabled
	WindowEnabled
	SpritesEnabled
)

type Type

type Type = uint8
const (
	Frame Type = iota
	FramePatch
	FrameSkip
	ClientInfo
	PatchCache
	PatchCacheSync
	FrameCache
	FrameCacheSync
	FrameSync
	ClientListSync
	ClientClosing
	ClientListNew
	ClientListIdentify
	ServerInfo
	PlayerInfo
	PlayerIdentify
)

Jump to

Keyboard shortcuts

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