websession

package
v0.0.0-...-fcffdc5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindResourcePack

func FindResourcePack() string

func LaunchServer

func LaunchServer(world WorldAPI, pack *resourcepack.ResourcePack) error

func LaunchServerFromFlags

func LaunchServerFromFlags(api WorldAPI)

does not return

func LoadResourcePack

func LoadResourcePack() (*resourcepack.ResourcePack, error)

Types

type PlayerAPI

type PlayerAPI interface {
	Remove()
	IsValid() bool
	Command(cmd webclient.Command)
	Render() sprite.SpriteView
	PullRequests() (lines []string, sounds []sprite.Sound, flicks []sprite.Flick)
}

WorldAPI can be single-threaded; Session will not call any function until the last call returned. This is true across both interfaces.

type WorldAPI

type WorldAPI interface {
	AddPlayer(key string) PlayerAPI
	Tick()
	// only a single call to SubscribeToUpdates needs to be supported by the WorldAPI
	SubscribeToUpdates() <-chan struct{}
}

Jump to

Keyboard shortcuts

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