system

package
v0.0.0-...-01a19e3 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Slot    uint64
	Command common.Command
}

Action is generated by player's command.

type DisplayServer

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

DisplayServer expose RPC server for displays.

func NewDisplayServer

func NewDisplayServer() *DisplayServer

NewDisplayServer return new display server.

func (*DisplayServer) AddDisplay

func (d *DisplayServer) AddDisplay(di display)

AddDisplay allows to push a new display in server.

func (*DisplayServer) Connect

Connect display action.

func (*DisplayServer) Print

func (d *DisplayServer) Print(fs []render.Frame)

Print send frame to all displays.

func (*DisplayServer) RemoveDisplay

func (d *DisplayServer) RemoveDisplay(di display)

RemoveDisplay removes a existing display in server.

type PlayerServer

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

PlayerServer expose RPC server for players.

func NewPlayerServer

func NewPlayerServer() *PlayerServer

NewPlayerServer returns new player server.

func (*PlayerServer) AddPlayer

func (p *PlayerServer) AddPlayer(pl *player)

AddPlayer allows to push a new player in server.

func (*PlayerServer) Connect

func (p *PlayerServer) Connect(stream playerSDK.Player_ConnectServer) error

Connect player action.

func (*PlayerServer) OnAction

func (p *PlayerServer) OnAction(f func(Action))

OnAction allows to set action callback.

func (*PlayerServer) RemovePlayer

func (p *PlayerServer) RemovePlayer(pl *player)

RemovePlayer removes a existing player in server.

func (*PlayerServer) ResetCallback

func (p *PlayerServer) ResetCallback()

ResetCallback removes existing callbacks.

type SoftwareMeta

type SoftwareMeta struct {
	UUID                           string
	MinPlayerCount, MaxPlayerCount uint64
}

SoftwareMeta contains metadata for a software.

type SoftwareServer

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

SoftwareServer exposes RPC server for softwares.

func NewSoftwareServer

func NewSoftwareServer() *SoftwareServer

NewSoftwareServer returns new software server.

func (*SoftwareServer) AddSoftware

func (s *SoftwareServer) AddSoftware(so *software)

AddSoftware allows to push a new software in server.

func (*SoftwareServer) CloseSoftware

func (s *SoftwareServer) CloseSoftware()

CloseSoftware allows to stop running software if exists.

func (*SoftwareServer) Command

func (s *SoftwareServer) Command(slot uint64, cmd common.Command)

Command sends player command to current software.

func (*SoftwareServer) Connect

Connect software action.

func (*SoftwareServer) Create

Create software action.

func (*SoftwareServer) GetSoftwaresMeta

func (s *SoftwareServer) GetSoftwaresMeta() []SoftwareMeta

GetSoftwaresMeta returns metadata from softwares.

func (*SoftwareServer) Load

Load software action.

func (*SoftwareServer) OnPrint

func (s *SoftwareServer) OnPrint(f func(render.Frame))

OnPrint allows to set print callback.

func (*SoftwareServer) OnSoftwareChange

func (s *SoftwareServer) OnSoftwareChange(f func([]SoftwareMeta))

OnSoftwareChange allows to set software change callback.

func (*SoftwareServer) RemoveSoftware

func (s *SoftwareServer) RemoveSoftware(so *software)

RemoveSoftware removes a existing software in server.

func (*SoftwareServer) ResetCallback

func (s *SoftwareServer) ResetCallback()

ResetCallback removes existing callbacks.

func (*SoftwareServer) StartSoftware

func (s *SoftwareServer) StartSoftware(meta SoftwareMeta, playerCount uint64) error

StartSoftware executes start for a given software meta and player count, it also close current software if exists.

Jump to

Keyboard shortcuts

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