room

package
v1.13.4 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector func(plugin.Room, fetch.Fetcher) (plugin.Plugin, error)

type EventHandler

type EventHandler func(event.Event) event.Event

type Middleware

type Middleware func(EventHandler) EventHandler

type Room

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

func Load

func Load(load *loader.LoadJSON) (*Room, error)

func NewRoom

func NewRoom(id string) *Room

func (*Room) AddStones

func (r *Room) AddStones(moves []*coord.Stone)

func (*Room) AddStonesToTrunk

func (r *Room) AddStonesToTrunk(t int, moves []*coord.Stone)

func (*Room) Board

func (r *Room) Board() *board.Board

func (*Room) Broadcast

func (r *Room) Broadcast(evt event.Event)

func (*Room) BroadcastFullFrame

func (r *Room) BroadcastFullFrame()

func (*Room) BroadcastHubMessage

func (r *Room) BroadcastHubMessage(m *message.Message)

func (*Room) BroadcastTreeOnly

func (r *Room) BroadcastTreeOnly()

func (*Room) Close

func (r *Room) Close() error

func (*Room) Current

func (r *Room) Current() *tree.TreeNode

func (*Room) DeregisterConnection

func (r *Room) DeregisterConnection(id string)

func (*Room) DeregisterPlugin

func (r *Room) DeregisterPlugin(key string)

func (*Room) DisableBuffers

func (r *Room) DisableBuffers()

used for testing

func (*Room) EditKomi

func (r *Room) EditKomi(s string)

func (*Room) EditPlayerBlack

func (r *Room) EditPlayerBlack(s string)

func (*Room) EditPlayerWhite

func (r *Room) EditPlayerWhite(s string)

func (*Room) Execute

func (r *Room) Execute(cmd state.Command) (*state.Frame, error)

func (*Room) GenerateFullFrame

func (r *Room) GenerateFullFrame(t state.TreeJSONType) *state.Frame

func (*Room) GenerateTreeOnly

func (r *Room) GenerateTreeOnly(t state.TreeJSONType) *state.Frame

func (*Room) GetAuth

func (r *Room) GetAuth(user string) bool

func (*Room) GetColorAt

func (r *Room) GetColorAt(t int) color.Color

func (*Room) GetConnector

func (r *Room) GetConnector(key string) Connector

func (*Room) GetFetcher

func (r *Room) GetFetcher() fetch.Fetcher

func (*Room) GetHandler

func (room *Room) GetHandler(t string) EventHandler

func (*Room) GetInputBuffer

func (r *Room) GetInputBuffer() int64

func (*Room) GetLastActive

func (r *Room) GetLastActive() time.Time

func (*Room) GetLastMessages

func (r *Room) GetLastMessages(user string) (time.Time, bool)

func (*Room) GetLastUser

func (r *Room) GetLastUser() string

func (*Room) GetNick

func (r *Room) GetNick(user string) (string, bool)

func (*Room) GetPassword

func (r *Room) GetPassword() string

func (*Room) GetPlugin

func (r *Room) GetPlugin(key string) plugin.Plugin

func (*Room) GetState

func (r *Room) GetState() *state.State

func (*Room) GetTimeout

func (r *Room) GetTimeout() float64

func (*Room) GetUserBuffer

func (r *Room) GetUserBuffer() int64

func (*Room) Handle

func (r *Room) Handle(ec event.EventChannel) error

func (*Room) HandleAny

func (r *Room) HandleAny(evt event.Event) event.Event

HandleAny is only to be used in special occasions because it recreates all the handlers

func (*Room) HasPassword

func (r *Room) HasPassword() bool

func (*Room) HasPlugin

func (r *Room) HasPlugin(key string) bool

func (*Room) HeadColor

func (r *Room) HeadColor() color.Color

func (*Room) ID

func (r *Room) ID() string

func (*Room) Nicks

func (r *Room) Nicks() map[string]string

func (*Room) NumConns

func (r *Room) NumConns() int

func (*Room) PushHead

func (r *Room) PushHead(x, y int, col color.Color) bool

func (*Room) RegisterConnection

func (r *Room) RegisterConnection(ec event.EventChannel) string

func (*Room) RegisterPlugin

func (r *Room) RegisterPlugin(p plugin.Plugin, args map[string]any)

func (*Room) Save

func (r *Room) Save() *loader.LoadJSON

func (*Room) SaveState

func (r *Room) SaveState() *state.StateJSON

func (*Room) SendTo

func (r *Room) SendTo(id string, evt event.Event)

func (*Room) SendUserList

func (r *Room) SendUserList()

func (*Room) SetAuth

func (r *Room) SetAuth(user string, val bool)

func (*Room) SetAuthAll

func (r *Room) SetAuthAll()

func (*Room) SetConnector

func (r *Room) SetConnector(key string, c Connector)

func (*Room) SetFetcher

func (r *Room) SetFetcher(f fetch.Fetcher)

func (*Room) SetInputBuffer

func (r *Room) SetInputBuffer(i int64)

func (*Room) SetLastActive

func (r *Room) SetLastActive(t *time.Time)

func (*Room) SetLastMessages

func (r *Room) SetLastMessages(user string, t *time.Time)

func (*Room) SetLastUser

func (r *Room) SetLastUser(user string)

func (*Room) SetLogger

func (r *Room) SetLogger(l logx.Logger)

func (*Room) SetNick

func (r *Room) SetNick(id, nick string)

func (*Room) SetPassword

func (r *Room) SetPassword(p string)

func (*Room) SetState

func (r *Room) SetState(s *state.State)

func (*Room) SetTimeout

func (r *Room) SetTimeout(f float64)

func (*Room) SetUserBuffer

func (r *Room) SetUserBuffer(i int64)

func (*Room) Size

func (r *Room) Size() int

wrappers around the state

func (*Room) ToSGF

func (r *Room) ToSGF() string

func (*Room) ToSGFIX

func (r *Room) ToSGFIX() string

func (*Room) UploadSGF

func (r *Room) UploadSGF(sgf string) event.Event

type Settings

type Settings struct {
	Buffer   int64
	Size     int
	Password string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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