player

package
v0.0.0-...-af59c4b Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection interface {
	Id() string
	Write(message string)
	Close()
}

type Manager

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

func NewPlayerManager

func NewPlayerManager(persistenceManager *persistence.PersistenceManager) *Manager

func (*Manager) DropSession

func (manager *Manager) DropSession(id string) *Player

func (*Manager) GetSession

func (manager *Manager) GetSession(id string) *Player

GetSession the player for the given id, otherwise null

func (*Manager) Init

func (manager *Manager) Init() error

func (*Manager) SessionByName

func (manager *Manager) SessionByName(id string, name string) (*Player, error)

func (*Manager) UpdatePlayerStarSystem

func (manager *Manager) UpdatePlayerStarSystem(id string, starSystem string) error

type Player

type Player struct {
	ID    string
	Name  string
	Admin bool
	// game
	StarSystem *string
	// contains filtered or unexported fields
}

func NewPlayer

func NewPlayer(id string, data *types.Player) *Player

func (*Player) AddConnection

func (player *Player) AddConnection(connection Connection)

func (*Player) DropConnection

func (player *Player) DropConnection(connection Connection)

func (*Player) Push

func (player *Player) Push(v interface{}) error

Jump to

Keyboard shortcuts

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